Respan instrumentation plugin for AWS Bedrock Runtime
Project description
respan-instrumentation-aws-bedrock
Respan instrumentation plugin for AWS Bedrock Runtime calls made through
boto3.
Installation
pip install respan-ai respan-instrumentation-aws-bedrock boto3
Usage
import json
import boto3
from respan import Respan
from respan_instrumentation_aws_bedrock import AWSBedrockInstrumentor
respan = Respan(instrumentations=[AWSBedrockInstrumentor()])
client = boto3.client("bedrock-runtime", region_name="us-east-1")
response = client.invoke_model(
modelId="anthropic.claude-3-5-haiku-20241022-v1:0",
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Say hello."}],
}),
contentType="application/json",
accept="application/json",
)
body = json.loads(response["body"].read())
print(body["content"][0]["text"])
respan.flush()
The instrumentor patches botocore.client.BaseClient._make_api_call and only
emits spans for Bedrock Runtime operations. It currently normalizes
InvokeModel, InvokeModelWithResponseStream, Converse, and
ConverseStream into canonical Respan chat spans.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_aws_bedrock-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_aws_bedrock-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec0518017105e098b36d1d0d6bc5655599ce3fbb44a5b873eb3bc99696b45f19
|
|
| MD5 |
dc0c97dd98335d4bcfc063a928e2b824
|
|
| BLAKE2b-256 |
81c053236d6789f26f35f87b61c682f11c2b31b7965062319ed8a447fd23efde
|
File details
Details for the file respan_instrumentation_aws_bedrock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_aws_bedrock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c93c2d2e658baadc8f79c27c072ba47705f78fb99134e18dd7a117529f5c5d
|
|
| MD5 |
7a137103425ff0346008c6138b7aa1d8
|
|
| BLAKE2b-256 |
67a16fc0b0cf75015f4d679d44c0b50fd625bc0866a2090917430926dffe6372
|