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

[exporters/otlp/otlpmetric] Wrap upload metrics error to provide additional context #3974

Merged
merged 4 commits into from Apr 10, 2023

Conversation

lukestoward
Copy link
Contributor

I've recently been investigating an unstructured error message that was being logged in a service that uses OTel tracing and metrics. The error message I was seeing looked like this:

context deadline exceeded: rpc error: code = DeadlineExceeded desc = context deadline exceeded

After spending significant time working through the code to identify where this was being logged, and what the root cause was, I've identified the issue. This PR is not related to the actual issue (this isn't an OTel issue), but it does make a small change to where the error is being handled to wrap the error to provide additional context information. This also aligns it with the error wrapping happening several lines below. With this change, the above message becomes:

failed to upload metrics: context deadline exceeded: rpc error: code = DeadlineExceeded desc = context deadline exceeded

Knowing that this error originated in the metrics exporter and specifically as part of the upload functionality would have saved me a lot of time. Hopefully, this small change will save others some time in the future.

CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #3974 (65ce305) into main (a261a0f) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3974   +/-   ##
=====================================
  Coverage   82.0%   82.0%           
=====================================
  Files        171     171           
  Lines      12969   12969           
=====================================
+ Hits       10643   10645    +2     
+ Misses      2106    2104    -2     
  Partials     220     220           
Impacted Files Coverage Δ
exporters/otlp/otlpmetric/internal/exporter.go 67.2% <100.0%> (ø)

... and 2 files with indirect coverage changes

Co-authored-by: Damien Mathieu <42@dmathieu.com>
@MrAlias MrAlias merged commit 1bc9b56 into open-telemetry:main Apr 10, 2023
21 checks passed
@MrAlias MrAlias mentioned this pull request Apr 27, 2023
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.

None yet

6 participants