Actors/Packages/OpenTelemetry/API reference
@sigx/actors-otel · Preview

API reference#

Exports of @sigx/actors-otel v0.1.0.

@sigx/actors-otel/prometheus#

Imports no OpenTelemetry.

prometheusOps(options?)#

An ActorPlugin mounting the scrape endpoint.

TypeScript
interface PrometheusOpsOptions extends RenderPrometheusOptions {
    path?: string;              // '/_sigx/metrics'
    secret?: string;            // mandatory outside dev
}
interface RenderPrometheusOptions {
    prefix?: string;            // 'sigx_actors_'
    bucketsSeconds?: number[];  // per-octave grid, 1µs → ~134s
}

renderPrometheus(digest, stats, options)#

The pure function underneath — no plugin, no route. Use it to serve the exposition yourself.

@sigx/actors-otel#

otelTraces(options?)#

TypeScript
interface OtelTracesOptions {
    tracerProvider?: TracerProvider;
    turnSpans?: boolean;   // true
}

One CLIENT span per dispatch, one SERVER span per turn. Cross-host joins ride the runtime's W3C traceparent.

otelMetricsBridge(options?)#

TypeScript
interface OtelMetricsBridgeOptions {
    meterProvider?: MeterProvider;
    percentileGauges?: boolean;   // true
}

traceparent helpers#

formatTraceparent(fields), parseTraceparent(header), and the TraceparentFields type.

Core plumbing this rides on#

Exported from @sigx/actors and @sigx/actors/host rather than here, but relevant:

  • ActorCallContext.traceparent
  • the trailing call parameter on ActorTurnObserver
  • bucketUpperBoundsUs() and timingSafeEquals from @sigx/actors/host

Labels#

type and method only. Never actor keys — enforced, because keys are unbounded and one high-cardinality label is enough to take a Prometheus down.

Next steps#