Please take the OpenCensus user survey



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 (

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")).
#include "opencensus/tags/tag_key.h"

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


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