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

incase sensitive http headers #22

Closed
barispeker opened this issue Oct 10, 2019 · 1 comment
Closed

incase sensitive http headers #22

barispeker opened this issue Oct 10, 2019 · 1 comment

Comments

@barispeker
Copy link

barispeker commented Oct 10, 2019

Hello,

When receiving B3 propagation http headers they can be lowercase like "x-b3-traceid" but petabridge check this key as case sensitive uppercase . (linkerd can changes these headers to lowercase which http headers are lowercase by default)

 internal const string B3TraceId = "X-B3-TraceId";
 internal const string B3SpanId = "X-B3-SpanId";
 internal const string B3ParentId = "X-B3-ParentSpanId";

......


 public ApplicationInsightsSpanContext Extract(ITextMap carrier)
        {
            string traceId = null;
            string spanId = null;
            string parentId = null;
            foreach (var entry in carrier)
                switch (entry.Key)
                {
                    case B3TraceId:
                        traceId = entry.Value;
                        break;
                    case B3SpanId:
                        spanId = entry.Value;
                        break;
                    case B3ParentId:
                        parentId = entry.Value;
                        break;
                }

            if (traceId != null && spanId != null) // don't care of ParentId is null or not
                return new ApplicationInsightsSpanContext(traceId, spanId, parentId);
            return null;
        }
@Aaronontheweb
Copy link
Member

closed via #29

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

No branches or pull requests

2 participants