mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: create tracing.SlogSink for storing logs as span events (#4962)
This commit is contained in:
@ -88,6 +88,9 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
|
||||
if ok, _ := cmd.Flags().GetBool(varVerbose); ok {
|
||||
logger = logger.Leveled(slog.LevelDebug)
|
||||
}
|
||||
if cfg.Trace.CaptureLogs.Value {
|
||||
logger = logger.AppendSinks(tracing.SlogSink{})
|
||||
}
|
||||
|
||||
// Main command context for managing cancellation
|
||||
// of running services.
|
||||
@ -126,7 +129,7 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
|
||||
shouldCoderTrace = cfg.Telemetry.Trace.Value
|
||||
}
|
||||
|
||||
if cfg.Trace.Enable.Value || shouldCoderTrace {
|
||||
if cfg.Trace.Enable.Value || shouldCoderTrace || cfg.Trace.HoneycombAPIKey.Value != "" {
|
||||
sdkTracerProvider, closeTracing, err := tracing.TracerProvider(ctx, "coderd", tracing.TracerOpts{
|
||||
Default: cfg.Trace.Enable.Value,
|
||||
Coder: shouldCoderTrace,
|
||||
|
Reference in New Issue
Block a user