Complimentary Gartner® Report! 'A CTO's Guide to Open-Source Software: Answering the Top 10 FAQs.'Read more

Extract Metric

Description

The Extract Metric Processor creates new metrics based on log telemetry. For logs matching a filter, the processor will extract a numerical value from a field and then create a metric with that value. The name, unit, and type of the created metric can be configured. Additionally, fields from matching logs can be preserved as metric attributes.

Supported Types

MetricsLogsTraces

Supported Agent Versions

v1.14.0+

Configuration

The configuration of an Extract Metric processor consists of a number of sub-metrics that are defined using fields described below.

FieldDescription
Metric NameThe name of the metric that will be created.
MatchThe log context the source field is located in. Options are Body, Attributes, and Resource.
Metric FieldThe name of the source field containing a numeric value that will become the new metric value.
Metric TypeThe type of metric that will be created. Options are gauge_double, gauge_int, counter_double, and counter_int.
Metric UnitThe unit of the created metric. Some default choices provided with the ability to create a custom unit.
AttributesExisting attributes on the source log that should be carried over. Can also specify new metric attributes. Each value is an OTTL path expression that extracts data from the log.

Example Configuration

In this configuration we are creating a new latency metric based on a field in the log body.

Here is the new latency metric created as a gauge_double with seconds set as the unit.

observIQ docs - Extract Metric - image 1

Now we can see the new metric in the snapshot view.

observIQ docs - Extract Metric - image 2