diff --git a/meter/meter.go b/meter/meter.go index 887b8236..2afe65d5 100644 --- a/meter/meter.go +++ b/meter/meter.go @@ -24,6 +24,13 @@ var ( DefaultSummaryQuantiles = []float64{0.5, 0.9, 0.97, 0.99, 1} // DefaultSummaryWindow is the default window for summary DefaultSummaryWindow = 5 * time.Minute + // DefaultSkipEndpoints is the slice of endpoint that must not be metered + DefaultSkipEndpoints = []string{ + "MeterService.Metrics", + "HealthService.Live", + "HealthService.Ready", + "HealthService.Version", + } ) // Meter is an interface for collecting and instrumenting metrics diff --git a/tracer/tracer.go b/tracer/tracer.go index caf56960..8ad7cdf4 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -7,14 +7,20 @@ import ( "go.unistack.org/micro/v3/logger" ) -// DefaultTracer is the global default tracer -var DefaultTracer Tracer = NewTracer() - var ( + // DefaultTracer is the global default tracer + DefaultTracer Tracer = NewTracer() //nolint:revive // TraceIDKey is the key used for the trace id in the log call TraceIDKey = "trace-id" // SpanIDKey is the key used for the span id in the log call SpanIDKey = "span-id" + // DefaultSkipEndpoints is the slice of endpoint that must not be traced + DefaultSkipEndpoints = []string{ + "MeterService.Metrics", + "HealthService.Live", + "HealthService.Ready", + "HealthService.Version", + } ) func init() {