https://signoz.io logo
Title
g

Guillaume

02/07/2023, 9:33 AM
Hi, I've been trying to use the filters to hide some useless queries from being sent, I'm using Helm to deploy SigNoz, but it was not succesfull so far. Here is an example of a request I got, and here is the code I use to filter it:
processors:
          filter:
            spans:
              exclude:
                match_type: regexp
                attributes:
                  - Key: http.route    
                    Value: .*\/health.*    
                  - Key: http.route    
                    Value: .*\/prometheus.*    
                  - Key: operation                                                                                                                                                                         
                    Value: OperationHandler.handle
It doesn't work so far, even though the string itself
/actuator/health/**
supposed to be caught by the regex
.*\/health.*
a

Ankit Nayan

02/07/2023, 9:37 AM
cc: @Vishal Sharma
s

Srikanth Chekuri

02/07/2023, 10:34 AM
Did you add the processor to the pipeline?
g

Guillaume

02/07/2023, 2:34 PM
Yes, I got this:
pipelines:    
            traces:    
              receivers: [otlp]    
              processors: [signozspanmetrics/prometheus, batch, filter]    
              exporters: [clickhousetraces]
s

Srikanth Chekuri

02/07/2023, 2:40 PM
Looking at your screenshot again, the ``/actuator/health/**`` is not
http.route
tag value rather a operation whose filter criteria is hard coded to simply match the value
OperationHandler.handle
Also, filter first if you would like not to include it to be part of the RED metrics calculated by SigNoz that is used to show the
Services
tab.
processors: [filter, signozspanmetrics/prometheus, batch]
g

Guillaume

02/08/2023, 8:55 AM
I'll move the filter as you showed. But I'm not sure to understand the meaning of your previous message: it is not
http.route
? But the right sidebar with more details about this trace seems to indicate it is
a

Ankit Nayan

02/08/2023, 9:52 AM
@Guillaume I get the confusion. The screenshot attached has operation name as
/actuator/health/**
. I marked it in the image in orange. But the screenshot you shared now, has it in
http.route
attribute key
so it has to be included at
- Key: operation
also in the filter processor
g

Guillaume

02/08/2023, 12:58 PM
Indeed, it's confusing me 😅 Ok so do you mean like this?
filter:             
            spans:            
              exclude:        
                match_type: regexp      
                attributes:    
                  - Key: http.route     
                    Value: .*\/health.*
                  - Key: operation      
                  - Key: .*\/health.*
a

Ankit Nayan

02/08/2023, 1:06 PM
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#filter-spans-from-traces
filter:             
            spans:            
              exclude:        
                match_type: regexp
                span_names:
                  - .*\/health.*
                attributes:    
                  - Key: http.route     
                    Value: .*\/health.*
as
operation
is not attribute but
name
of span
g

Guillaume

02/08/2023, 1:28 PM
Oh, right, then my last filter is also wrong:
- Key: operation
                    Value: OperationHandler.handle
should be this in the end:
filter:             
            spans:            
              exclude:        
                match_type: regexp
                span_names:
                  - .*\/health.*
                  - OperationHandler.handle
                attributes:    
                  - Key: http.route     
                    Value: .*\/health.*
a

Ankit Nayan

02/08/2023, 1:29 PM
yes.. I think so
@Guillaume did it work?
g

Guillaume

02/15/2023, 10:18 AM
Hi, sorry for the delay. After setting it up, I could still notice data, through the frontend, with the same pattern as I showed. So I think it did not work this way unfortunately