Documentation Index
Fetch the complete documentation index at: https://mezmo-9a59581a-mintlify-926f893d.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Step 1: Create a New Pipeline to Handle and Route OpenTelemetry Metrics
Create a new Mezmo Pipeline by clicking New Pipeline in the platform. Give this a name likeMetric Handler, select Create Blank Pipeline, then select Continue at the bottom.
Step 2: Add OpenTelemetry Metric Source
ClickAdd Source and select your OpenTelemetry Metric source from the Shared Sources list similar to before.
Step 3: Insert State Enrichment
As we did with the previous pipeline, we will prepare the data to take advantage of Responsive Pipelines in the future by enriching each metric with the current pipelines operational state. Click thethree dots on your Otel Metric Source and select Add Node->Add Processor->Script Execution.
Paste in the following Javascript and click Save. Note that the script does a bit more than add the operational_state state variable by tagging this data in-flight.
Step 4: Route Based on State
After the initial Enrichment processor, let’s route the data flow based on thatoperational_state. Connect a Route processor to the Enrichment Script with the following configuration:
- Title:
State Router - Route 1:
- Title:
Normal - Criteria:
message.op_statecontainsnormal - Route 2:
- Title:
Incident - Criteria:
message.op_statecontainsincident - Route 3:
- Title:
Deploy - Criteria:
message.op_statecontainsdeploy
Step 5: Normalize and Aggregate in Normal State
A common approach to reduce Metric data volumes is to aggregate those metrics and reduce their cardinality. Mezmo makes this incredibly easy with intuitive processors. We will implement a 5 min aggregation on all incoming metrics and trim off the tags being used. Connected to yourNormal and Unmatched outputs from the State Router, add a Script Execution processor with the following script:
host_id tag to 10 by connecting a Tag Cardinality Limit processor with the following configuration:
- Tags:
message.tags.host_id - Action:
drop_tag - Value Limit:
10 - Mode:
Probablistic
Aggregate processor. Leave the default configuration, only changing the following:
- Interval (seconds):
300
Step 6: Sending Data Downstream Systems
Now, connect all outputs to a Blackhole destination. This is simply a placeholder for any Observability system you’d like. Explore our destinations in-app or in our docs to easily send telemetry data downstream into tools, data lakes and more. You should have a pipeline that looks like the following.
Step 7: Deploy
Finally, you must deploy your pipeline in order to start taking advantage of your metric optimizations.Step 8: Initiate State and Grab State ID
Same as with the Logs, let’s initiate the State and save theState ID of this pipeline for later.
First, flip the State in the UX from Normal to Incident and back to Normal to initialize.
Then, in your terminal window, run the following command with the metric pipeline's ID and grab that State ID.