@opencensus/core
Version:
OpenCensus is a toolkit for collecting application performance and behavior data.
43 lines (42 loc) • 1.79 kB
TypeScript
/**
* Copyright 2019, OpenCensus Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TagKey, TagMetadata, TagValue, TagValueWithMetadata } from './types';
/** TagMap is maps of TagKey -> TagValueWithMetadata */
export declare class TagMap {
private readonly registeredTags;
/**
* Adds the key/value pair regardless of whether the key is present.
* @param tagKey The TagKey which will be set.
* @param tagValue The TagValue to set for the given key.
* @param tagMetadata The TagMetadata associated with this Tag.
*/
set(tagKey: TagKey, tagValue: TagValue, tagMetadata?: TagMetadata): void;
/**
* Deletes a tag from the map if the key is in the map.
* @param tagKey The TagKey which will be removed.
*/
delete(tagKey: TagKey): void;
/** Gets the tags map without metadata. */
get tags(): Map<TagKey, TagValue>;
/** Gets the tags map with metadata. */
get tagsWithMetadata(): Map<TagKey, TagValueWithMetadata>;
/**
* Constructs a new TagValueWithMetadata using tagValue and tagMetadata.
* For backwards-compatibility this method still produces propagating Tags
* (UNLIMITED_PROPAGATION) if tagMetadata is not provided or missing.
*/
private getValueWithMetadata;
}