-
Notifications
You must be signed in to change notification settings - Fork 420
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
feature(tracing): add support for inferred proxy spans to support AWS API Gateway tracing #12053
base: conti/standardize-web-frameworks-to-use-core
Are you sure you want to change the base?
feature(tracing): add support for inferred proxy spans to support AWS API Gateway tracing #12053
Conversation
…on for testing purposes and add a test demonstrating the relationship of aws api gateway spans and flask span.
…on for testing purposes and add a test demonstrating the relationship of the aws api gateway span and flask span.
…Add test for distributed tracing, which currently fails.
|
Datadog ReportBranch report: ✅ 0 Failed, 130 Passed, 1468 Skipped, 4m 34.05s Total duration (36m 10.42s time saved) |
BenchmarksBenchmark execution time: 2025-01-25 00:35:26 Comparing candidate commit 85bcab2 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 394 metrics, 2 unstable metrics. |
ddtrace/_trace/trace_handlers.py
Outdated
core.dispatch("inferred_proxy.start", (ctx, tracer, span_kwargs, call_trace, distributed_headers_config)) | ||
# re-get span_kwargs in case an inferred span was created and we have a new span_kwargs.child_of field | ||
span_kwargs = ctx.get_item("span_kwargs") | ||
|
||
span_kwargs.update(kwargs) | ||
span = (tracer.trace if call_trace else tracer.start_span)(ctx["span_name"], **span_kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a note to fix/investigate this: Even if the above line was fixed: span_kwargs = ctx.get_item("span_kwargs")
, when it hits this line, it throws an error about tracer.trace not accepting a child of argument:
TypeError: Tracer.trace() got an unexpected keyword argument 'child_of'
In https://github.com/DataDog/dd-trace-py/pull/11938/files, it used start_span which supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fixed, there has to be a check to ensure trace()
is not being called since it auto-handles context.
…des, adjust span creation, and fix time conversion from ms to ns for the inferred span
…i/support-aws-api-gateway
…creating multiple aws apigateway spans for one request and adjust the test.
Motivation
Adds support for inferred proxy spans created from distributed headers for web server integrations.
Checklist
Reviewer Checklist