Documentation
¶
Overview ¶
tracing.go
Index ¶
- Variables
- func EmitCustomEvent(eventName string, keyValues ...interface{}) error
- func EnableElasticsearchLogging(enabled bool) error
- func Initialize(host host.Host, did did.DID, cfg *config.Config) error
- func IsNoOpMode() bool
- func OverrideLoggerForTesting() error
- func SetAPIKey(apiKey string) error
- func SetAPMURL(url string) error
- func SetElasticsearchEndpoint(url string) error
- func SetFlushInterval(seconds int) error
- func SetLogLevel(level string) error
- func SetNoOpMode(enabled bool)
- func Shutdown()
- func ShutdownTracer()
- func StartTrace(args ...interface{}) func()
- type CustomEvent
Constants ¶
This section is empty.
Variables ¶
var (
EventBus event.Bus
)
Global variables for observability control
Functions ¶
func EmitCustomEvent ¶
EmitCustomEvent allows developers to emit custom events with variadic key-value pairs
func EnableElasticsearchLogging ¶
EnableElasticsearchLogging enables or disables Elasticsearch logging dynamically.
func Initialize ¶
Initialize sets up the logger, tracing, and event bus
func OverrideLoggerForTesting ¶
func OverrideLoggerForTesting() error
OverrideLoggerForTesting reconfigures the logger for unit tests
func SetElasticsearchEndpoint ¶
SetElasticsearchEndpoint updates the Elasticsearch URL and reinitializes the logger.
func SetFlushInterval ¶
SetFlushInterval sets the flush interval for Elasticsearch logging dynamically
func SetLogLevel ¶
SetLogLevel sets the global log level for all collectors
func SetNoOpMode ¶
func SetNoOpMode(enabled bool)
SetNoOpMode enables or disables the no-op mode for observability.
func ShutdownTracer ¶
func ShutdownTracer()
ShutdownTracer wraps the Shutdown function from tracing.go
func StartTrace ¶
func StartTrace(args ...interface{}) func()
StartTrace is a unified entry point to start instrumentation.
Usage patterns:
- StartTrace(operationName string, keyValues ...interface{})
- StartTrace(ctx context.Context, operationName string, keyValues ...interface{})
- StartTrace(c *gin.Context, operationName string, keyValues ...interface{})
Logic:
- If we find an existing transaction in ctx (e.g., from apmgin), start a span.
- If no existing transaction is found, start a new "request"-type transaction.