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

Add xray propagators that prioritizes xray environment variable #2573

Merged
merged 10 commits into from
Jun 13, 2024
Prev Previous commit
Next Next commit
Add no environment variable test case
  • Loading branch information
ocelotl committed Jun 12, 2024
commit 7b536e19b72fb1c2df5d471474b4603de43822f4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@

class AwsXRayLambdaPropagatorTest(TestCase):

def test_extract_no_environment_variable(self):
propagator = AwsXrayLambdaPropagator()

default_getter = DefaultGetter()

actual_context = get_current_span(
propagator.extract(
{}, context=get_current(), getter=default_getter
)
).get_span_context()

self.assertEqual(
hex(actual_context.trace_id), "0x0"
)
self.assertEqual(hex(actual_context.span_id), "0x0")
self.assertFalse(
actual_context.trace_flags.sampled,
)
self.assertEqual(actual_context.trace_state, TraceState.get_default())

@patch.dict(
environ,
{
Expand Down