Skip to content

Conversation

@satvu
Copy link
Member

@satvu satvu commented Jan 22, 2026

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

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@satvu satvu marked this pull request as ready for review January 23, 2026 23:53
Copilot AI review requested due to automatic review settings January 23, 2026 23:53
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +120 to +121
RpcTraceContext traceContext = AddTraceContextTags(request, context);
response.TraceContext = traceContext;
Copy link

Copilot AI Jan 23, 2026

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.

Copilot uses AI. Check for mistakes.
satvu and others added 5 commits January 23, 2026 16:00
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>
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.

2 participants