Respan instrumentation plugin for AWS SageMaker Runtime
Project description
respan-instrumentation-sagemaker
Respan instrumentation plugin for AWS SageMaker Runtime calls made through
boto3.
Installation
pip install respan-ai respan-instrumentation-sagemaker boto3
Usage
import json
import boto3
from respan import Respan
from respan_instrumentation_sagemaker import SageMakerInstrumentor
respan = Respan(instrumentations=[SageMakerInstrumentor()])
client = boto3.client("sagemaker-runtime", region_name="us-east-1")
response = client.invoke_endpoint(
EndpointName="my-llm-endpoint",
Body=json.dumps({"inputs": "Reply with one short sentence."}).encode("utf-8"),
ContentType="application/json",
Accept="application/json",
)
body = json.loads(response["Body"].read())
print(body[0]["generated_text"])
respan.flush()
The instrumentor patches botocore.client.BaseClient._make_api_call and only
emits spans for SageMaker Runtime operations. It currently normalizes
InvokeEndpoint, InvokeEndpointWithResponseStream, and InvokeEndpointAsync
into canonical Respan LLM 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_sagemaker-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_sagemaker-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d946be1482d5c0d59acdefd33caeb8d26a0f22201c9f63981242803b3fd7e0b4
|
|
| MD5 |
c3f901cfc929c09d1047dd4491804927
|
|
| BLAKE2b-256 |
3c0abf2fda36ac48450c11e32f617e1030233538ee4ee395089e03dfae5e8fb5
|
File details
Details for the file respan_instrumentation_sagemaker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_sagemaker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fb19c221e4a760c5db9057abc69fc4c6b3516e3be68f841e73e930a25ceba56
|
|
| MD5 |
4c09b9046d4dddf293c69c5991308a1a
|
|
| BLAKE2b-256 |
d49348a33596aa6e8376d176e1822291416a829ccc1a6cd92de3a0123573353c
|