6. Routing Data
6.2 Configuring the Pipelines
Exercise
Update the original traces pipeline to use routing:
To enable
routing, update the originaltracespipeline to useroutingas the only exporter. This ensures all span data is sent through the Routing Connector for evaluation and then onwards to connected pipelines. Also, remove all processors and replace it with an empty array ([]) as this will now behandeld in thetraces/route1-regularandtraces/route2-securitypipelines, allowing for custom behaviour for each route. Yourtraces:configuration should look like this:yamltraces: # Traces pipeline receivers: - otlp # OTLP receiver processors: [] # Processors for traces exporters: - routing
Add both the route1-regular and route2-security traces pipelines below the existing traces pipeline:
Configure Route1-regular pipeline: This pipeline will handle all spans that have no match in the routing table in the connector. Notice this uses
routingas its only receiver and will recieve data thought itsconnectionfrom the original traces pipeline.yamltraces/route1-regular: # Default pipeline for unmatched spans receivers: - routing # Receive data from the routing connector processors: - memory_limiter # Memory Limiter Processor - resource/add_mode # Adds collector mode metadata - batch exporters: - debug # Debug Exporter - file/traces/route1-regular # File Exporter for unmatched spansAdd the route2-security pipeline: This pipeline processes all spans that do match our rule
"[deployment.environment"] == "security-applications"in the the routing rule. This pipeline is also usingroutingas its receiver. Add this pipline below thetraces/route1-regularone.yamltraces/route2-security: # Default pipeline for unmatched spans receivers: - routing # Receive data from the routing connector processors: - memory_limiter # Memory Limiter Processor - resource/add_mode # Adds collector mode metadata - batch exporters: - debug # Debug exporter - file/traces/route2-security # File exporter for unmatched spans
