OpenTelemetry support (#995)

This commit is contained in:
Sergey Alexandrovich
2022-10-06 15:08:23 +06:00
committed by GitHub
parent 970f2c1c86
commit 36f67a6f96
10 changed files with 726 additions and 960 deletions

View File

@@ -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
}