Skip to content
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

Added support for propagating OpenTelemetry baggage #2107

Merged
merged 2 commits into from
Mar 19, 2024
Merged

Conversation

mhelleborg
Copy link
Member

Description

Adds support for propagating Baggage via OTEL, by populating Baggage.Current if received in PropagationContext. Added tests to cover baggage propagation

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)

Checklist

  • I have added tests that prove my fix is effective or that my feature works

@@ -312,6 +313,11 @@ public static void Send(string source, PID target, object message, ActivitySetup

var propagationContext = envelope.Header.ExtractPropagationContext();

if (propagationContext.Baggage.Count > 0)
{
Baggage.Current = propagationContext.Baggage;
Copy link
Contributor

Choose a reason for hiding this comment

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

TLDR on this?
It extracts baggage via header values.
then set the Baggage.Current to an actual baggage.
and then create a new activity via BuildStartedActivity,
and BuildStartedActivity extracts data from Baggage.Current into the new activity?

@rogeralsing rogeralsing merged commit b94d515 into dev Mar 19, 2024
14 checks passed
@rogeralsing rogeralsing deleted the otel-baggage branch March 19, 2024 05:35
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