Skip to content

Update TraceState #276

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

Merged
merged 10 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: master
CORE_REPO_SHA: 883e80e766c9d3401e3e6450abfb67b0cc8411a7

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DD_ORIGIN = "_dd_origin"
DD_ORIGIN = "dd_origin"
Copy link
Member Author

Choose a reason for hiding this comment

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

Key must start with alphabet or digit as per specs.

AUTO_REJECT = 0
AUTO_KEEP = 1
USER_KEEP = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def extract(
span_id=int(span_id),
is_remote=True,
trace_flags=trace_flags,
trace_state=trace.TraceState({constants.DD_ORIGIN: origin}),
trace_state=trace.TraceState([(constants.DD_ORIGIN, origin)]),
)

return set_span_in_context(trace.DefaultSpan(span_context), context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def test_origin(self):
span_id=trace_api.INVALID_SPAN,
is_remote=True,
trace_state=trace_api.TraceState(
{datadog.constants.DD_ORIGIN: "origin-service"}
[(datadog.constants.DD_ORIGIN, "origin-service")]
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def test_inject_into_context_with_non_default_state(self):
AwsXRayPropagatorTest.XRAY_PROPAGATOR.inject(
AwsXRayPropagatorTest.carrier_setter,
carrier,
build_test_current_context(trace_state=TraceState({"foo": "bar"})),
build_test_current_context(
trace_state=TraceState([("foo", "bar")])
),
)

# TODO: (NathanielRN) Assert trace state when the propagator supports it
Expand Down