observability

package
v0.0.0-...-e3e9b0f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_SQL_ALL       = "all"
	LOG_SQL_NONE      = "none"
	LOG_SQL_STATEMENT = "statement"
)

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(config *conf.LoggingConfig) error

func ConfigureMetrics

func ConfigureMetrics(ctx context.Context, mc *conf.MetricsConfig) error

func ConfigureProfiler

func ConfigureProfiler(ctx context.Context, pc *conf.ProfilerConfig) error

func ConfigureTracing

func ConfigureTracing(ctx context.Context, tc *conf.TracingConfig) error

ConfigureTracing sets up global tracing configuration for OpenTracing / OpenTelemetry. The context should be the global context. Cancelling this context will cancel tracing collection.

func GetLogEntry

func GetLogEntry(r *http.Request) logrus.FieldLogger

func LogEntrySetField

func LogEntrySetField(r *http.Request, key string, value interface{}) logrus.FieldLogger

func LogEntrySetFields

func LogEntrySetFields(r *http.Request, fields logrus.Fields) logrus.FieldLogger

func Meter

func Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter

func NewStructuredLogger

func NewStructuredLogger(logger *logrus.Logger, config *conf.GlobalConfiguration) func(next http.Handler) http.Handler

func ObtainMetricCounter

func ObtainMetricCounter(name, desc string) metricCounter

func RequestTracing

func RequestTracing() func(http.Handler) http.Handler

RequestTracing returns an HTTP handler that traces all HTTP requests coming in. Supports Chi routers, so this should be one of the first middlewares on the router.

func Tracer

func Tracer(name string, opts ...trace.TracerOption) trace.Tracer

func WaitForCleanup

func WaitForCleanup(ctx context.Context)

WaitForCleanup waits until all observability long-running goroutines shut down cleanly or until the provided context signals done.

Types

type ProfilerHandler

type ProfilerHandler struct{}

func (*ProfilerHandler) ServeHTTP

func (p *ProfilerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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