Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: refactor error stats #141

Merged
merged 1 commit into from
Dec 15, 2024
Merged

Conversation

fuweid
Copy link
Collaborator

@fuweid fuweid commented Dec 15, 2024

Introduce ResponseError type to record error client received. It includes timestamp, timespan in seconds and error message. The RunnerMetricReport will export raw data about each response error. It can help us build view about error.

// ResponseError is the record about that error.
type ResponseError struct {
       // Timestamp indicates when this error was received.
       Timestamp time.Time `json:"timestamp"`
       // Duration records timespan in seconds.
       Duration float64 `json:"duration"`
       // Type indicates that category to which the error belongs.
       Type ResponseErrorType `json:"type"`
       // Code only works when Type is http.
       Code int `json:"code,omitempty"`
       // Message shows error message for this error.
       //
       // NOTE: When Type is http, this field will be empty.
       Message string `json:"message,omitempty"`
}

Introduce ResponseError type to record error client received. It
includes timestamp, timespan in seconds and error message. The
RunnerMetricReport will export raw data about each response error. It
can help us build view about error.

```go
// ResponseError is the record about that error.
type ResponseError struct {
       // Timestamp indicates when this error was received.
       Timestamp time.Time `json:"timestamp"`
       // Duration records timespan in seconds.
       Duration float64 `json:"duration"`
       // Type indicates that category to which the error belongs.
       Type ResponseErrorType `json:"type"`
       // Code only works when Type is http.
       Code int `json:"code,omitempty"`
       // Message shows error message for this error.
       //
       // NOTE: When Type is http, this field will be empty.
       Message string `json:"message,omitempty"`
}
```

Signed-off-by: Wei Fu <weifu@microsoft.com>
@fuweid fuweid force-pushed the weifu/refactor-error-stats branch from 72013bb to a182551 Compare December 15, 2024 00:45
@fuweid
Copy link
Collaborator Author

fuweid commented Dec 15, 2024

Let's merge it first.

@fuweid fuweid merged commit 4346c43 into Azure:main Dec 15, 2024
4 checks passed
@fuweid fuweid deleted the weifu/refactor-error-stats branch December 15, 2024 17:33
@anson627
Copy link
Contributor

can we make raw data optional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants