3.2 Test Filter Processor
To test your configuration, you’ll need to generate some trace data that includes a span named "/_healthz".
Exercise
Start the Gateway: In your Gateway terminal window start the Gateway.
Start the Agent: In your Agent terminal window start the Agent.
Start the Loadgen: In the Loadgen terminal window, execute the following command to start the load generator with health check spans enabled:
The debug output in the Agent terminal will show _healthz spans:
They will not be present in the Gateway debug as they are dropped by the filter processor that was configured earlier.
Verify agent.out: Using jq, in the Test terminal, confirm the name of the spans received by the Agent:
Check the Gateway Debug output: Using jq confirm the name of the spans received by the Gateway:
The gateway-metrics.out file will not contain any spans named /_healthz.
Tip
To ensure optimal performance with the Filter processor, thoroughly understand your incoming data format and rigorously test your configuration. Use the most specific filtering criteria possible to minimize the risk of inadvertently dropping important data.
This configuration can be extended to filter spans based on various attributes, tags, or custom criteria, enhancing the OpenTelemetry Collector’s flexibility and efficiency for your specific observability requirements.
Important
Stop the Agent and the Gateway processes by pressing Ctrl-C in their respective terminals.