Open baikunthasahoo opened 1 hour ago
Pinging code owners:
processor/filter: @TylerHelmuth @boostchicken
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Hi @baikunthasahoo!
Can you check whether something like the following config may help you to achieve this? This makes use of the IsMatch
OTTL function:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
processors:
filter:
traces:
span:
- 'IsMatch(attributes["http.target"], ".*\\/api\\/healthz.*")'
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
processors: [filter]
exporters: [debug]
With this config, the following span was filtered as expected:
telemetrygen traces --otlp-insecure --traces 1 --status-code Ok --span-duration 1s --telemetry-attributes http.target=\"/api/healthz\"
@bacherfl
Thanks for your quick support. Here i want suppress the /api/healthz noise. Does above example will suppress the ./api/healthz. ?
Yes, this configuration will filter out all spans with the http.target
attribute set to /api/healthz
Component(s)
processor/filter
Describe the issue you're reporting
Hi Team,
I am trying to exclude spans in the OpenTelemetry Collector using the filterprocessor. Specifically, I need to exclude spans where the next.route attribute matches the following values:
/api/healthz /[locale]/api/healthz (where [locale] is dynamic, e.g., /en, /fr, etc.) Despite configuring the filterprocessor with a regular expression, I am still seeing these spans in the traces. Below are the steps, configurations, and behaviors observed.
filter/exclude-health-api-traces: spans: exclude: match_type: regexp attributes:
key: "http.target" value: ".\/api\/healthz."
key: "http.target" value: ".\/api\/healthz."
key: "http.url" value: "http:\/\/\d+\.\d+\.\d+\.\d+:3000\/(view|file|cloud|api)\/api\/healthz"
key: "http.user_agent" value: ".kube-probe\/1\.."
key: "next.route" value: "(\/[^\/]+)?\/api\/healthz"
filter/spans: spans: exclude: match_type: regexp span_names:
".\/api\/healthz."
".\/api\/health\/."
I need your support on above query
Note: I have deployed my application in Kubernetes and used health probes for every 10sc. my application send data to collector as daemonset from otel collector i am exporting my traces.