This release is a pre-release and may not be stable for production use.
OpenTelemetry Amazon Bedrock Instrumentation
This package provides OpenTelemetry instrumentation for Amazon Bedrock (via the AWS SDK for Python: boto3, botocore, aioboto3, and aiobotocore), implementing the OpenTelemetry Generative AI semantic conventions.
Supported Operations
Synchronous and asynchronous chat via the Converse API (client.converse)
Synchronous and asynchronous streaming chat via the ConverseStream API (client.converse_stream)
Synchronous and asynchronous model invocation via the InvokeModel API (client.invoke_model)
Synchronous and asynchronous streaming model invocation via the InvokeModelWithResponseStream API (client.invoke_model_with_response_stream)
Installation
pip install opentelemetry-instrumentation-genai-bedrock
Usage
import boto3
from opentelemetry.instrumentation.genai.bedrock import BedrockInstrumentor
# Enable instrumentation
BedrockInstrumentor().instrument()
# Use Bedrock runtime client normally
client = boto3.client("bedrock-runtime", region_name="us-east-1")
response = client.converse(
modelId="amazon.nova-micro-v1:0",
messages=[{"role": "user", "content": [{"text": "Hello, Bedrock!"}]}],
)
Configuration
By default, prompts and completions are not captured. To capture message content, set the environment variable OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT to one of NO_CONTENT, SPAN_ONLY, EVENT_ONLY, or SPAN_AND_EVENT:
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_ONLY
Prompts and completions can also be redirected via a completion hook by setting OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK or by passing instrument(completion_hook=...).
References
Release files for opentelemetry-instrumentation-genai-bedrock 1.2b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opentelemetry_instrumentation_genai_bedrock-1.2b0.tar.gz | 46.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_instrumentation_genai_bedrock-1.2b0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.6 kB
Release files / opentelemetry_instrumentation_genai_bedrock-1.2b0.tar.gz
| Download URL | opentelemetry_instrumentation_genai_bedrock-1.2b0.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
916cd1f033416aa3a076482e1f3b55f83654a51d1602fcb948c7e63b20bb67a6
|
|
BLAKE2b-256 checksum How to use checksums |
0e873ff8bbb7900fcfe03e9076d119fdfe23e62dd159863a3121b66825156fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / opentelemetry_instrumentation_genai_bedrock-1.2b0-py3-none-any.whl
| Download URL | opentelemetry_instrumentation_genai_bedrock-1.2b0-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26cc1be4acd376c1333b18d06cc7c5fb4f7ed4e71cb6a0c5e8b0aebc6d7a1798
|
|
BLAKE2b-256 checksum How to use checksums |
9623e5ab63864411d492e73ea5719f042d6db502979180e060fe809b10901ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log