Files
OwnCord/Server/telemetry/telemetry_default.go
T
J3vbandClaude Opus 4.8 4fc21cb372 feat(server): logging & error-visibility hardening
Make server failures debuggable without leaking secrets:
- configurable stdout log level (config.yaml logging.level + OWNCORD_LOGGING_LEVEL)
- preserve the DB cause in ErrInternal wraps; log auth-DB failures distinctly
  from bad tokens; log the previously-silent expired-session cleanup goroutine
- route HTTP handler panics through slog (was chi stderr-only, invisible to
  the admin log stream)
- stackutil: argument-free panic stacks so key/token bytes never reach the
  admin ring buffer / SSE; slog.LogValuer redaction on VoiceConfig/GitHubConfig/
  GIFConfig/Config and db.User/db.Session
- logctx: req_id/trace_id correlation on ...Context log calls

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 11:07:12 +02:00

27 lines
957 B
Go

//go:build !otel
// Default no-op build of the telemetry package — see telemetry.go for the
// public API. The real OpenTelemetry SDK wiring lives in telemetry_otel.go and
// is selected by `go build -tags otel ./...`.
package telemetry
import (
"context"
"github.com/owncord/server/config"
)
// Init configures and installs the OpenTelemetry SDK based on cfg. In the
// default build this installs a no-op provider so call sites have a usable
// global handle without pulling in any external dependencies.
func Init(_ context.Context, cfg config.TelemetryConfig) (ShutdownFunc, error) {
_ = cfg // honoured by the otel-tagged build only
SetGlobal(noopProvider{})
return func(context.Context) error { return nil }, nil
}
// TraceIDFromContext returns the active trace ID as a hex string, or "" when no
// span is active. The default build has no tracing, so it always returns "".
func TraceIDFromContext(_ context.Context) string { return "" }