observability

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMeterProvider

func GetMeterProvider() *sdkmetric.MeterProvider

func GetTracerProvider

func GetTracerProvider() *sdktrace.TracerProvider

func InitMetrics

func InitMetrics() error

func InitOTEL

func InitOTEL(ctx context.Context, cfg OTELConfig) (func(context.Context) error, error)

InitOTEL initializes OpenTelemetry with the provided configuration

func RecordPeriodicTaskExecution

func RecordPeriodicTaskExecution(ctx context.Context, duration time.Duration, taskName string, success bool)

func RecordPeriodicTaskWorker

func RecordPeriodicTaskWorker(ctx context.Context, delta int64)

func RecordScriptExecution

func RecordScriptExecution(ctx context.Context, duration time.Duration, scriptType string, success bool)

func RecordWebhookExecution

func RecordWebhookExecution(ctx context.Context, duration time.Duration, path string, success bool)

Types

type OTELConfig

type OTELConfig struct {
	Enabled            bool    `env:"RF_OTEL_ENABLED,default=false"`
	Endpoint           string  `env:"RF_OTEL_ENDPOINT,default=localhost:4317"`
	Headers            string  `env:"RF_OTEL_HEADERS"`
	ServiceName        string  `env:"RF_OTEL_SERVICE_NAME,default=rapidforge"`
	ServiceVersion     string  `env:"RF_OTEL_SERVICE_VERSION"`
	Environment        string  `env:"RF_OTEL_ENVIRONMENT"`
	TracesSampler      string  `env:"RF_OTEL_TRACES_SAMPLER,default=parentbased_always_on"`
	TracesSamplerArg   float64 `env:"RF_OTEL_TRACES_SAMPLER_ARG,default=1.0"`
	MetricsEnabled     bool    `env:"RF_OTEL_METRICS_ENABLED,default=true"`
	ExporterType       string  `env:"RF_OTEL_EXPORTER_TYPE,default=otlp"`
	ExporterProtocol   string  `env:"RF_OTEL_EXPORTER_PROTOCOL,default=http"` // "grpc" or "http"
	InsecureConnection bool    `env:"RF_OTEL_INSECURE,default=false"`
	// contains filtered or unexported fields
}

func LoadConfigFromEnv

func LoadConfigFromEnv(ctx context.Context, version string) (OTELConfig, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL