[hw-7] add metrics, tracing

This commit is contained in:
Никита Шубин
2025-07-26 14:15:40 +00:00
parent 342bd3f726
commit 4396bebe80
38 changed files with 717 additions and 36 deletions

View File

@@ -0,0 +1,16 @@
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var inMemoryObjectsGauge = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "app",
Name: "inmemory_repo_objects",
Help: "Current in-memory repository size",
})
func SetInMemoryObjects(n int) {
inMemoryObjectsGauge.Set(float64(n))
}