botocore: Add support for AWS Secrets Manager semantic convention attribute#3765
Merged
xrmx merged 7 commits intoopen-telemetry:mainfrom Sep 23, 2025
Merged
botocore: Add support for AWS Secrets Manager semantic convention attribute#3765xrmx merged 7 commits intoopen-telemetry:mainfrom
xrmx merged 7 commits intoopen-telemetry:mainfrom
Conversation
added 2 commits
September 17, 2025 13:27
…ribute AWS Secrets Manager defines semantic convention attribute: AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn" https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-secrets-manager-attributes Currently, this attribute is not set in the botocore instrumentation library. This PR adds support for them by extracting values from both Request and Response objects. Tests Added new unit tests (passing). Verified with: tox -e py312-test-instrumentation-botocore tox -e spellcheck tox -e lint-instrumentation-botocore tox -e ruff Backward Compatibility This change is backward compatible. It only adds instrumentation for additional AWS resources and does not modify existing behavior in the auto-instrumentation library.
...rumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/secretsmanager.py
Outdated
Show resolved
Hide resolved
tammy-baylis-swi
approved these changes
Sep 17, 2025
Contributor
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
I think this looks good and similar to what the other botocore instrumentation extensions are doing.
…ntelemetry/instrumentation/botocore/extensions/secretsmanager.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
emdneto
approved these changes
Sep 18, 2025
xrmx
reviewed
Sep 23, 2025
instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_secretsmanager.py
Show resolved
Hide resolved
…est_botocore_secretsmanager.py
xrmx
approved these changes
Sep 23, 2025
zhirafovod
pushed a commit
to zhirafovod/opentelemetry-python-contrib
that referenced
this pull request
Sep 25, 2025
* cherry pick changes from previous PR * move span utils to new file * remove span state, use otel context for parent/child * flatten LLMInvocation to use attributes instead of dict keys * helper function and docstrings * refactor: store span and context token in LLMInvocation instead of SpanGenerator * refactor: rename prompts/chat_generations to input_messages/output_messages for clarity * refactor: simplify TelemetryHandler API by moving invocation data management to LLMInvocation class * refactor: update relative imports to absolute imports * Update handler to use a context manager instead of start_llm and stop_llm * resolve tox -e doc failure * safeguard against empty request-model * fix tox typecheck errors for utils * refactor: move tracer to generator, clean up dead code * remove unused linting hint * back off stricter request-model requirements * reintroduce manual start/stop for langchain callback flow * Fix typecheck in langchain instrumentation (open-telemetry#3773) * fix typecheck * fix ruff and added changelog * added lambda list * Update instrumentation-genai/opentelemetry-instrumentation-langchain/CHANGELOG.md --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * botocore: Add support for AWS Secrets Manager semantic convention attribute (open-telemetry#3765) * botocore: Add support for AWS Secrets Manager semantic convention attribute AWS Secrets Manager defines semantic convention attribute: AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn" https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-secrets-manager-attributes Currently, this attribute is not set in the botocore instrumentation library. This PR adds support for them by extracting values from both Request and Response objects. Tests Added new unit tests (passing). Verified with: tox -e py312-test-instrumentation-botocore tox -e spellcheck tox -e lint-instrumentation-botocore tox -e ruff Backward Compatibility This change is backward compatible. It only adds instrumentation for additional AWS resources and does not modify existing behavior in the auto-instrumentation library. * add ChangeLog. * Update instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/secretsmanager.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> * Update instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_secretsmanager.py --------- Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * clean up context handler, clarify unit tests * remove generator concept --------- Co-authored-by: wrisa <ridhimasatam@gmail.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Luke (GuangHui) Zhang <lukezha@amazon.com> Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com>
zhirafovod
pushed a commit
to zhirafovod/opentelemetry-python-contrib
that referenced
this pull request
Sep 26, 2025
* cherry pick changes from previous PR * move span utils to new file * remove span state, use otel context for parent/child * flatten LLMInvocation to use attributes instead of dict keys * helper function and docstrings * refactor: store span and context token in LLMInvocation instead of SpanGenerator * refactor: rename prompts/chat_generations to input_messages/output_messages for clarity * refactor: simplify TelemetryHandler API by moving invocation data management to LLMInvocation class * refactor: update relative imports to absolute imports * Update handler to use a context manager instead of start_llm and stop_llm * resolve tox -e doc failure * safeguard against empty request-model * fix tox typecheck errors for utils * refactor: move tracer to generator, clean up dead code * remove unused linting hint * back off stricter request-model requirements * reintroduce manual start/stop for langchain callback flow * Fix typecheck in langchain instrumentation (open-telemetry#3773) * fix typecheck * fix ruff and added changelog * added lambda list * Update instrumentation-genai/opentelemetry-instrumentation-langchain/CHANGELOG.md --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * botocore: Add support for AWS Secrets Manager semantic convention attribute (open-telemetry#3765) * botocore: Add support for AWS Secrets Manager semantic convention attribute AWS Secrets Manager defines semantic convention attribute: AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn" https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-secrets-manager-attributes Currently, this attribute is not set in the botocore instrumentation library. This PR adds support for them by extracting values from both Request and Response objects. Tests Added new unit tests (passing). Verified with: tox -e py312-test-instrumentation-botocore tox -e spellcheck tox -e lint-instrumentation-botocore tox -e ruff Backward Compatibility This change is backward compatible. It only adds instrumentation for additional AWS resources and does not modify existing behavior in the auto-instrumentation library. * add ChangeLog. * Update instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/secretsmanager.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> * Update instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_secretsmanager.py --------- Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * clean up context handler, clarify unit tests * Rename UploadHook -> CompletionHook (open-telemetry#3780) * Add opentelemetry-util-genai to the package release workflow (open-telemetry#3781) * Fix package release workflows version.py finding (open-telemetry#3782) Looking at the files in this repo, the version file is always called version.py (and it should be). Tested the find command locally. ```shell $ for f in $(git ls-files '*version*.py'); do basename $f; done | sort -u test_version.py version.py $ find util/opentelemetry-util-genai/ -type f -path "**/version.py" util/opentelemetry-util-genai/src/opentelemetry/util/genai/version.py ``` * Adjust opentelemetry-instrumentation-vertexai dependency on opentelemetry-genai-util (open-telemetry#3785) This fixes the CI failure on the release PRs for opentelemetry-util-genai - open-telemetry#3784 (needs cherry pick) - open-telemetry#3783 * Fix exception handling for JSON decoding (open-telemetry#3787) * Add rstcheck in pre-commit (open-telemetry#3777) * Fix a bunch of rstcheck warnings * Add rstcheck to pre-commit * Ignore automodule * Update changelog and contributing * tox -e ruff -> tox -e precommit But keep the old name for compat * remove generator concept * update token types * Update opentelemetry-util-genai version to v0.2b0 (open-telemetry#3783) Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com> --------- Co-authored-by: wrisa <ridhimasatam@gmail.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Luke (GuangHui) Zhang <lukezha@amazon.com> Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com> Co-authored-by: Charlie Jonas <chagonkas@gmail.com> Co-authored-by: otelbot[bot] <197425009+otelbot[bot]@users.noreply.github.com> Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
liustve
added a commit
to aws-observability/aws-otel-python-instrumentation
that referenced
this pull request
Feb 4, 2026
Automated update of OpenTelemetry dependencies. **Build Status:** ❌ [failure](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/21465140126) **Updated versions:** - [OpenTelemetry Python](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.39.1): 1.39.1 - [OpenTelemetry Contrib](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.60b1): 0.60b1 - [opentelemetry-sdk-extension-aws](https://pypi.org/project/opentelemetry-sdk-extension-aws/2.1.0/): 2.1.0 - [opentelemetry-propagator-aws-xray](https://pypi.org/project/opentelemetry-propagator-aws-xray/1.0.2/): 1.0.2 **Upstream releases with breaking changes:** Note: the mechanism to detect upstream breaking changes is not perfect. Be sure to check all new releases and understand if any additional changes need to be addressed. **opentelemetry-python:** - [Version 1.35.0/0.56b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.35.0) **opentelemetry-python-contrib:** - [Version 1.34.0/0.55b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.55b0) *Description of changes:* - Un-reverts changes done in this PR: #531 - Removed patches for Bedrock following the changes applied in these PRs: open-telemetry/opentelemetry-python-contrib#3544, open-telemetry/opentelemetry-python-contrib#3548, open-telemetry/opentelemetry-python-contrib#3875, open-telemetry/opentelemetry-python-contrib#3990 - Removes patches for Secrets Manager, SNS, and Step Functions following the changes applied in these PRs: open-telemetry/opentelemetry-python-contrib#3734, open-telemetry/opentelemetry-python-contrib#3737, open-telemetry/opentelemetry-python-contrib#3765, - Removes patches for Starlette following the changes applied in this PR: open-telemetry/opentelemetry-python-contrib#3456 - Changes imports and implementation of `OTLPAwsLogExporter`, `AwsCloudWatchOtlpBatchLogRecordProcessor`, and `CompactConsoleLogExporter` following these PRs: open-telemetry/opentelemetry-python#4580, open-telemetry/opentelemetry-python#4535, open-telemetry/opentelemetry-python#4562, open-telemetry/opentelemetry-python#4647, open-telemetry/opentelemetry-python#4676 - Removes a few AWS semantic conventions from `_aws_attribute_keys ` and replaces them with equivalent ones from upstream following the changes in this PR: open-telemetry/opentelemetry-python#4791 - Fix Lambda instrumentation test to set `AWS_LAMBDA_FUNCTION_NAME` env var following changes in: open-telemetry/opentelemetry-python-contrib#3183 - Adds a few more contract tests to verify upstream's botocore instrumentation library By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Thomas Pierce <thp@amazon.com> Co-authored-by: Steve Liu <liustve@amazon.com>
sightseeker
added a commit
to sightseeker/opentelemetry-python-contrib
that referenced
this pull request
Mar 11, 2026
…ribute (open-telemetry#3765) * botocore: Add support for AWS Secrets Manager semantic convention attribute AWS Secrets Manager defines semantic convention attribute: AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn" https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-secrets-manager-attributes Currently, this attribute is not set in the botocore instrumentation library. This PR adds support for them by extracting values from both Request and Response objects. Tests Added new unit tests (passing). Verified with: tox -e py312-test-instrumentation-botocore tox -e spellcheck tox -e lint-instrumentation-botocore tox -e ruff Backward Compatibility This change is backward compatible. It only adds instrumentation for additional AWS resources and does not modify existing behavior in the auto-instrumentation library. * add ChangeLog. * Update instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/secretsmanager.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> * Update instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_secretsmanager.py --------- Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS Secrets Manager defines semantic convention attribute:
AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn"
https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-secrets-manager-attributes
Currently, this attribute is not set in the botocore instrumentation library. This PR adds support for them by extracting values from both Request and Response objects.
Tests
Added new unit tests (passing).
Verified with:
tox -e py312-test-instrumentation-botocore
tox -e spellcheck
tox -e lint-instrumentation-botocore
tox -e ruff
Backward Compatibility
This change is backward compatible. It only adds instrumentation for additional AWS resources and does not modify existing behavior in the auto-instrumentation library.