Supported Data Types
📘 LogsOverview
The Logs to Metrics processor generates metrics from log events that match your conditions.How it works (conceptually)
- Match: optionally restrict which logs participate using conditions.
- Map: define the metric name/type and where the numeric value comes from.
- Label: choose which attributes/fields should become metric labels.
- Export: select the metrics destination to receive the generated metrics.
Configuration Components
1. Name
- Description: A descriptive name to help you identify this processor in your pipeline.
2. Conditions (optional)
- Description: Limit which log events generate metrics.
- How to use: Add one or more conditions and choose whether to match all (AND) or match any (OR).
3. Metric Mapping
- Metric Name: The metric to produce (for example,
http_requests_total,login_failures_total). - Metric Type: Currently Counter.
- Unit (optional): A unit string such as
ms,s,bytes,MB. - Description (optional): A human-readable description of what the metric represents.
4. Value Source
Choose where the numeric value for the counter increment comes from:- Fixed Value: Always increment by the same number (commonly
1for counting events). - From Attribute: Increment by a numeric value taken from a log attribute.
5. Labels
Labels are taken from selected log attributes under From Log Attributes and attached to each emitted metric datapoint (for example,service, env, status_code).
6. Metrics Destination
Choose where the generated metrics are sent. Only destinations that support metrics will be selectable7. Post-Processing
- Drop original logs after extracting metrics: If enabled, logs will not continue past this point in the pipeline after metrics are generated.
In case you need to extract from values from a string — to be used for Log selection condition or you need parts of the string to pass as labels, use the **Parse Log processor **before the Log-to-metric processor to extract the needed fields to a specific attribute. Then use in condition and pass as labels