Skip to content

fix(otelgrpc): prevent panic when nil TracerProvider or MeterProvider is passed#8323

Merged
dmathieu merged 2 commits into
open-telemetry:mainfrom
dims:fix/otelgrpc-nil-provider-panic
Jan 6, 2026
Merged

fix(otelgrpc): prevent panic when nil TracerProvider or MeterProvider is passed#8323
dmathieu merged 2 commits into
open-telemetry:mainfrom
dims:fix/otelgrpc-nil-provider-panic

Conversation

@dims
Copy link
Copy Markdown
Contributor

@dims dims commented Dec 20, 2025

Commit 07504e4 removed nil checks from WithTracerProvider and WithMeterProvider, causing a panic when callers pass nil. This restores the checks so nil values are ignored and the global provider is used.

This showed up in some future-proof-ci jobs in kubernetes:
https://storage.googleapis.com/kubernetes-ci-logs/logs/ci-kubernetes-unit-dependencies/2002001097211777024/build-log.txt

@dims dims requested review from a team and dashpole as code owners December 20, 2025 14:19
@dims
Copy link
Copy Markdown
Contributor Author

dims commented Dec 20, 2025

cc @flc1125 and @dmathieu

@dims
Copy link
Copy Markdown
Contributor Author

dims commented Dec 20, 2025

xref: kubernetes/kubernetes#135865

@flc1125
Copy link
Copy Markdown
Member

flc1125 commented Dec 20, 2025

Perhaps we need to add a CHANGELOG.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.3%. Comparing base (3a7faa1) to head (a839e18).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8323   +/-   ##
=====================================
  Coverage   82.3%   82.3%           
=====================================
  Files        192     192           
  Lines      13767   13767           
=====================================
  Hits       11332   11332           
  Misses      2030    2030           
  Partials     405     405           
Files with missing lines Coverage Δ
...entation/google.golang.org/grpc/otelgrpc/config.go 86.2% <100.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dims dims force-pushed the fix/otelgrpc-nil-provider-panic branch 2 times, most recently from 8bbd4ef to 8a74ff1 Compare December 20, 2025 19:44
… is passed

Commit 07504e4 removed nil checks from WithTracerProvider and
WithMeterProvider, causing a panic when callers pass nil. This restores
the checks so nil values are ignored and the global provider is used.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
@dims dims force-pushed the fix/otelgrpc-nil-provider-panic branch from 8a74ff1 to 723c047 Compare December 22, 2025 23:40
Copy link
Copy Markdown
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dims

@dmathieu dmathieu merged commit 88faa83 into open-telemetry:main Jan 6, 2026
28 of 29 checks passed
@MrAlias MrAlias added this to the v1.40.0 milestone Jan 30, 2026
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.

5 participants