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

[OpenTracing] Context propagation implementation #495

Merged
merged 4 commits into from
Aug 6, 2018

Conversation

delner
Copy link
Contributor

@delner delner commented Jul 20, 2018

This pull request implements context propagation using Propagator classes, which serialize/deserialize trace context from carriers.

It provides full implementation for Rack and TextMap formats. Binary format is still a no-op.

@delner delner added core Involves Datadog core libraries feature Involves a product feature labels Jul 20, 2018
@delner delner self-assigned this Jul 20, 2018
@delner
Copy link
Contributor Author

delner commented Jul 20, 2018

I'm looking into adding some integration tests for the tracer, to test round-trip inject/extract, after which I think this will be ready.

end

def header_to_baggage(key)
key[BAGGAGE_PREFIX_FORMATTED.length, key.length].downcase
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a possible issue with round-trip propagation here. I'm anticipating there's a case where you could have baggage items with names containing either -s or uppercase characters. These should serialize to the carrier without issue, however, they'd probably fail to be extracted back to their original form, because how Rack forces headers to uppercase and underscores.

e.g. My-Baggage-Item --> #inject --> HTTP_OT_BAGGAGE_MY_BAGGAGE_ITEM --> #extract --> my_baggage_item.

I'm not sure this is possible to correct for, because we lose resolution on whether the key should have these dashes or uppercase characters when it goes through this conversion. Just something to watch out for.

@delner delner force-pushed the feature/opentracing_context_propagation branch from 3e1d548 to 0c4cc15 Compare July 20, 2018 19:47
Copy link
Member

@Kyle-Verhoog Kyle-Verhoog left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Copy link
Contributor

@pawelchcki pawelchcki left a comment

Choose a reason for hiding this comment

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

👍

@delner delner merged commit 0c491e9 into feature/opentracing Aug 6, 2018
@delner delner deleted the feature/opentracing_context_propagation branch August 6, 2018 15:33
delner added a commit that referenced this pull request Aug 9, 2018
* Added: Propagators to OpenTracer.

* Added: Specs for OpenTracer::Propagators.

* Fixed: OpenTracer::Tracer#start_span not using provided SpanContext.

* Added: OpenTracer context propagation integration specs.
delner added a commit that referenced this pull request Aug 17, 2018
* Added: Propagators to OpenTracer.

* Added: Specs for OpenTracer::Propagators.

* Fixed: OpenTracer::Tracer#start_span not using provided SpanContext.

* Added: OpenTracer context propagation integration specs.
@delner delner added this to the 0.16.0 milestone Aug 23, 2018
delner added a commit that referenced this pull request Sep 13, 2018
* Added: Propagators to OpenTracer.

* Added: Specs for OpenTracer::Propagators.

* Fixed: OpenTracer::Tracer#start_span not using provided SpanContext.

* Added: OpenTracer context propagation integration specs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries feature Involves a product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants