feat(worker-proxy): instrument extension gRPC calls - #11962
Open
Jacob Viau (jviau) wants to merge 2 commits into
Open
feat(worker-proxy): instrument extension gRPC calls#11962Jacob Viau (jviau) wants to merge 2 commits into
Jacob Viau (jviau) wants to merge 2 commits into
Conversation
Jacob Viau (jviau)
force-pushed
the
u/jviau/extension-grpc-telemetry
branch
from
September 2, 2026 16:10
e3e3810 to
3e9bef3
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
It introduces avoidable per-call allocations in activity tag keys and leaves test-created Meter instances undisposed, both of which should be corrected before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds transport-level telemetry for WorkerProxy’s extension gRPC ingress, introducing metrics instruments and enriching request activities with correlation/concurrency tags to support observability of proxied extension RPC calls.
Changes:
- Register and emit extension gRPC metrics (active calls, call-open duration, total call duration).
- Enrich current
Activitywith extension RPC call/stream identifiers and active-call counts. - Add unit tests validating metric instruments and activity tag enrichment.
File summaries
| File | Description |
|---|---|
| test/Functions.WorkerProxy.Tests/ExtensionGrpcMetricsTests.cs | Adds a MeterListener-based test to validate emitted metric measurements. |
| test/Functions.WorkerProxy.Tests/ExtensionGrpcIngressTests.cs | Extends ingress tests to validate activity tags and wires metrics into ingress construction. |
| src/Functions.WorkerProxy/WorkerProxyApplication.cs | Registers metrics services and the new ExtensionGrpcMetrics singleton in DI. |
| src/Functions.WorkerProxy/ExtensionGrpcMetrics.cs | Introduces Meter instruments (histograms + up/down counter) for extension gRPC transport measurements. |
| src/Functions.WorkerProxy/ExtensionGrpcIngress.cs | Records metrics and enriches activity when calls open/complete. |
| src/Functions.WorkerProxy/ExtensionGrpcActivity.cs | Adds helpers to stamp activity tags for call correlation and concurrency snapshots. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+390
to
+397
| private sealed class TestMeterFactory : IMeterFactory | ||
| { | ||
| public Meter Create(MeterOptions options) => new(options); | ||
|
|
||
| public void Dispose() | ||
| { | ||
| } | ||
| } |
Comment on lines
+23
to
+36
| Activity? activity = Activity.Current; | ||
| activity?.SetTag($"{TagPrefix}.call_id", callId); | ||
| activity?.SetTag($"{TagPrefix}.stream_id", streamId); | ||
| activity?.SetTag($"{TagPrefix}.active_calls_at_open", activeCallCount); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Enriches the current activity with an extension call's final concurrency snapshot. | ||
| /// </summary> | ||
| /// <param name="activeCallCount">The active-call count when the call completes.</param> | ||
| public static void CallCompleted(int activeCallCount) | ||
| { | ||
| Activity? activity = Activity.Current; | ||
| activity?.SetTag($"{TagPrefix}.active_calls_at_completion", activeCallCount); |
Jacob Viau (jviau)
force-pushed
the
u/jviau/extension-grpc-telemetry
branch
from
September 2, 2026 17:20
3e9bef3 to
b94a85b
Compare
Jacob Viau (jviau)
force-pushed
the
u/jviau/extension-grpc-telemetry
branch
from
September 2, 2026 18:27
b94a85b to
79c9809
Compare
Jacob Viau (jviau)
force-pushed
the
u/jviau/extension-grpc-telemetry
branch
from
September 4, 2026 23:52
79c9809 to
650732e
Compare
Jacob Viau (jviau)
force-pushed
the
u/jviau/extension-grpc-telemetry
branch
from
September 5, 2026 00:05
650732e to
d1f45ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
N/A — final layer 4 of the WorkerProxy extension-RPC port, stacked on preceding PR #11961.
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-procbranch to be included in Core Tools and non-Flex deployments.in-procbranch is not requiredrelease_notes.mdAdditional information
Final layer 4 adds WorkerProxy extension gRPC metrics and activity enrichment. It follows preceding PR #11961 and preserves the transport behavior introduced by the earlier stack layers.