Setup Flow
Follow this path to install@asymptote/sdk, initialize tracing, create a first span, and flush it before the process exits.
1. Install
Install the SDK
2. Configure Export
Choose Asymptote Managed hosted Observe or a customer-managed OTLP endpoint.Hosted Observe
Hosted Observe requires an Asymptote Managed account. To get anASYMPTOTE_API_KEY, reach out for a demo, then initialize Observe as early as possible in your application startup:
Set the Asymptote Managed API key
Hosted Observe initialization
| Setting | Value |
|---|---|
| Default base URL | https://api.asymptotelabs.ai |
| Observe path | /v1/observe |
| API key env var | ASYMPTOTE_API_KEY |
| Base URL env var | ASYMPTOTE_BASE_URL |
| Auth header | authorization: Bearer <api key> |
/v1/observe when the configured base URL or endpoint does not already include it.
Customer-Managed OTLP
Use an explicit OTLP endpoint when traces should go to a local or customer-managed collector instead of Asymptote Managed hosted Observe:Set the OTLP endpoint
Customer-managed OTLP initialization
3. Create A First Trace
Wrap application code withObserve.observe() to create a Beacon-compatible span.
Create a traced function
Export Precedence
Observe.initialize() resolves export configuration in this order:
| Priority | Source |
|---|---|
| 1 | initialize({ otlpEndpoint }) |
| 2 | OTEL_EXPORTER_OTLP_ENDPOINT |
| 3 | Asymptote Managed hosted baseUrl when apiKey or ASYMPTOTE_API_KEY is present |
Initialize with a custom exporter
What To Read Next
Instrumentation
Configure SDK initialization, module patching, and existing OpenTelemetry providers.
Observe
Wrap custom agent functions and control span metadata.
SDK Lifecycle
Decide when to flush or shut down tracing.
Agent SDK Integrations
Add supported Anthropic, Claude Agent SDK, OpenAI, or Vercel AI SDK instrumentation.
Flush Before Exit
For short-lived scripts, CI jobs, and serverless handlers, flush spans before the process exits:Flush spans before exit
Shut down tracing on exit

