UNPKG

2.04 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 */
16/** TagKey represents a tag key */
17export interface TagKey {
18 /** The name of the key. */
19 readonly name: string;
20}
21/** TagValue represents a tag value */
22export interface TagValue {
23 /** The value of a tag. */
24 readonly value: string;
25}
26/** TagValueWithMetadata holds a TagValue and a TagMetadata. */
27export interface TagValueWithMetadata {
28 /** The tag value */
29 readonly tagValue: TagValue;
30 /** The metadata for the tag */
31 readonly tagMetadata: TagMetadata;
32}
33/**
34 * TagMetadata contains properties associated with a Tag.
35 * Anytime a sender serializes a tag, sends it over the wire and receiver
36 * deserializes the tag then the tag is considered to have travelled one hop.
37 * There could be one or more proxy(ies) between sender and receiver. Proxies
38 * are treated as transparent entities and they do not create additional hops.
39 */
40export interface TagMetadata {
41 /**
42 * For now, only special values of TagTtl are supported. In future,
43 * additional properties may be added to address specific situations.
44 */
45 readonly tagTtl: number;
46}
47/** TagTtl is an integer that represents number of hops a tag can propagate */
48export declare enum TagTtl {
49 /**
50 * NO_PROPAGATION is considered to have local scope and is used within the
51 * process it created.
52 */
53 NO_PROPAGATION = 0,
54 /** UNLIMITED_PROPAGATION can propagate unlimited hops. */
55 UNLIMITED_PROPAGATION = -1
56}