-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add CRT error to CRT request logs, move CRT per-request logs to DEBUG #669
Add CRT error to CRT request logs, move CRT per-request logs to DEBUG #669
Conversation
Signed-off-by: Daniel Carl Jones <[email protected]>
FYI @IsaevIlya |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good. We could go a bit further, but happy to do that in a separate PR if you prefer.
Signed-off-by: Daniel Carl Jones <[email protected]>
"CRT request failed" | ||
} else { | ||
"request finished" | ||
"CRT request finished" | ||
}; | ||
event!(log_level, %request_type, http_status, ?range, ?duration, ?ttfb, %request_id, "{}", message); | ||
trace!(detailed_metrics=?metrics, "request completed"); | ||
debug!(%request_type, ?crt_error, http_status, ?range, ?duration, ?ttfb, %request_id, "{}", message); | ||
trace!(detailed_metrics=?metrics, "CRT request completed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just bikeshedding but i don't think "CRT request" is the right way to describe these. it's an S3 request that failed. if we're going to push these down to debug level, i don't see the need to also write "CRT" here.
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of awslabs#669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
A side effect of #669 was that there's now no way to get request IDs for failed requests at the default logging settings, as only DEBUG-level messages include the request IDs. This change adds request IDs to the meta request failure message when available, so that these WARN-level messages still include request IDs. I also added some new infrastructure to test metrics and log messages. For metrics, we build a new `metrics::Recorder` that collects all the metrics and can then be searched to find them. For log messages, we build a `tracing_subscriber::Layer` that collects all tracing events emitted while enabled. In both cases, the new objects aren't thread safe, as both `Recorder`s and `Layer`s are global state. So these tests need to continue to use `rusty_fork` to split into a new process per test. Signed-off-by: James Bornholt <[email protected]>
Description of change
At the moment, errors for individual requests made by the CRT client (inside of a meta request) can fail and we log that they failed, but only with the HTTP Status (or lack thereof as "-1").
For example, these three requests failed for different reasons.
We have access to a CRT error code here, so we should surface that. These also log on success, so I've wrapped it in an
Option<>
.I've also updated the message itself to be "CRT request" to try and highlight that these are inner requests made by the CRT that can be retried or be part of a much larger meta request.
An error message may look like this now:
I almost wonder if we should be logging these as warning, as it has caused some confusion around what has actually happened and if the data was really retrieved or the application failed to handle that error. For now, I'll leave them as warning.
Relevant issues: N/A
Does this change impact existing behavior?
No behavior change, logs contain new information. Message changes slightly.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).