Please take the OpenCensus user survey

TagMap/TagContext

TagMap

To record specific tags against measurements, they need to be isolated and inserted into a collection. This is collection of tags is called a “TagMap”

Source code example

package main

import (
	"go.opencensus.io/stats"
	"go.opencensus.io/tag"
)

func doWork() {
	// The TagMap is inserted into this context
	ctx, _ := tag.New(ctx,
		tag.Upsert(tagKey, "gomemcache.Client.Get"),
		tag.Upsert(tagKeyRegion, "asia-x1"))
import opencensus.tags import tag_map
import opencensus.tags import tag_value

# Values are inserted 
tag_map.TagMap().insert(keyMethod, tag_value.TagValue("memcache.Client.Get"))
import io.opencensus.tags.TagContext;
import io.opencensus.tags.Tagger;

Tagger TAGGER = Tags.getTagger();
TagContext tagCtx = TAGGER.currentBuilder().
                put(keyMethod, TagValue.create("memcache.Client.Get")).
                .build();
#include "opencensus/tags/tag_key.h"

static const opencensus::tags::TagKey key_method =
                    opencensus::tags::TagKey::Register("method");
const keyMethod = "method";

References

Resource URL
Specs reference specs.TagContext
Go reference tag.New
Java reference TagContext