-
Notifications
You must be signed in to change notification settings - Fork 692
[metrics-generator] filter out spans based on policy #2274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8d93769
504dc32
d7192ab
5b38fd4
85b574b
47257a5
c06443a
815bdd9
df84ba5
0f5a60d
676898b
604b0c9
b34607d
27f2060
887a007
08ff12e
d030644
6b91f32
faa54d7
ca4c226
ca74049
d5d3fdd
abc52b0
6ca1914
a081371
26f3f6f
ee6981d
082ece9
beb3047
3bc8e16
83521d5
a9f7c97
e8e8b9c
2fbdab0
bc3c9cd
91b81ce
cce79ef
df6c139
4f15bde
de30000
79151bb
ebe07dd
7b90d5a
fba090a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,10 @@ var ( | |
| }, []string{"tenant", "reason"}) | ||
| ) | ||
|
|
||
| const reasonOutsideTimeRangeSlack = "outside_metrics_ingestion_slack" | ||
| const ( | ||
| reasonOutsideTimeRangeSlack = "outside_metrics_ingestion_slack" | ||
| reasonSpanMetricsFiltered = "span_metrics_filtered" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: maybe something like "filter_policy" ? because I think "span_metrics" is already in the metrics name
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this doesn't read well. Its used to indicate the number of spans rejected by the filter, so what about |
||
| ) | ||
|
|
||
| type instance struct { | ||
| cfg *Config | ||
|
|
@@ -256,9 +259,14 @@ func (i *instance) addProcessor(processorName string, cfg ProcessorConfig) error | |
| level.Debug(i.logger).Log("msg", "adding processor", "processorName", processorName) | ||
|
|
||
| var newProcessor processor.Processor | ||
| var err error | ||
| switch processorName { | ||
| case spanmetrics.Name: | ||
| newProcessor = spanmetrics.New(cfg.SpanMetrics, i.registry) | ||
| filteredSpansCounter := metricSpansDiscarded.WithLabelValues(i.instanceID, reasonSpanMetricsFiltered) | ||
| newProcessor, err = spanmetrics.New(cfg.SpanMetrics, i.registry, filteredSpansCounter) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| case servicegraphs.Name: | ||
| newProcessor = servicegraphs.New(cfg.ServiceGraphs, i.instanceID, i.registry, i.logger) | ||
| default: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.