Skip to main content

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.

Metadata

Release files for respan-instrumentation-sagemaker 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-sagemaker 0.1.1
File Size Uploaded
respan_instrumentation_sagemaker-0.1.1.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-sagemaker 0.1.1
File Interpreter ABI Platform
respan_instrumentation_sagemaker-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / respan_instrumentation_sagemaker-0.1.1.tar.gz

Download URL respan_instrumentation_sagemaker-0.1.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8837d319a47f1617aa7080c1d90e603b137e7d3aa36c7c4bbb9b283d4a75967a
BLAKE2b-256 checksum
How to use checksums
938a6f6762f9118ec327aa4727a7fe727cd925ab9b3242b9a709bfb89cf4d5ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_sagemaker-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_sagemaker-0.1.1-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e4f69484bdf604694a4b04c2466012fcf10a0e830f56e856aaa7e78af9b0cf1
BLAKE2b-256 checksum
How to use checksums
feca08c60f0859aff7acf26808b9b7bc511dff609fc7fc5fd751e0f951688cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page