mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 14:03:45 +03:00
[hw-7] add metrics, tracing
This commit is contained in:
16
cart/internal/infra/http/metrics/repository.go
Normal file
16
cart/internal/infra/http/metrics/repository.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user