-
Notifications
You must be signed in to change notification settings - Fork 116
Add outcome to transactions and spans #299
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
Changes from all commits
a9c7e56
8ac52e7
fcd43cf
1445edc
4b219a9
ce2a818
32139bd
c390771
362e2a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ Agents should instrument HTTP request routers/handlers, starting a new transacti | |
|
||
- The transaction `type` should be `request`. | ||
- The transaction `result` should be `HTTP Nxx`, where N is the first digit of the status code (e.g. `HTTP 4xx` for a 404) | ||
- The transaction `outcome` should be `"success"` for HTTP status codes < 500 and `"failure"` for status codes >= 500. \ | ||
Status codes in the 4xx range (client errors) are not considered a `failure` as the failure has not been caused by the application itself but by the caller. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be the default behavior but we should allow users to capture 4xx errors as errors as some users for e.g. may want to capture 401/403 as errors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it enough to just offer the API for now? I'd wait to add another config option until we actually get requests for that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added APIs for setting the outcome in the Python implementation: elastic/apm-agent-python@ce13f92b63 So a user could do this somewhere in their code if they determine that the transaction should be considered failed:
|
||
As there's no browser API to get the status code of a page load, the RUM agent always reports `"unknown"` for those transactions. | ||
- The transaction `name` should be aggregatable, such as the route or handler name. Examples: | ||
|
||
- `GET /users/{id}` | ||
- `UsersController#index` | ||
|
||
|
@@ -40,7 +42,8 @@ We capture spans for outbound HTTP requests. These should have a type of `extern | |
|
||
For outbound HTTP request spans we capture the following http-specific span context: | ||
|
||
- `http.url` (the target URL) | ||
- `http.status_code` (the response status code) | ||
- `http.url` (the target URL) \ | ||
The captured URL should have the userinfo (username and password), if any, redacted. | ||
- `http.status_code` (the response status code) \ | ||
The span's `outcome` should be set to `"success"` if the status code is lower than 400 and to `"failure"` otherwise. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as above to allow flexibility to users to customize the outcomes based on what they see as errors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it seems like for spans we are considering an erroneous outcome if < 400 and for transactions it is >500. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's >= 400 for spans (includes client errors) and >= 500 for transactions (does not include client errors) |
||
|
||
The captured URL should have the userinfo (username and password), if any, redacted. |
Uh oh!
There was an error while loading. Please reload this page.