Skip to content

Add gRPC middleware Context-aware interfaces#14525

Closed
jmacd wants to merge 1 commit into
open-telemetry:mainfrom
jmacd:jmacd/middleware_context
Closed

Add gRPC middleware Context-aware interfaces#14525
jmacd wants to merge 1 commit into
open-telemetry:mainfrom
jmacd:jmacd/middleware_context

Conversation

@jmacd
Copy link
Copy Markdown
Contributor

@jmacd jmacd commented Feb 4, 2026

Description

The gRPC middleware interface does not support initializing context-aware middleware. This requires a new method for both client and server.

Link to tracking issue

Fixes #14523

Testing

Documentation

@jmacd jmacd requested a review from a team as a code owner February 4, 2026 01:28
@jmacd jmacd requested a review from dmitryax February 4, 2026 01:28
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (88735a1) to head (f6dd450).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14525      +/-   ##
==========================================
- Coverage   91.86%   91.85%   -0.01%     
==========================================
  Files         677      677              
  Lines       42705    42723      +18     
==========================================
+ Hits        39229    39244      +15     
- Misses       2423     2425       +2     
- Partials     1053     1054       +1     

☔ 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 4, 2026

Merging this PR will degrade performance by 32.68%

⚠️ 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.

❌ 1 regressed benchmark
✅ 60 untouched benchmarks
⏩ 20 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
HTTP/2.0,_client_per_thread_(like_single_app) 1.1 ms 1.6 ms -32.68%

Comparing jmacd:jmacd/middleware_context (f6dd450) with main (88735a1)

Open in CodSpeed

Footnotes

  1. 20 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.

// a remote source.
//
// This interface is consumed by configgrpc via configmiddleware.
type GRPCClientContext interface {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we deprecate the non-context and eventually remove since this is not a stable package?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I assumed this was stable because configmiddleware was stabilized.
(How can extensionmiddleware not be stable if configmiddleware is?)

I would say yes, we can remove these if technically unstable. I was motivated to really understand how we add new extension APIs, and I think this also demonstrates that capability.

@jmacd
Copy link
Copy Markdown
Contributor Author

jmacd commented Feb 5, 2026

In favor of #14536

@jmacd jmacd closed this Feb 5, 2026
pull Bot pushed a commit to Stars1233/opentelemetry-collector that referenced this pull request Apr 22, 2026
#### Description

Specifies the mechanics of our approach to safe interface evolution.

See  open-telemetry#14523
See open-telemetry#14525
See open-telemetry#13902

#### Testing

This pattern was "tested" in open-telemetry#13241 as I prototyped a rate-limiter
extension.

#### Documentation

✅

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
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

2 participants