Install and initialize
- JavaScript
- Python
http:// or https:// is treated as gRPC by the Python SDK.
Environment configuration
Prefer
apiKey / api_key over constructing an Authorization header yourself. When custom headers are required, send the collector key as Authorization: Bearer <key>.
JavaScript tracing
Use function wrappers for explicit trace hierarchy:ESM and Next.js
Require-based automatic instrumentation cannot see normal ESM imports. Pass imported provider modules explicitly:instrumentModules supports the providers exposed by the installed SDK, including OpenAI, Anthropic, Cohere, Bedrock, Google Vertex AI, Pinecone, Together, LangChain, LlamaIndex, ChromaDB, Qdrant, and MCP.
Python tracing
Decorators support synchronous and asynchronous functions:Configuration reference
Both SDKs can export through custom OpenTelemetry exporters and processors. JavaScript additionally exposes conversation tracking, association properties, explicit provider modules, batching controls, and custom model pricing. Python additionally accepts samplers, resource attributes, instrument allow/block sets, and span post-processing.
Custom exporter
If your organization already operates an OpenTelemetry pipeline, pass its exporter instead of the Anyway collector exporter. Authentication and delivery then follow that exporter and collector configuration; Dashboard only receives spans that ultimately reach Anyway’s collector.Data safety
- Keep the Agent Traces API key in environment or secret storage.
- Decide whether prompt and completion content may be captured before production.
- Never record payment credentials, Agent Wallet Keys, identity documents, or payout details.
- Use stable pseudonymous IDs in association properties instead of customer email or legal identity.
- Apply redaction before values enter SDK attributes or model/tool spans.