diff --git a/pkg/daemon/server/daemon_server.go b/pkg/daemon/server/daemon_server.go index 768f789dd..351b2607c 100644 --- a/pkg/daemon/server/daemon_server.go +++ b/pkg/daemon/server/daemon_server.go @@ -42,6 +42,7 @@ import ( "github.com/numaproj/numaflow/pkg/daemon/server/service" server "github.com/numaproj/numaflow/pkg/daemon/server/service/rater" "github.com/numaproj/numaflow/pkg/isbsvc" + "github.com/numaproj/numaflow/pkg/metrics" jsclient "github.com/numaproj/numaflow/pkg/shared/clients/nats" redisclient "github.com/numaproj/numaflow/pkg/shared/clients/redis" "github.com/numaproj/numaflow/pkg/shared/logging" @@ -156,7 +157,9 @@ func (ds *daemonServer) Run(ctx context.Context) error { go ds.exposeMetrics(ctx) version := numaflow.GetVersion() - pipeline_info.WithLabelValues(version.Version, version.Platform, ds.pipeline.Name).Set(1) + // TODO: clean it up in v1.6 + deprecatedPipelineInfo.WithLabelValues(version.Version, version.Platform, ds.pipeline.Name).Set(1) + metrics.BuildInfo.WithLabelValues(v1alpha1.ComponentDaemon, ds.pipeline.Name, version.Version, version.Platform).Set(1) log.Infof("Daemon server started successfully on %s", address) <-ctx.Done() diff --git a/pkg/daemon/server/metrics.go b/pkg/daemon/server/metrics.go index c27bdeedb..6c31e5e72 100644 --- a/pkg/daemon/server/metrics.go +++ b/pkg/daemon/server/metrics.go @@ -23,10 +23,11 @@ import ( ) var ( - pipeline_info = promauto.NewGaugeVec(prometheus.GaugeOpts{ + // Deprecated: Use pkg/metrics.BuildInfo instead. + deprecatedPipelineInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ Subsystem: "pipeline", Name: "build_info", - Help: "A metric with a constant value '1', labeled by Numaflow binary version and platform, as well as the pipeline name", + Help: "A metric with a constant value '1', labeled by Numaflow binary version and platform, as well as the pipeline name. Deprecated: Use build_info instead", }, []string{metrics.LabelVersion, metrics.LabelPlatform, metrics.LabelPipeline}) // Pipeline processing lag, max(watermark) - min(watermark) diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 275498348..53605eca2 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -41,6 +41,11 @@ const ( ) var ( + BuildInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "build_info", + Help: "A metric with a constant value '1', labeled by Numaflow binary version, platform, and other information", + }, []string{LabelComponent, LabelComponentName, LabelVersion, LabelPlatform}) + SDKInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "sdk_info", Help: "A metric with a constant value '1', labeled by SDK information such as version, language, and type", diff --git a/pkg/mvtxdaemon/server/daemon_server.go b/pkg/mvtxdaemon/server/daemon_server.go index a8f05f64a..09f4e3bd7 100644 --- a/pkg/mvtxdaemon/server/daemon_server.go +++ b/pkg/mvtxdaemon/server/daemon_server.go @@ -38,6 +38,7 @@ import ( "github.com/numaproj/numaflow" "github.com/numaproj/numaflow/pkg/apis/numaflow/v1alpha1" "github.com/numaproj/numaflow/pkg/apis/proto/mvtxdaemon" + "github.com/numaproj/numaflow/pkg/metrics" "github.com/numaproj/numaflow/pkg/mvtxdaemon/server/service" rateServer "github.com/numaproj/numaflow/pkg/mvtxdaemon/server/service/rater" "github.com/numaproj/numaflow/pkg/shared/logging" @@ -108,7 +109,9 @@ func (ds *daemonServer) Run(ctx context.Context) error { }() version := numaflow.GetVersion() - monoVertexInfo.WithLabelValues(version.Version, version.Platform, ds.monoVtx.Name).Set(1) + // Todo: clean it up in v1.6 + deprecatedMonoVertexInfo.WithLabelValues(version.Version, version.Platform, ds.monoVtx.Name).Set(1) + metrics.BuildInfo.WithLabelValues(v1alpha1.ComponentMonoVertexDaemon, ds.monoVtx.Name, version.Version, version.Platform).Set(1) log.Infof("MonoVertex daemon server started successfully on %s", address) <-ctx.Done() diff --git a/pkg/mvtxdaemon/server/metrics.go b/pkg/mvtxdaemon/server/metrics.go index f3c0c3079..e06ea5906 100644 --- a/pkg/mvtxdaemon/server/metrics.go +++ b/pkg/mvtxdaemon/server/metrics.go @@ -24,9 +24,10 @@ import ( ) var ( - monoVertexInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ + // Deprecated: Use pkg/metrics.BuildInfo instead. + deprecatedMonoVertexInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ Subsystem: "monovtx", Name: "build_info", - Help: "A metric with a constant value '1', labeled by Numaflow binary version and platform, as well as the mono vertex name", + Help: "A metric with a constant value '1', labeled by Numaflow binary version and platform, as well as the mono vertex name. Deprecated: Use build_info instead", }, []string{metrics.LabelVersion, metrics.LabelPlatform, metrics.LabelMonoVertexName}) )