mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 12:12:40 +02:00
OpenTelemetry support (#995)
This commit is contained in:
committed by
GitHub
parent
970f2c1c86
commit
36f67a6f96
20
vips/vips.go
20
vips/vips.go
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/imgproxy/imgproxy/v3/imagetype"
|
||||
"github.com/imgproxy/imgproxy/v3/metrics/datadog"
|
||||
"github.com/imgproxy/imgproxy/v3/metrics/newrelic"
|
||||
"github.com/imgproxy/imgproxy/v3/metrics/otel"
|
||||
"github.com/imgproxy/imgproxy/v3/metrics/prometheus"
|
||||
)
|
||||
|
||||
@@ -105,6 +106,25 @@ func Init() error {
|
||||
newrelic.AddGaugeFunc("vips.max_memory", GetMemHighwater)
|
||||
newrelic.AddGaugeFunc("vips.allocs", GetAllocs)
|
||||
|
||||
otel.AddGaugeFunc(
|
||||
"vips_memory_bytes",
|
||||
"A gauge of the vips tracked memory usage in bytes.",
|
||||
"By",
|
||||
GetMem,
|
||||
)
|
||||
otel.AddGaugeFunc(
|
||||
"vips_max_memory_bytes",
|
||||
"A gauge of the max vips tracked memory usage in bytes.",
|
||||
"By",
|
||||
GetMemHighwater,
|
||||
)
|
||||
otel.AddGaugeFunc(
|
||||
"vips_allocs",
|
||||
"A gauge of the number of active vips allocations.",
|
||||
"By",
|
||||
GetAllocs,
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user