UNPKG

1.92 kBTypeScriptView Raw
1/**
2 * Copyright 2018, OpenCensus Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { Span } from './span';
17import * as types from './types';
18/** Defines a root span */
19export declare class RootSpan extends Span {
20 /** Its trace ID. */
21 private traceIdLocal;
22 /** Its trace state. */
23 private traceStateLocal?;
24 /**
25 * This span's parent Id. This is a string and not a Span because the
26 * parent was likely started on another machine.
27 */
28 private parentSpanIdLocal;
29 /** A tracer object */
30 readonly tracer: types.TracerBase;
31 /**
32 * Constructs a new RootSpanImpl instance.
33 * @param tracer A tracer object.
34 * @param name The displayed name for the new span.
35 * @param kind The kind of new span.
36 * @param traceId The trace Id.
37 * @param parentSpanId The id of the parent span, or empty if the new span is
38 * a root span.
39 * @param traceState An optional traceState.
40 */
41 constructor(tracer: types.TracerBase, name: string, kind: types.SpanKind, traceId: string, parentSpanId: string, traceState?: types.TraceState);
42 /** Returns whether a span is root or not. */
43 isRootSpan(): boolean;
44 /** Gets trace id from rootspan instance. */
45 get traceId(): string;
46 /** Gets trace state from rootspan instance */
47 get traceState(): types.TraceState | undefined;
48 get parentSpanId(): string;
49}