Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4108](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4108))
- `opentelemetry-instrumentation-tornado`: Implement new semantic convention opt-in migration
([#3993](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3993))
- `opentelemetry-instrumentation-tornado`: pass request attributes at span creation
([#4140](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4140))
- `opentelemetry-instrumentation-pyramid` Implement new semantic convention opt-in migration
([#3982](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3982))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,22 +754,21 @@ def _get_full_handler_name(handler):


def _start_span(tracer, handler, sem_conv_opt_in_mode) -> _TraceContext:
attributes = _get_attributes_from_request(
handler.request, sem_conv_opt_in_mode
)
span, token = _start_internal_or_server_span(
tracer=tracer,
span_name=_get_default_span_name(handler.request),
start_time=time_ns(),
context_carrier=handler.request.headers,
context_getter=textmap.default_getter,
attributes=attributes,
)

if span.is_recording():
attributes = _get_attributes_from_request(
handler.request, sem_conv_opt_in_mode
)
for key, value in attributes.items():
span.set_attribute(key, value)
span.set_attribute("tornado.handler", _get_full_handler_name(handler))
if span.is_recording() and span.kind == trace.SpanKind.SERVER:
if span.kind == trace.SpanKind.SERVER:
custom_attributes = _collect_custom_request_headers_attributes(
handler.request.headers
)
Expand Down