Documentation ¶
Index ¶
- Constants
- func ConfigureLogging(config *conf.LoggingConfig) error
- func ConfigureMetrics(ctx context.Context, mc *conf.MetricsConfig) error
- func ConfigureProfiler(ctx context.Context, pc *conf.ProfilerConfig) error
- func ConfigureTracing(ctx context.Context, tc *conf.TracingConfig) error
- func GetLogEntry(r *http.Request) logrus.FieldLogger
- func LogEntrySetField(r *http.Request, key string, value interface{}) logrus.FieldLogger
- func LogEntrySetFields(r *http.Request, fields logrus.Fields) logrus.FieldLogger
- func Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter
- func NewStructuredLogger(logger *logrus.Logger, config *conf.GlobalConfiguration) func(next http.Handler) http.Handler
- func ObtainMetricCounter(name, desc string) metricCounter
- func RequestTracing() func(http.Handler) http.Handler
- func Tracer(name string, opts ...trace.TracerOption) trace.Tracer
- func WaitForCleanup(ctx context.Context)
- type ProfilerHandler
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 NewStructuredLogger ¶
func ObtainMetricCounter ¶
func ObtainMetricCounter(name, desc string) metricCounter
func RequestTracing ¶
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 WaitForCleanup ¶
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)
Click to show internal directories.
Click to hide internal directories.