2023-03-30 23:31:14 +02:00
|
|
|
package config
|
|
|
|
|
|
2023-04-05 13:40:08 +01:00
|
|
|
type Tracing struct {
|
|
|
|
|
OpenTelemetry OpenTelemetryCfg
|
|
|
|
|
}
|
2023-03-30 23:31:14 +02:00
|
|
|
|
2023-04-05 13:40:08 +01:00
|
|
|
// OpenTelemetryCfg contains the OpenTelemetry address and propagation config values.
|
|
|
|
|
// This is used to export the OpenTelemetry (OTLP) config without exposing the whole *setting.Cfg.
|
|
|
|
|
type OpenTelemetryCfg struct {
|
2023-03-30 23:31:14 +02:00
|
|
|
Address string
|
|
|
|
|
Propagation string
|
2023-11-10 14:56:08 +01:00
|
|
|
|
|
|
|
|
Sampler string
|
|
|
|
|
SamplerParam float64
|
|
|
|
|
SamplerRemoteURL string
|
2023-03-30 23:31:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsEnabled returns true if OTLP tracing is enabled (address set)
|
2023-04-05 13:40:08 +01:00
|
|
|
func (t Tracing) IsEnabled() bool {
|
|
|
|
|
return t.OpenTelemetry.Address != ""
|
2023-03-30 23:31:14 +02:00
|
|
|
}
|