Revert "chore(tracing): Initialize tracing early, before wire" (#112758)

Revert "chore(tracing): Initialize tracing early, before wire (#112007)"

This reverts commit 8ec162afec.
This commit is contained in:
Todd Treece 2025-10-21 17:23:09 -04:00 committed by GitHub
parent f3cc62569b
commit 069cc909ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 27 deletions

View File

@ -11,7 +11,9 @@ import (
"syscall"
"time"
"github.com/grafana/grafana/pkg/services/featuremgmt"
_ "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
"github.com/urfave/cli/v2"
"github.com/grafana/grafana/pkg/api"
@ -19,10 +21,8 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/infra/process"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/server"
"github.com/grafana/grafana/pkg/services/apiserver/standalone"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
)
@ -111,11 +111,6 @@ func RunServer(opts standalone.BuildInfo, cli *cli.Context) error {
return err
}
// Initialize tracing early to ensure it's always available for other services
if err := tracing.InitTracing(cfg); err != nil {
return err
}
s, err := server.Initialize(
cli.Context,
cfg,

View File

@ -11,8 +11,6 @@ import (
"sync"
"time"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
jaegerpropagator "go.opentelemetry.io/contrib/propagators/jaeger"
"go.opentelemetry.io/contrib/samplers/jaegerremote"
"go.opentelemetry.io/otel"
@ -29,9 +27,11 @@ import (
"go.opentelemetry.io/otel/trace/noop"
"google.golang.org/grpc/credentials"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/setting"
)
const (
@ -105,23 +105,6 @@ func ProvideService(tracingCfg *TracingConfig) (*TracingService, error) {
return ots, nil
}
// InitTracing initializes the tracing service with the provided configuration.
// Used to initialize tracing early to ensure it's always available for other
// services, outside of the wire context.
func InitTracing(cfg *setting.Cfg) error {
tracingCfg, err := ParseTracingConfig(cfg)
if err != nil {
return fmt.Errorf("parse tracing config: %w", err)
}
_, err = ProvideService(tracingCfg)
if err != nil {
return fmt.Errorf("initialize tracing: %w", err)
}
return nil
}
func NewNoopTracerService() *TracingService {
tp := &noopTracerProvider{TracerProvider: noop.NewTracerProvider()}
otel.SetTracerProvider(tp)