UNPKG

2.26 kBTypeScriptView Raw
1/**
2 * Copyright 2019, 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 * as types from '../types';
17import { NoRecordSpan } from './no-record-span';
18/** Implementation for the Span class that does not record trace events. */
19export declare class NoRecordRootSpan extends NoRecordSpan {
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 NoRecordRootSpanImpl 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 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 /** No-op implementation of this method. */
45 get traceId(): string;
46 /** Gets the ID of the parent span. */
47 get parentSpanId(): string;
48 /** No-op implementation of this method. */
49 get traceState(): types.TraceState | undefined;
50 /** No-op implementation of this method. */
51 get numberOfChildren(): number;
52 /** No-op implementation of this method. */
53 start(): void;
54 /** No-op implementation of this method. */
55 end(): void;
56}