mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 11:42:12 +08:00
API Server: Standalone observability (#84789)
Adds support for logs (specify level), metrics (enable metrics and Prometheus /metrics endpoint and traces (jaeger or otlp) for standalone API server. This will allow any grafana core service part of standalone apiserver to use logging, metrics and traces as normal.
This commit is contained in:

committed by
GitHub

parent
856ed64aac
commit
6c1de260a2
@ -11,20 +11,20 @@ import (
|
||||
// newTracingCfg creates a plugins tracing configuration based on the provided Grafana tracing config.
|
||||
// If OpenTelemetry (OTLP) is disabled, a zero-value OpenTelemetryCfg is returned.
|
||||
func newTracingCfg(grafanaCfg *setting.Cfg) (pCfg.Tracing, error) {
|
||||
ots, err := tracing.ParseSettings(grafanaCfg)
|
||||
tracingCfg, err := tracing.ParseTracingConfig(grafanaCfg)
|
||||
if err != nil {
|
||||
return pCfg.Tracing{}, fmt.Errorf("parse settings: %w", err)
|
||||
}
|
||||
if !ots.OTelExporterEnabled() {
|
||||
if !tracingCfg.OTelExporterEnabled() {
|
||||
return pCfg.Tracing{}, nil
|
||||
}
|
||||
return pCfg.Tracing{
|
||||
OpenTelemetry: pCfg.OpenTelemetryCfg{
|
||||
Address: ots.Address,
|
||||
Propagation: ots.Propagation,
|
||||
Sampler: ots.Sampler,
|
||||
SamplerParam: ots.SamplerParam,
|
||||
SamplerRemoteURL: ots.SamplerRemoteURL,
|
||||
Address: tracingCfg.Address,
|
||||
Propagation: tracingCfg.Propagation,
|
||||
Sampler: tracingCfg.Sampler,
|
||||
SamplerParam: tracingCfg.SamplerParam,
|
||||
SamplerRemoteURL: tracingCfg.SamplerRemoteURL,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user