UNPKG

@dash0/sdk-web

Version:

Dash0's Web SDK to collect telemetry from end-users' web browsers

11 lines (10 loc) 791 B
import { KeyValue, Span, SpanStatus } from "../../types/otlp"; export type InProgressSpan = Omit<Span, "endTimeUnixNano">; export declare function startSpan(name: string): InProgressSpan; export declare function endSpan(span: InProgressSpan, status: SpanStatus | undefined, durationNano: number | undefined): Span; /** * Adds an event to a span. Can optionally accept the events timestamp and attributes for the event. * The timestamp needs to be specified as nanoseconds since unix epoch in string format. */ export declare function addSpanEvent(span: InProgressSpan, name: string, attributesOrTs?: string | KeyValue[] | undefined, attributes?: KeyValue[] | undefined): void; export declare function setSpanStatus(span: InProgressSpan, code: SpanStatus["code"], message?: string): void;