Skip to content

Commit

Permalink
Add vizier version to vizier metrics.
Browse files Browse the repository at this point in the history
Summary: Adds the deployed vizier version to all vizier metrics sent to cloud. This will help compare metrics from one version to the next.

Test Plan: Saw that metrics sent to big query had the new vizier_version attached.

Reviewers: nserrino, vihang

Reviewed By: vihang

Signed-off-by: James Bartlett <jamesbartlett@pixielabs.ai>

Differential Revision: https://phab.corp.pixielabs.ai/D11314

GitOrigin-RevId: 1df915d
  • Loading branch information
JamesMBartlett authored and copybaranaut committed Apr 27, 2022
1 parent f29f6be commit 925a7f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vizier/services/cloud_connector/vzmetrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ go_library(
importpath = "px.dev/pixie/src/vizier/services/cloud_connector/vzmetrics",
visibility = ["//visibility:public"],
deps = [
"//src/shared/goversion",
"@com_github_prometheus_common//expfmt",
"@com_github_prometheus_common//model",
"@com_github_prometheus_prometheus//prompb",
Expand Down
3 changes: 3 additions & 0 deletions src/vizier/services/cloud_connector/vzmetrics/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/prompb"

version "px.dev/pixie/src/shared/goversion"
)

// ParsePrometheusTextToWriteReq parses prometheus metrics in prometheus' text-based exposition format, into a prometheus WriteRequest protobuf.
Expand All @@ -49,6 +51,7 @@ func ParsePrometheusTextToWriteReq(text string, clusterID string, podName string
for _, s := range samples {
s.Metric["cluster_id"] = model.LabelValue(clusterID)
s.Metric["pod_name"] = model.LabelValue(podName)
s.Metric["vizier_version"] = model.LabelValue(version.GetVersion().ToString())
}
return toWriteRequest(samples), nil
}
Expand Down

0 comments on commit 925a7f4

Please sign in to comment.