class NoopTelemetryService
implements ITelemetryService
Since 0.2.0

A telemetry service that does nothing — used when no exporter is configured.

withSpan still runs the callback and returns its value, but all span operations are no-ops.

Methods

withSpan<T>(
_name: string,
fn: (span: ISpan) => Promise<T>,
_options?: SpanOptions
): Promise<T>

Creates a span, runs the callback, and ends the span.

The span is guaranteed to be ended exactly once, even if the callback throws. The callback receives an ISpan that it can attach attributes to.

Usage

import { NoopTelemetryService } from "telemetry-plugin/src/index.ts";