Skip to content

Conversation

wangzlei
Copy link
Contributor

@wangzlei wangzlei commented Oct 1, 2025

Description of changes:

This PR is preparing code-level span attributes in ADOT Python library instrumentation.

  1. Feature control by environment variable "OTEL_AWS_CODE_CORRELATION_ENABLED"
  2. A decorator add_code_attributes_to_span support adding the decorated function's code level information into the current span. Refer to https://opentelemetry.io/docs/specs/semconv/code/
file: test.py
line 10  @add_code_attributes_to_span
line 11  def my_function():
               pass

span will have attributes:

{
  "code.function.name": "my_function",
  "code.file.path": "test.py",
  "code.line.number": 11
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wangzlei wangzlei requested a review from a team as a code owner October 1, 2025 22:50
@wangzlei wangzlei added the skip changelog doesn't need a CHANGELOG entry label Oct 1, 2025
@wangzlei wangzlei merged commit 6eaf909 into aws-observability:main Oct 3, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants