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

[otelgrpc] Do not panic for nil instruments #4875

Merged
merged 6 commits into from Jan 30, 2024

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jan 29, 2024

There is no guarantee when a Meter returns an error the instrument will not be nil. Default to a no-op implementation of the instrument in that case so the instrumentation does not panic.

Close open-telemetry/opentelemetry-go#4836

@MrAlias MrAlias added this to the v0.47.0 milestone Jan 29, 2024
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef8063b) 81.3% compared to head (b02d422) 81.5%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4875     +/-   ##
=======================================
+ Coverage   81.3%   81.5%   +0.1%     
=======================================
  Files        151     151             
  Lines      10894   10904     +10     
=======================================
+ Hits        8866    8891     +25     
+ Misses      1869    1859     -10     
+ Partials     159     154      -5     
Files Coverage Δ
...entation/google.golang.org/grpc/otelgrpc/config.go 87.8% <100.0%> (+18.2%) ⬆️

@MrAlias MrAlias marked this pull request as ready for review January 29, 2024 19:54
@MrAlias MrAlias merged commit 8437075 into open-telemetry:main Jan 30, 2024
22 checks passed
@MrAlias MrAlias deleted the default-non-nil-inst-grpc branch January 30, 2024 19:49
@MrAlias MrAlias modified the milestones: v0.47.0, v0.48.0 Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question about correctness of metric.Meter implementation and use
4 participants