File tree Expand file tree Collapse file tree
engine/internal/srv/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121 "gitlab.com/postgres-ai/database-lab/v3/pkg/config/global"
2222 "gitlab.com/postgres-ai/database-lab/v3/pkg/log"
2323 "gitlab.com/postgres-ai/database-lab/v3/pkg/models"
24+ "gitlab.com/postgres-ai/database-lab/v3/version"
2425)
2526
2627// containerCPUState stores previous CPU stats for delta calculation.
@@ -82,14 +83,13 @@ func (c *Collector) Collect(ctx context.Context) {
8283func (c * Collector ) collectInstanceMetrics () {
8384 c .metrics .InstanceInfo .WithLabelValues (
8485 c .engProps .InstanceID ,
85- c . engProps . Version ,
86+ version . GetVersion () ,
8687 c .engProps .GetEdition (),
8788 ).Set (1 )
8889
8990 c .metrics .InstanceUptime .Set (time .Since (c .startedAt ).Seconds ())
9091
91- statusCode := models .StatusOK
92- c .metrics .InstanceStatus .WithLabelValues (statusCode ).Set (1 )
92+ c .metrics .InstanceStatus .WithLabelValues (string (models .StatusOK )).Set (1 )
9393
9494 c .metrics .RetrievalStatus .WithLabelValues (
9595 string (c .retrieval .State .Mode ),
@@ -181,7 +181,7 @@ func (c *Collector) collectCloneMetrics(ctx context.Context) {
181181 clone .Branch ,
182182 snapshotID ,
183183 poolName ,
184- clone .Status .Code ,
184+ string ( clone .Status .Code ) ,
185185 protectedStr ,
186186 ).Set (1 )
187187
You can’t perform that action at this time.
0 commit comments