Aller au contenu

Cette page n'est pas encore traduite. Elle s'affiche en anglais.

OpenTelemetry signals

Traces, metrics, logs, errors, and experimental guest CPU profiles in Elide: what Elide records for each, the settings that control it, and how your code adds its own.

Sur cette page
SignalElide recordsYour code addsSettings
TracesHTTP server and client spans, build and test spansSpans through the tracer APItraces, runtime.traces
MetricsHTTP, process, and error metricsCounters, histograms, gauges, observable instrumentsmetrics, runtime.metrics
LogsIts own warnings and errorsLogs API records, console.*, Python logginglogs, runtime.logs
ErrorsUncaught exceptions, rejections, failing handlers, crashesspan.recordException(…)follows logs, traces, and metrics
Profiles (experimental)Guest CPU samples—profiles

User settings (traces, metrics, logs) govern telemetry from your code; runtime settings govern Elide’s own. Turning a signal off with OTEL_TRACES_EXPORTER=none (or the metrics and logs equivalents) turns off both.

Traces

Spans start synchronously: the sampling decision and span context are available as soon as startSpan returns. Context follows await, timers, and callbacks in JavaScript, and contextvars in Python.

SettingEffectDefault
traces.enabledRecord spans from your code.on
traces.sampler, traces.ratioHead sampler for your spans.parentbased_always_on
runtime.tracesRecord Elide’s HTTP and toolchain spans.on

With parentbased_* samplers, a sampled caller’s traceparent keeps the request sampled, and your spans inside it follow. Turning traces.enabled off keeps your spans’ context flowing without recording them, so outgoing requests still continue the caller’s trace.

Recording never waits on export. When an export queue is full, spans are dropped and counted; read the counts with status() from elide:telemetry or elide.telemetry.

Metrics

SettingEffectDefault
metrics.enabledRecord instruments from your code.on
metrics.intervalCollect and export every interval.60.s
metrics.temporalitycumulative or delta.cumulative; delta for Datadog
runtime.metricsRecord Elide’s HTTP, process, and error metrics.on

Your code can create counters, up-down counters, histograms (with advice.explicitBucketBoundaries in JavaScript or explicit_bucket_boundaries_advisory in Python), gauges, and observable counters, up-down counters, and gauges. Observable callbacks run at each collection. Elide’s metric names are listed in Emitted telemetry.

Pending measurements are exported at exit, so a short script’s metrics are not lost.

Logs

SettingEffectDefault
logs.enabledExport records from your code.on
logs.levelMinimum severity exported.info
logs.consoleAlso export console.* and Python logging output.on
runtime.logsMinimum severity of Elide’s own records.warn

Capturing output does not change what the program prints. console.* output is exported in the console scope; Python logging records keep their logger’s name as the scope, and only records some handler would print are exported. Log API records keep structured bodies (objects, lists, bytes).

Errors

Errors are exported as OTLP records, so every destination receives them through whichever of traces, logs, and metrics it accepts:

Sourceelide.error.originSpan status
Uncaught exceptionuncaught—
Unhandled promise rejectionrejection—
Request handler throws or rejectshandlerserver span ERROR
span.recordException(error)guest_apiunchanged
Earlier process crashedcrash—

Each produces an exception log record, an exception span event, and an elide.errors increment; see Errors. elide.errors is a runtime metric and follows runtime.metrics.

Profiles

Guest CPU profiles are experimental and off by default. Elide samples the stacks of running JavaScript and Python code and exports OTLP profiles, with each sample linked to the span active on its thread.

opentelemetry {
  profiles { enabled = true; frequency = 99 }
}
ELIDE_OTEL_PROFILES=true elide serve app.ts   # 100 samples per second
ELIDE_OTEL_PROFILES=49 elide serve app.ts     # 49 samples per second
DetailValue
Destinationsotlp only; the receiver must accept the OTLP profiles signal
ExportEvery 30 seconds and at exit, to /v1development/profiles over HTTP
Frequency1 to 10,000 samples per second; default 100
CoverageJavaScript and Python code; not Elide’s own code
ConflictsOff while --profiler is in use

Shutdown

At exit Elide hands what is still pending to a background exporter, so the program exits without waiting on the network; --otel-shutdown=inline exports it from the exiting process instead, for up to shutdownTimeout (5 seconds by default). See At exit. flush() in JavaScript and Python exports on demand.

Samples

Cette page vous a-t-elle aidé ?