Files
Andreas GerstmayrandGitHub 87058f7b85 Migrate from OpenTracing to OpenTelemetry instrumentation (#3646)
* Migrate from OpenTracing to OpenTelemetry instrumentation

Signed-off-by: Andreas Gerstmayr <[email protected]>

* update dskit to c41c58734f46

Signed-off-by: Andreas Gerstmayr <[email protected]>

* switch to exporters/autoexport, update docs and examples

Signed-off-by: Andreas Gerstmayr <[email protected]>

* update dependencies

Signed-off-by: Andreas Gerstmayr <[email protected]>

* refactor added code from opentracing to OTEL SDK

Signed-off-by: Andreas Gerstmayr <[email protected]>

* move the changelog entry to the correct version

Signed-off-by: Andreas Gerstmayr <[email protected]>

* run go mod tidy

Signed-off-by: Andreas Gerstmayr <[email protected]>

* align tracer name with pkg name, some fixes

Signed-off-by: Andreas Gerstmayr <[email protected]>

* update cmd/tempo-query/tempo tracer name

Signed-off-by: Andreas Gerstmayr <[email protected]>

* update changelog, enable tracing if OTEL_TRACES_EXPORTER is set

Signed-off-by: Andreas Gerstmayr <[email protected]>

---------

Signed-off-by: Andreas Gerstmayr <[email protected]>
2024-09-05 19:56:54 +00:00

36 lines
1014 B
Go

package overrides
import (
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel"
)
const wildcardTenant = "*"
var tracer = otel.Tracer("modules/overrides")
var metricOverridesLimitsDesc = prometheus.NewDesc(
"tempo_limits_overrides",
"Resource limit overrides applied to tenants",
[]string{"limit_name", "user"},
nil,
)
// NewOverrides makes a new Overrides service.
// We store the supplied overrides in a global variable to ensure per-tenant overrides
// are defaulted to those values. As such, the last call to NewOverrides will
// become the new global defaults.
func NewOverrides(cfg Config, validator Validator, registerer prometheus.Registerer) (Service, error) {
o, err := newRuntimeConfigOverrides(cfg, validator, registerer)
if err != nil {
return nil, err
}
if cfg.UserConfigurableOverridesConfig.Enabled {
// Wrap runtime config with user-config overrides module
o, err = newUserConfigOverrides(&cfg.UserConfigurableOverridesConfig, o)
}
return o, err
}