Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
129213: cli: update cluster tag in tsdump upload r=aa-joshi a=aa-joshi

Previously, we are uploading tsdump data to datadog with cluster name with tag "cluster". However, it would coincide with metrics emitted with "cluster" as tag. This was resulting in a large drop down list to filter out cluster in datadog dashboard. This change updates tag from "cluster" to "cluster_label" with tsdump datadog upload. This would result in smaller cluster list in datadog dashboard.

Epic: None
Release note: None

Co-authored-by: Akshay Joshi <[email protected]>
  • Loading branch information
craig[bot] and aa-joshi committed Aug 19, 2024
2 parents 1993fc0 + 215754e commit 33e2197
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cli/testdata/tsdump/json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ cr.node.admission.admitted.elastic.cpu 2 1.000000 1711130560
----
POST: https://example.com/data
DD-API-KEY: api-key
Body: {"series":[{"metric":"crdb.tsdump.admission.admitted.elastic.cpu","type":0,"points":[{"timestamp":17111304,"value":0},{"timestamp":17111304,"value":1},{"timestamp":17111304,"value":1},{"timestamp":17111305,"value":1}],"resources":null,"tags":["cluster_type:SELF_HOSTED","job:cockroachdb","region:local","cluster:test-cluster","upload_id:test-cluster-1234","node_id:1"]},{"metric":"crdb.tsdump.admission.admitted.elastic.cpu","type":0,"points":[{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1}],"resources":null,"tags":["cluster_type:SELF_HOSTED","job:cockroachdb","region:local","cluster:test-cluster","upload_id:test-cluster-1234","node_id:2"]}]}
Body: {"series":[{"metric":"crdb.tsdump.admission.admitted.elastic.cpu","type":0,"points":[{"timestamp":17111304,"value":0},{"timestamp":17111304,"value":1},{"timestamp":17111304,"value":1},{"timestamp":17111305,"value":1}],"resources":null,"tags":["cluster_type:SELF_HOSTED","job:cockroachdb","region:local","cluster_label:test-cluster","upload_id:test-cluster-1234","node_id:1"]},{"metric":"crdb.tsdump.admission.admitted.elastic.cpu","type":0,"points":[{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1},{"timestamp":17111305,"value":1}],"resources":null,"tags":["cluster_type:SELF_HOSTED","job:cockroachdb","region:local","cluster_label:test-cluster","upload_id:test-cluster-1234","node_id:2"]}]}
2 changes: 1 addition & 1 deletion pkg/cli/tsdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (d *datadogWriter) Emit(data *tspb.TimeSeriesData) error {
tags = append(tags, "region:local")

if debugTimeSeriesDumpOpts.clusterLabel != "" {
tags = append(tags, makeDDTag("cluster", debugTimeSeriesDumpOpts.clusterLabel))
tags = append(tags, makeDDTag("cluster_label", debugTimeSeriesDumpOpts.clusterLabel))
}

tags = append(tags, makeDDTag(uploadIDTag, d.uploadID))
Expand Down

0 comments on commit 33e2197

Please sign in to comment.