Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 530a6e7

Browse files
authored
Merge pull request #1691 from grafana/fakemetrics_carbon_tags_support
Tags support for Carbon output
2 parents 2fae12a + 8db6fb3 commit 530a6e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/mt-fakemetrics/out/carbon/carbon.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ func (n *Carbon) Flush(metrics []*schema.MetricData) error {
6262
preFlush := time.Now()
6363
buf := bytes.NewBufferString("")
6464
for _, m := range metrics {
65-
buf.WriteString(fmt.Sprintf("%s %f %d\n", m.Name, m.Value, m.Time))
65+
tagsString := ""
66+
for _, tag := range m.Tags {
67+
tagsString += fmt.Sprintf(";%s", tag)
68+
}
69+
buf.WriteString(fmt.Sprintf("%s%s %f %d\n", m.Name, tagsString, m.Value, m.Time))
6670
}
6771
prePub := time.Now()
6872
_, err := n.conn.Write(buf.Bytes())

0 commit comments

Comments
 (0)