Skip to content

Add context.Context to gRPC middleware interface constructors#14536

Merged
bogdandrutu merged 18 commits into
open-telemetry:mainfrom
jmacd:jmacd/middleware_context2
Mar 1, 2026
Merged

Add context.Context to gRPC middleware interface constructors#14536
bogdandrutu merged 18 commits into
open-telemetry:mainfrom
jmacd:jmacd/middleware_context2

Conversation

@jmacd
Copy link
Copy Markdown
Contributor

@jmacd jmacd commented Feb 5, 2026

Description

API change in extensionmiddleware, an unstable package to allow middleware access to the start context.

gRPC only. This exposes the same issue in HTTP middleware, which will have to be treated separately.

This is technically a breaking change in configmiddleware and for all implementations of this extension. We believe no one is using this feature outside of this repository, see memorylimiter is fixed here.

Link to tracking issue

Fixes #14523

Documentation

N/A

@jmacd jmacd requested a review from a team as a code owner February 5, 2026 18:47
@jmacd jmacd requested a review from songy23 February 5, 2026 18:47
@jmacd jmacd changed the title Add context.Context to gRPC middleware interfaces Add context.Context to gRPC middleware interface constructors Feb 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.82%. Comparing base (a36655a) to head (78fbf18).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
extension/memorylimiterextension/memorylimiter.go 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (90.90%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14536      +/-   ##
==========================================
- Coverage   91.83%   91.82%   -0.02%     
==========================================
  Files         680      680              
  Lines       43009    43009              
==========================================
- Hits        39497    39491       -6     
- Misses       2443     2447       +4     
- Partials     1069     1071       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 5, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 7 untouched benchmarks
⏩ 76 skipped benchmarks1


Comparing jmacd:jmacd/middleware_context2 (78fbf18) with main (a36655a)

Open in CodSpeed

Footnotes

  1. 76 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

This seems fine to me, I think the breakage is both justified and within our guidelines

Copy link
Copy Markdown
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

I suppose this needs a changelog?

Comment thread .chloggen/grpc-middlware-context.yaml
Comment thread extension/extensionmiddleware/client.go
Comment thread .chloggen/grpc-middlware-context.yaml Outdated
Comment thread .chloggen/config.yaml Outdated
Copy link
Copy Markdown
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Thanks for patiently handling all of the administrative churn.

You'll need to merge in the changes from #14626, but otherwise looks good.

@bogdandrutu
Copy link
Copy Markdown
Member

@jmacd please rebase

@bogdandrutu
Copy link
Copy Markdown
Member

@jmacd sorry for another ping, can you please fix the broken gates?

@bogdandrutu bogdandrutu added this pull request to the merge queue Mar 1, 2026
Merged via the queue into open-telemetry:main with commit f1a8858 Mar 1, 2026
65 of 66 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request Mar 1, 2026
#### Description

API change in extensionmiddleware, an unstable package to allow
middleware access to the start context.

HTTP only. gRPC is treated in #14536.

This is technically a breaking change in configmiddleware and for all
implementations of this extension. We believe no one is using this
feature outside of this repository, see memorylimiter is fixed here.

#### Link to tracking issue

Part of
#14523

#### Documentation

N/A
swiatekm pushed a commit to swiatekm/opentelemetry-collector that referenced this pull request Mar 4, 2026
…elemetry#14536)

#### Description

API change in extensionmiddleware, an unstable package to allow
middleware access to the start context.

gRPC only. This exposes the same issue in HTTP middleware, which will
have to be treated separately.

This is technically a breaking change in configmiddleware and for all
implementations of this extension. We believe no one is using this
feature outside of this repository, see memorylimiter is fixed here.

#### Link to tracking issue

Fixes
open-telemetry#14523

#### Documentation

N/A
swiatekm pushed a commit to swiatekm/opentelemetry-collector that referenced this pull request Mar 4, 2026
…elemetry#14549)

#### Description

API change in extensionmiddleware, an unstable package to allow
middleware access to the start context.

HTTP only. gRPC is treated in open-telemetry#14536.

This is technically a breaking change in configmiddleware and for all
implementations of this extension. We believe no one is using this
feature outside of this repository, see memorylimiter is fixed here.

#### Link to tracking issue

Part of
open-telemetry#14523

#### Documentation

N/A
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.

extensionmiddleware interface should accept context

6 participants