-
Notifications
You must be signed in to change notification settings - Fork 200
Propagate tags from worker to host #3303
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds functionality to propagate Activity tags from the worker to the host through the trace context. Tags from the worker's invocation activity are captured, filtered to exclude known OpenTelemetry attributes, and sent back to the host via the InvocationResponse.
Changes:
- Added trace_context field to InvocationResponse protobuf message
- Implemented tag extraction from Activity and storage in FunctionContext.Items
- Created filtering logic to exclude known OpenTelemetry attributes from propagated tags
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| protos/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto | Added trace_context field to InvocationResponse message for tag propagation |
| src/DotNetWorker.Core/Diagnostics/TraceConstants.cs | Added KnownAttributes list and FunctionContextItemsKey constant to support tag filtering |
| src/DotNetWorker.Core/FunctionsApplication.cs | Extracts Activity tags to dictionary and stores in FunctionContext.Items after function execution |
| src/DotNetWorker.Grpc/Handlers/InvocationHandler.cs | Added AddTraceContextTags method to filter and populate trace context in response |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RpcTraceContext traceContext = AddTraceContextTags(request, context); | ||
| response.TraceContext = traceContext; |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new functionality to propagate trace context tags lacks test coverage. Based on the test patterns observed in InvocationHandlerTests.cs, consider adding a test that verifies the trace context is properly populated in the InvocationResponse when tags are present in the FunctionContext.Items, and another test to verify that known attributes are filtered out correctly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…re-functions-dotnet-worker into satvu/otel-worker-tags
Issue describing the changes in this PR
Related to Azure/azure-functions-host#11574 and the PR resolving it.
Depends on Azure/azure-functions-language-worker-protobuf#98.
Pull request checklist
release_notes.md