Documentation ¶
Overview ¶
Package ops provides operational features needed for monitoring, logging, tracing or deployment.
Index ¶
- func AddLoggingContext(c userContextProvider, key, value string)
- func ConfigureLogging(logConfig configs.LogConfig, profiles *Profiles)
- func ConfigureMetrics(vConf *configs.ValkyrieConfig) error
- func ConfigureTracing(cfg *TracingConfig) error
- func GetTracingHeaders(ctx context.Context) map[string]string
- func LogHTTPRequest(req *fasthttp.Request) func(event *zerolog.Event)
- func LogHTTPResponse(req *fasthttp.Request, resp *fasthttp.Response, err error) func(event *zerolog.Event)
- func LoggingMiddleware(apps ...*fiber.App)
- func OnGCE() bool
- func TraceHTTPAttributes(span trace.Span, req *fasthttp.Request, resp *fasthttp.Response, err error)
- func TracingMiddleware(cfg *TracingConfig, apps ...*fiber.App)
- type ExporterType
- type MetricConfig
- type MetricExporterType
- type Profiles
- type TracingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLoggingContext ¶
func AddLoggingContext(c userContextProvider, key, value string)
AddLoggingContext adds the key and value to all logging messages in this request context.
func ConfigureLogging ¶
ConfigureLogging configures the logging framework
func ConfigureMetrics ¶ added in v0.7.0
func ConfigureMetrics(vConf *configs.ValkyrieConfig) error
ConfigureMetrics configures metrics, including exporter and instrumentation
func ConfigureTracing ¶ added in v0.5.0
func ConfigureTracing(cfg *TracingConfig) error
ConfigureTracing configures the tracing framework based on TracingConfig.
func GetTracingHeaders ¶
GetTracingHeaders returns the tracing headers
func LogHTTPRequest ¶ added in v0.5.0
LogHTTPRequest return a function that adds request data to the zerolog Event
func LogHTTPResponse ¶ added in v0.5.0
func LogHTTPResponse(req *fasthttp.Request, resp *fasthttp.Response, err error) func(event *zerolog.Event)
LogHTTPResponse return a function that adds request and response data to the zerolog Event
func LoggingMiddleware ¶
func LoggingMiddleware(apps ...*fiber.App)
LoggingMiddleware setup zerolog and request logging
Adds tracing information to logging ¶
Adds debug logging for request and response ¶
func OnGCE ¶ added in v0.7.0
func OnGCE() bool
OnGCE reports whether this process is running on Google Compute Engine.
func TraceHTTPAttributes ¶
func TraceHTTPAttributes(span trace.Span, req *fasthttp.Request, resp *fasthttp.Response, err error)
TraceHTTPAttributes sets relevant tracing attributes based on provided fasthttp.Request and fasthttp.Response.
func TracingMiddleware ¶
func TracingMiddleware(cfg *TracingConfig, apps ...*fiber.App)
TracingMiddleware adds tracing
Types ¶
type ExporterType ¶
type ExporterType string
const ( StdOut ExporterType = "stdout" OTLPTraceHTTP ExporterType = "otlptracehttp" None ExporterType = "" )
type MetricConfig ¶ added in v0.7.0
type MetricConfig struct { Exporter MetricExporterType Version string ServiceName string Namespace string configs.MetricConfig }
type MetricExporterType ¶ added in v0.7.0
type MetricExporterType string
const ( MetricStdOut MetricExporterType = "stdout" MetricOTLPHTTP MetricExporterType = "otlpmetrichttp" MetricNone MetricExporterType = "" )
type Profiles ¶
type Profiles struct {
// contains filtered or unexported fields
}
A Profiles struct holds all loaded profiles of the application. A profile can be used at runtime to customize behavior of the application. This was inspired by other frameworks, such as Micronaut (https://github.com/micronaut-projects/micronaut-core/blob/v3.6.3/inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java)
func NewProfiles ¶
func NewProfiles() *Profiles
type TracingConfig ¶
type TracingConfig struct { Exporter ExporterType Version string ServiceName string Namespace string configs.TraceConfig }
func Tracing ¶
func Tracing(vConf *configs.ValkyrieConfig) *TracingConfig
Tracing returns a TracingConfig based on the provided Valkyrie config