Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTracerProvider ¶
func GetTracerProvider() oteltrace.TracerProvider
GetTracerProvider returns nuts-node's TracerProvider. This should be used by nuts-node components instead of otel.GetTracerProvider() to ensure spans are attributed to "nuts-node" service.
func RegisterAuditLogHook ¶
RegisterAuditLogHook sets the function that registers a logrus hook with the audit logger. This is called by the audit package during initialization to avoid circular imports.
func SetEnabled ¶
func SetEnabled(value bool)
SetEnabled sets the tracing enabled flag. Exported for testing only; do not call from production code.
Types ¶
type Config ¶
type Config struct {
// Endpoint is the OTLP collector endpoint for tracing (e.g., "localhost:4318").
// When empty, tracing is disabled.
Endpoint string `koanf:"endpoint"`
// Insecure disables TLS for the OTLP connection.
Insecure bool `koanf:"insecure"`
// ServiceName is the service name reported to the tracing backend.
// Defaults to "nuts-node".
ServiceName string `koanf:"servicename"`
}
Config contains settings for OpenTelemetry tracing.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the tracing engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the engine that manages OpenTelemetry tracing. It must be registered first to ensure tracing is active before other engines start, and shut down last (due to reverse shutdown order) to capture all logs/spans.
func (*Engine) CheckHealth ¶
CheckHealth returns the health status of the tracing subsystem. When tracing is not configured or not running, no health entry is returned (not applicable). When enabled and running, we return UP since we successfully initialized - we can't easily verify OTLP endpoint connectivity as spans are exported asynchronously.
func (*Engine) Configure ¶
func (e *Engine) Configure(_ core.ServerConfig) error
Configure sets up OpenTelemetry tracing with the configured endpoint.
func (*Engine) Diagnostics ¶
func (e *Engine) Diagnostics() []core.DiagnosticResult
Diagnostics returns diagnostic information about the tracing configuration.