Elide is an OpenTelemetry SDK. JavaScript, TypeScript, and Python code uses the standard OpenTelemetry API for its
language, and Elide supplies the implementation and the OTLP exporter. Elide’s own spans and metrics for served
requests, fetch, errors, the process, and builds and tests join the same traces.
No SDK, exporter, or agent
Import the standard API and configure a destination; there is nothing else to install.
Off until configured
With no destination configured, Elide starts no telemetry threads and opens no connections.
Quick start
Start an OpenTelemetry Collector that prints what it receives:
docker run --rm -p 4317:4317 -p 4318:4318 otel/opentelemetry-collector:0.115.1Write a script that creates a span:
// app.ts
import { trace } from "@opentelemetry/api";
const tracer = trace.getTracer("checkout");
await tracer.startActiveSpan("charge", async (span) => {
span.setAttribute("order.id", 42);
console.log("charged order 42");
span.end();
});Run it with the collector as its endpoint:
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 OTEL_SERVICE_NAME=checkout elide run app.tsThe collector prints the span, and the console.log line as a log record carrying the span’s ids (excerpt):
Resource attributes:
-> telemetry.sdk.name: Str(elide)
-> service.name: Str(checkout)
InstrumentationScope checkout
Span #0
Trace ID : 5162303c77b9dab62b1d536ce955c103
ID : 410c19dcae7eda3c
Name : charge
Kind : Internal
Attributes:
-> order.id: Int(42)
InstrumentationScope console
LogRecord #0
SeverityText: INFO
Body: Str(charged order 42)
Trace ID: 5162303c77b9dab62b1d536ce955c103
Span ID: 410c19dcae7eda3cElide exports pending data before it exits, so short scripts need no flush call.
@opentelemetry/api needs no install: Elide provides it when the project has no copy.
Configure a project
In a project, put the settings in elide.pkl. Credentials stay in environment variables, named by the manifest:
amends "elide:project.pkl"
name = "checkout"
opentelemetry {
service { name = "checkout"; version = "1.4.2"; environment = "production" }
destinations {
["collector"] { endpoint = "http://localhost:4318" }
["honeycomb"] { provider = "honeycomb" }
}
}Variables override the block and --otel-* flags override both; see Configuration.
Turn it off
elide run --no-otel app.ts # one run
OTEL_SDK_DISABLED=true elide serve # one processLanguages
| Language | API | Elide records |
|---|---|---|
| JavaScript and TypeScript | @opentelemetry/api, @opentelemetry/api-logs, elide:telemetry | Server spans, fetch client spans, console.* logs, errors |
| Python | opentelemetry, logging, elide.telemetry | logging records, errors |
| Java and Kotlin | None | Nothing |
Java and Kotlin programs that Elide runs get no OpenTelemetry API, agent, or trace context from Elide. Use the
OpenTelemetry Java SDK or agent in the program as you would on any JVM. elide build and elide test still record
their own spans for JVM projects; see Builds and tests in CI.
In this section
| Page | Covers |
|---|---|
| Configuration | elide.pkl, environment variables, flags, precedence |
| Providers | OTLP, Sentry, Datadog, PostHog, Honeycomb, Grafana Cloud |
| Signals | Traces, metrics, logs, errors, profiles |
| Runtime instrumentation | Serving, fetch, process metrics, CI spans |
| Correlation and baggage | Linked signals, traceparent, W3C baggage |
| JavaScript and TypeScript | API, SDK takeover, elide:telemetry |
| Python | API, logging, elide.telemetry |
| Emitted telemetry | Every span, metric, and attribute Elide emits |
| Troubleshooting | Nothing arrives, rejected data, status counters |