MCPcopy
hub / github.com/grafana/tempo / ExtractNoGenerateMetrics

Function ExtractNoGenerateMetrics

modules/generator/generator.go:294–306  ·  view source on GitHub ↗

ExtractNoGenerateMetrics checks for presence of context keys that indicate no span-derived metrics should be generated for the request. If any such context key is present, this will return true, otherwise it will return false.

(ctx context.Context)

Source from the content-addressed store, hash-verified

292// span-derived metrics should be generated for the request. If any such context
293// key is present, this will return true, otherwise it will return false.
294func ExtractNoGenerateMetrics(ctx context.Context) bool {
295 // check gRPC context
296 if len(metadata.ValueFromIncomingContext(ctx, NoGenerateMetricsContextKey)) > 0 {
297 return true
298 }
299
300 // check http context
301 if len(client.FromContext(ctx).Metadata.Get(NoGenerateMetricsContextKey)) > 0 {
302 return true
303 }
304
305 return false
306}

Callers 3

SendTracesMethod · 0.92
pushTracesKafkaMethod · 0.92
PushTracesMethod · 0.92

Calls 1

GetMethod · 0.65

Tested by 1

PushTracesMethod · 0.74