Documentation
¶
Overview ¶
Package observability owns Soro tracing, metrics, and HTTP instrumentation.
Index ¶
- Constants
- func NewLogger(settings LoggerConfig) (*slog.Logger, error)
- type Config
- type DatabaseHook
- type HTTPOptions
- type LoggerConfig
- type Metrics
- func (metrics *Metrics) RecordDatabase(ctx context.Context, operation, status string, duration time.Duration)
- func (metrics *Metrics) RecordEvent(ctx context.Context, topic, subscriber string, duration time.Duration, ...)
- func (metrics *Metrics) RecordHTTP(ctx context.Context, method string, status int, duration time.Duration)
- func (metrics *Metrics) RecordJob(ctx context.Context, kind, queue string, attempts int, duration time.Duration, ...)
- func (metrics *Metrics) RecordMail(ctx context.Context, transport string, duration time.Duration, err error)
- func (metrics *Metrics) RecordWebhook(ctx context.Context, engineID, endpoint, outcome string, status int, ...)
- type Provider
- func (provider *Provider) DatabaseHook() *DatabaseHook
- func (provider *Provider) HTTPMiddleware(options HTTPOptions) func(http.Handler) http.Handler
- func (provider *Provider) Handler() http.Handler
- func (provider *Provider) LogHandler() slog.Handler
- func (provider *Provider) Meter() metricapi.Meter
- func (provider *Provider) Metrics() *Metrics
- func (provider *Provider) Propagator() propagation.TextMapPropagator
- func (provider *Provider) Shutdown(ctx context.Context) error
- func (provider *Provider) Tracer() trace.Tracer
Constants ¶
View Source
const RedactedValue = "[REDACTED]"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type DatabaseHook ¶
type DatabaseHook struct {
// contains filtered or unexported fields
}
func (*DatabaseHook) AfterQuery ¶
func (hook *DatabaseHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*DatabaseHook) BeforeQuery ¶
func (hook *DatabaseHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context
type HTTPOptions ¶
type LoggerConfig ¶
type LoggerConfig struct {
Writer io.Writer
Environment string
Level string
Format string
SensitiveKeys []string
ReplaceAttr func(groups []string, attr slog.Attr) slog.Attr
// TelemetryHandler receives the same structured records as the local
// writer after level filtering and secret redaction.
TelemetryHandler slog.Handler
}
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) RecordDatabase ¶
func (*Metrics) RecordEvent ¶
func (*Metrics) RecordHTTP ¶
func (*Metrics) RecordMail ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) DatabaseHook ¶
func (provider *Provider) DatabaseHook() *DatabaseHook
func (*Provider) HTTPMiddleware ¶
func (*Provider) LogHandler ¶
LogHandler bridges structured slog records into the application-owned OTLP logger provider. It returns nil when network export is disabled.
func (*Provider) Propagator ¶
func (provider *Provider) Propagator() propagation.TextMapPropagator
Click to show internal directories.
Click to hide internal directories.