UNPKG

2.1 kBTypeScriptView Raw
1import * as api from '@opentelemetry/api';
2import { InstrumentationLibrary } from '@opentelemetry/core';
3import { Resource } from '@opentelemetry/resources';
4import { ReadableSpan } from './export/ReadableSpan';
5import { TimedEvent } from './TimedEvent';
6import { Tracer } from './Tracer';
7import { SpanAttributeValue, Context } from '@opentelemetry/api';
8/**
9 * This class represents a span.
10 */
11export declare class Span implements api.Span, ReadableSpan {
12 private readonly _spanContext;
13 readonly kind: api.SpanKind;
14 readonly parentSpanId?: string;
15 readonly attributes: api.SpanAttributes;
16 readonly links: api.Link[];
17 readonly events: TimedEvent[];
18 readonly startTime: api.HrTime;
19 readonly resource: Resource;
20 readonly instrumentationLibrary: InstrumentationLibrary;
21 name: string;
22 status: api.SpanStatus;
23 endTime: api.HrTime;
24 private _ended;
25 private _duration;
26 private readonly _spanProcessor;
27 private readonly _spanLimits;
28 /** Constructs a new Span instance. */
29 constructor(parentTracer: Tracer, context: Context, spanName: string, spanContext: api.SpanContext, kind: api.SpanKind, parentSpanId?: string, links?: api.Link[], startTime?: api.TimeInput);
30 spanContext(): api.SpanContext;
31 setAttribute(key: string, value?: SpanAttributeValue): this;
32 setAttributes(attributes: api.SpanAttributes): this;
33 /**
34 *
35 * @param name Span Name
36 * @param [attributesOrStartTime] Span attributes or start time
37 * if type is {@type TimeInput} and 3rd param is undefined
38 * @param [startTime] Specified start time for the event
39 */
40 addEvent(name: string, attributesOrStartTime?: api.SpanAttributes | api.TimeInput, startTime?: api.TimeInput): this;
41 setStatus(status: api.SpanStatus): this;
42 updateName(name: string): this;
43 end(endTime?: api.TimeInput): void;
44 isRecording(): boolean;
45 recordException(exception: api.Exception, time?: api.TimeInput): void;
46 get duration(): api.HrTime;
47 get ended(): boolean;
48 private _isSpanEnded;
49}
50//# sourceMappingURL=Span.d.ts.map
\No newline at end of file