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

[distributed_headers] Accept signed integers as IDs. #530

Merged

Conversation

alloy
Copy link
Contributor

@alloy alloy commented Sep 3, 2018

This is what dd-trace-js sends over the wire:
https://github.com/DataDog/dd-trace-js/blob/aa607860ea6bb57f2f69fa7ee72ed3ce25abfbf6/src/opentracing/propagation/text_map.js#L14-L15

It’s also what has been patched in e.g. dd-trace-go:
DataDog/dd-trace-go#326


def id(header)
value = header(header).to_i
return if value == 0 || value >= Span::MAX_ID
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assumed that 0 is truly invalid as an ID, but definitely don’t know for sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, is there a trace specification available?

Copy link
Contributor

Choose a reason for hiding this comment

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

At this moment documentation is not available. But since this issue surfaced its something on our radar.

@pawelchcki pawelchcki self-requested a review September 4, 2018 16:28
@pawelchcki pawelchcki self-assigned this Sep 4, 2018
@pawelchcki
Copy link
Contributor

Thanks for the contribution! Looks good overall, however I'm worried if the process of converting to unsigned is compatible with how Go is performing it.

Would it be possible to add another test for the same number as Go implementation tests - https://github.com/DataDog/dd-trace-go/pull/326/files#diff-58eb3484bc934d38b7496e8a7363200fR47 ?

BTW The tests are not passing because of CircleCI security where Caches cannot be persisted by forks - our CI is not working properly for some PRs. We have PR in progress to fix that #526

@pawelchcki pawelchcki added core Involves Datadog core libraries community Was opened by a community member labels Sep 10, 2018
@alloy alloy force-pushed the accept-negative-distributed-tracing-ids branch from 198704f to 142192f Compare September 10, 2018 13:44
@alloy
Copy link
Contributor Author

alloy commented Sep 10, 2018

Sure thing 👍 Updated with the test from the Go PR.

@alloy alloy force-pushed the accept-negative-distributed-tracing-ids branch from 142192f to 49b882d Compare September 10, 2018 13:58
@delner delner added this to the 0.15.0 milestone Sep 11, 2018
@delner
Copy link
Contributor

delner commented Sep 11, 2018

@alloy There's a CI failure related to a Rubocop violation; if we can fix that and see the tests pass, I think we can merge this for 0.15.0.

@alloy
Copy link
Contributor Author

alloy commented Sep 11, 2018

@delner Done. Thanks for the poke 👍

Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for your contribution @alloy !

@delner delner changed the base branch from master to 0.15-dev September 12, 2018 14:46
@delner delner changed the base branch from 0.15-dev to master September 12, 2018 14:57
@delner delner changed the base branch from master to 0.15-dev September 12, 2018 15:00
@delner delner merged commit c5bec24 into DataDog:0.15-dev Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants