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:
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.Add 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.
Validate the agent configuration using otelbin.io. For reference, the traces: section of your pipelines will look similar to this:
%%{init:{"fontFamily":"monospace"}}%%
graph LR
%% Nodes
REC1( otlp <br>fa:fa-download):::receiver
PRO1(memory_limiter<br>fa:fa-microchip):::processor
PRO2(memory_limiter<br>fa:fa-microchip):::processor
PRO3(resource<br>fa:fa-microchip<br>add_mode):::processor
PRO4(resource<br>fa:fa-microchip<br>add_mode):::processor
PRO5(batch<br>fa:fa-microchip):::processor
PRO6(batch<br>fa:fa-microchip):::processor
EXP1(  debug  <br>fa:fa-upload):::exporter
EXP2(  file  <br>fa:fa-upload<br>traces):::exporter
EXP3(  debug  <br>fa:fa-upload):::exporter
EXP4(  file  <br>fa:fa-upload<br>traces):::exporter
ROUTE1( routing <br>fa:fa-route):::con-export
ROUTE2( routing <br>fa:fa-route):::con-receive
ROUTE3( routing <br>fa:fa-route):::con-receive
%% Links
subID1:::sub-traces
subID2:::sub-traces
subID3:::sub-traces
subgraph " "
direction LR
subgraph subID1[**Traces**]
REC1 --> ROUTE1
end
subgraph subID2[**Traces/route2-security**]
ROUTE1 --> ROUTE2
ROUTE2 --> PRO1
PRO1 --> PRO3
PRO3 --> PRO5
PRO5 --> EXP1
PRO5 --> EXP2
end
subgraph subID3[**Traces/route1-regular**]
ROUTE1 --> ROUTE3
ROUTE3 --> PRO2
PRO2 --> PRO4
PRO4 --> PRO6
PRO6 --> EXP3
PRO6 --> EXP4
end
end
classDef receiver,exporter fill:#8b5cf6,stroke:#333,stroke-width:1px,color:#fff;
classDef processor fill:#6366f1,stroke:#333,stroke-width:1px,color:#fff;
classDef con-receive,con-export fill:#45c175,stroke:#333,stroke-width:1px,color:#fff;
classDef sub-traces stroke:#fbbf24,stroke-width:1px, color:#fbbf24,stroke-dasharray: 3 3;