OpenTelemetry-native tracing SDK for Eldros AI agents
Project description
eldros-sdk
OpenTelemetry-native tracing SDK for Eldros AI agents. One init() call
resolves your trace config from the Eldros platform, wires up
OpenTelemetry, and auto-instruments your LLM provider clients. Drop a @trace
decorator on your handler and you get a root span per call.
You need exactly one thing: an Eldros API key (agt_...). The SDK
resolves trace config from the Eldros platform at startup — you never
configure the trace backend directly.
Install
pip install eldros-sdk # core
pip install "eldros-sdk[claude-agent-sdk]" # + Claude Agent SDK instrumentation via LangSmith
pip install "eldros-sdk[openai]" # + OpenAI auto-instrumentation
pip install "eldros-sdk[anthropic]" # + Anthropic auto-instrumentation
pip install "eldros-sdk[all]" # everything
Quick start
export ELDROS_API_KEY=agt_...
from eldros_sdk import init, trace
init() # api_key is read from ELDROS_API_KEY
@trace
async def handle_conversation(user_message: str) -> str:
# OpenAI / Anthropic calls in here are auto-instrumented as child spans.
...
init() blocks briefly at startup to call the Eldros platform and fetch your
trace config — call it before starting your event loop (e.g. at module
import time or in your if __name__ == "__main__" block).
Configuration
Every argument can come from an environment variable. Explicit init(...) kwargs
win over env vars.
init() arg |
Env var | Default |
|---|---|---|
api_key |
ELDROS_API_KEY |
— (required) |
api_base_url |
ELDROS_API_BASE_URL |
— (required until official domain is live) |
traffic_type / env |
ELDROS_TRAFFIC_TYPE |
prod |
instrument_claude_agent_sdk |
ELDROS_INSTRUMENT_CLAUDE_AGENT_SDK |
auto-detected (True if claude_agent_sdk installed) |
instrument_openai |
ELDROS_INSTRUMENT_OPENAI |
auto-detected (True if [openai] extra installed) |
instrument_anthropic |
ELDROS_INSTRUMENT_ANTHROPIC |
auto-detected (True if [anthropic] extra installed) |
capture_content |
ELDROS_CAPTURE_CONTENT |
true |
debug |
ELDROS_TRACE_DEBUG |
false |
enabled |
ELDROS_TRACE_ENABLED |
true |
enabled=Falsemakes the whole SDK a no-op — safe to leave in any environment.debug=True(orELDROS_TRACE_DEBUG=true) also prints spans to the console.capture_content=Falsestrips prompt/response text from OpenAI and Anthropic spans. Note: for Claude Agent SDK, LangSmith always captures content regardless of this setting.
Decorator options
@trace(name="checkout", capture_io=True, attributes={"tier": "pro"})
def run(payload: dict) -> dict:
...
@trace supports sync functions, coroutines, sync generators, and async
generators (the span stays open across the whole generation).
Claude Agent SDK instrumentation
Install the [claude-agent-sdk] extra — instrumentation is automatic:
pip install "eldros-sdk[claude-agent-sdk]"
import eldros_sdk
eldros_sdk.init() # auto-detects claude-agent-sdk and instruments it
init() is the single entry point. LangSmith patches ClaudeSDKClient and routes
spans through the global TracerProvider — alongside @trace and LLM spans.
Requires ClaudeSDKClient (not the module-level query()).
To opt out: init(instrument_claude_agent_sdk=False).
If LANGSMITH_API_KEY is also set, traces go to both your LangSmith account and
Eldros's trace backend simultaneously (hybrid mode).
Lifecycle
from eldros_sdk import flush, shutdown
flush() # force-export buffered spans (e.g. end of a serverless invocation)
shutdown() # flush + tear down the provider
Testing the SDK
# Verify credential resolution
ELDROS_API_KEY=agt_... python3 -c "
import eldros_sdk
cfg = eldros_sdk.init()
print('has_trace_config:', cfg.has_trace_config)
"
# Verify a span reaches your trace backend
ELDROS_API_KEY=agt_... python3 -c "
import eldros_sdk
eldros_sdk.init(debug=True)
@eldros_sdk.trace
def hello():
return 'world'
hello()
eldros_sdk.flush()
print('done — check your trace backend')
"
Design notes
- Credential resolution. On
init(), the SDK callsGET {api_base_url}/resolvewith yourELDROS_API_KEYin theX-Client-API-Keyheader and receives{endpoint, headers, project, backend}. The SDK applies these blindly to the OTLP exporter — no backend-specific logic. - OTLP/HTTP. No vendor SDK dependency — spans are exported as OTel protobuf over HTTP.
- Additive OTel. If a
TracerProvideralready exists (Datadog, etc.) the SDK attaches its exporter to it instead of replacing it — spans flow to both destinations. Callinit()before any other tracing setup so the SDK's provider is detected first. - Claude Agent SDK spans use the global provider. LangSmith detects the global
TracerProviderset byinit()and routes all Claude Agent SDK OTel spans through it. This means anySpanProcessoryou add to the global provider also receives those spans — you can route to your own trace backend or any OTel backend alongside ours. - Auto-instrumentation is optional. Provider instrumentors are extras; if a provider library isn't installed the SDK logs and continues.
- Safe by default. Spans are non-recording until
init()runs, so@tracenever breaks code even ifinit()is missing.
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 eldros_sdk-0.1.5.tar.gz.
File metadata
- Download URL: eldros_sdk-0.1.5.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d94ef3b8fceebbb46c9d57217d0724517e19f56927606163b89d8db727dfd932
|
|
| MD5 |
6d5007dcf736723f1b639c57cd8464a8
|
|
| BLAKE2b-256 |
4f0c75deb37a6fe175f8372ff43f928d9d9847e18475203e6d91f8a306915cd6
|
Provenance
The following attestation bundles were made for eldros_sdk-0.1.5.tar.gz:
Publisher:
publish.yml on sentient-xyz/eldros-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eldros_sdk-0.1.5.tar.gz -
Subject digest:
d94ef3b8fceebbb46c9d57217d0724517e19f56927606163b89d8db727dfd932 - Sigstore transparency entry: 1954867968
- Sigstore integration time:
-
Permalink:
sentient-xyz/eldros-sdk@816d964198563e53f73b852542f951268f705039 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/sentient-xyz
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@816d964198563e53f73b852542f951268f705039 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eldros_sdk-0.1.5-py3-none-any.whl.
File metadata
- Download URL: eldros_sdk-0.1.5-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
546f0e25ac149d8925b318e9f189442d196286fe7a745ba59660bf0d7258bd9f
|
|
| MD5 |
3e86460ea7bbc34e77e992526cd42be7
|
|
| BLAKE2b-256 |
0209362b3740f602ee9a0d6d3d987efb2af117040a76145795ea58b7cef3646b
|
Provenance
The following attestation bundles were made for eldros_sdk-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on sentient-xyz/eldros-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eldros_sdk-0.1.5-py3-none-any.whl -
Subject digest:
546f0e25ac149d8925b318e9f189442d196286fe7a745ba59660bf0d7258bd9f - Sigstore transparency entry: 1954868279
- Sigstore integration time:
-
Permalink:
sentient-xyz/eldros-sdk@816d964198563e53f73b852542f951268f705039 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/sentient-xyz
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@816d964198563e53f73b852542f951268f705039 -
Trigger Event:
push
-
Statement type: