7 - Create an OTel Trace Handle Pipeline

If you run into any issues or have feedback on either the workshop or Pipeline, please reach out to us at support@mezmo.com.

In this step you will create a pipeline to handle OpenTelemetry Traces.

Pipeline Architecture

1 - Create the Pipeline and Add the Source

  1. In the Mezmo Web app, click New Pipeline and name it Trace Handler.
  2. In the Pipeline Map, click Add Source, then select the OpenTelemetry Trace source you created in Step 2.

2 - Add State Variables

A responsive pipeline changes its functioning based on detection of state changes. For this example, you will use the Script Execution Processor to add variables to the data that indicate the operational state of the pipeline.

  1. Click the ...menu in the upper-right corner of the OpenTelemetry Metric source.
  2. Select Add Node > Add Processor > Script Execution.
  3. Copy and paste this script into the Script field in the processor configuration panel, then click Save.
Javascript
Copy

Route Based on State

You can now set the Pipeline to route data based on operational_state with the Route Processor.

  1. In the Pipeline Map, click Add Processor.
  2. Select Route Processor, and for Title, enter State Router.
  3. You will create three routes, one for the Normal state, one for the Incident state, and one for the Deploy state. After you configure the options for the Normal state, click Add route to configure the Incident and Deploy routes.
Configuration OptionsSettiung
Route 1 TitleNormal
Route 1 Conditional Statementmessage.op_state contains normal
Route 2 TitleIncident
Route 2 Conditional Statementmessage.op_state contains incident
Route 3 TitleDeploy
Route 3 Conditional Statementmessage.op_state contains deploy

5 - Sample Traces in Normal State

For the unmatched and normal data that pass through the Router, you only need to sample a small proportion of them while the pipeline is in the normal operational state. For this example, you will add a Sample processor that will sample every 1 in 10 of the unmatched logs.

  1. In the Pipeline Map, click Add Processor, then select Sample.
  2. Enter these configuration options for the processor, then click Save.
Configuration OptionsSetting
Rate10

6 - Add the Blackhole Destination

You can send your optimized data to any of Mezmo's Supported Telemetry Data Destinations, but in this case, the route will terminate in a Blackhole destination that drops all data sent to it. This is useful for testing the data processing of your Pipeline before sending it to production destination.

  1. In the Pipeline Map, click Add Destination.
  2. Select Blackhole, and connect it to the to outgoing routes of the Route Processor as shown in the pipeline architecture schematic.

Deploy the Pipeline

To activate the Pipeline, click Deploy.

Initiate State and Grab State ID

As you did with the Log Hander Pipeline, you need to intialize the state of the Pipeline and get the State ID of the pipeline for reference in Step 8.

  1. In the Pipeline Map, click on the State setting in the upper-left corner, and change it to Incident.
  2. Change the State setting back to Normal. This will initialize the Normal state, and generate thePipeline_ID for the pipeline state-variable.
  3. In a terminal, run this command with the trace pipeline's ID and grab that State ID.
Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard