Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Amazon Bedrock

cetra can trace Amazon Bedrock calls from Python through the OpenInference Bedrock instrumentation.

Terminal window
pip install "cetra-sdk[bedrock]" boto3
import boto3
import cetra
cetra.init(instrument=["bedrock"])
client = boto3.client("bedrock-runtime")
client.converse(
modelId="anthropic.claude-3-5-sonnet-20240620-v1:0",
messages=[{"role": "user", "content": [{"text": "What is the weather in Paris?"}]}],
)
cetra.flush()

cetra reads the spans of the OpenInference Bedrock instrumentation with the OpenInference convention. See Semantic conventions.

  • No captured spans of this instrumentation are in the repository. The only check is an SDK test that imports the instrumentor when the extra is installed. This page does not say which Bedrock operations are traced or which fields they fill.
  • If a field is missing, look at the span’s Attributes tab and compare it with Span attributes.