import ( "bosun.org/opentsdb" ) // creating tag set tags := opentsdb.TagSet{"host": "webserver1", "env": "prod"} // adding/replacing tag to tag set tags["service"] = "web" // get sorted list of tags tagList := tags.SortedTags() // write metric with tag set to opentsdb metric := opentsdb.NewMetric("cpu.utilization", tags, 50.0) opentsdb.Send(metric, nil)In the above example, we created a tag set with key value pair of "host" and "env". We then added/replaced a tag "service" to the tag set. We retrieved a list of sorted tags and used the tag set to create a metric and write it to OpenTSDB.