Skip to content

Commit

Permalink
add metrics types shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
maycmlee committed Oct 4, 2024
1 parent 9fec48a commit 5c0ac5b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ disable_toc: false

{{% observability_pipelines/processors/generate_metrics %}}

##### Metrics Types

{{% observability_pipelines/metrics_types %}}

{{% observability_pipelines/processors/filter_syntax %}}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ disable_toc: false

## Overview

Some log sources, such as firewalls and network appliances, generate a large volume of log events that contain data that don't necessarily need to be stored. Often, you just want to see a summary of the logs and compare it to historical data. Use the Generate Metrics template to generate a count metric of logs that match a query or a [distribution metric][1] of a numeric value contained in the logs, such as a request duration. The template starts you off with the following processors:
Some log sources, such as firewalls and network appliances, generate a large volume of log events that contain data that don't necessarily need to be stored. Often, you just want to see a summary of the logs and compare it to historical data. Use the Generate Metrics template to generate a count metric of logs that match a query or a distribution metric of a numeric value contained in the logs, such as a request duration. The template starts you off with the following processors:

- **Filter**: Add a query to send only a subset of logs based on your conditions.
- **Grok Parser**: Parse your logs using grok parsing rules that are available for a set of sources or add custom parsing rules.
- **Generate metrics**: Generate metrics for your logs or a subset of them. The available metric types are: COUNT, GAUGE, and DISTRIBUTION.
- **Generate metrics**: Generate metrics for your logs or a subset of them. See [Metrics types](#metrics-types) for the types of metrics you can generate.

{{% observability_pipelines/use_case_images/generate_metrics %}}

[1]: /metrics/distributions/#overview
## Metrics types

{{% observability_pipelines/metrics_types %}}
10 changes: 10 additions & 0 deletions layouts/shortcodes/observability_pipelines/metrics_types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
You can generate these types of metrics for your logs. See the [Metrics Types][10031] and [Distributions][10032] documentation for more details.

| Metric type | Description | Example |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| COUNT | Represents the total number of event occurrences in one time interval. This value can be reset to zero, but cannot be decreased. | You want to count the number of logs with `status:error`. |
| GAUGE | Represents a snapshot of events in one time interval. | You want to measure the latest CPU utilization per host for all logs in the production environment. |
| DISTRIBUTION | Represent the global statistical distribution of a set of values calculated across your entire distributed infrastructure in one time interval. | You want to measure the average time it takes for an API call to be made. |

[10031]: /metrics/types/
[10032]: /metrics/distributions/
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Click **Manage Metrics** to create new metrics or edit existing metrics. This op

1. Enter a [filter query](#filter-query-syntax). Only logs that match the specified filter query are processed. All logs, regardless of whether they match the filter query, are sent to the next step in the pipeline. **Note**: Since a single processor can generate multiple metrics, you can define a different filter query for each metric.
1. Enter a name for the metric.
1. In the **Define parameters** section, select the metric type (count, gauge, or distribution). See [Metric Types][10041] for more information.
1. In the **Define parameters** section, select the metric type (count, gauge, or distribution). See [Metrics Types](#metrics-types) for more information.
- For gauge and distribution metric types, select a log field which has a numeric (or parseable numeric string) value that is used for the value of the generated metric.
- For the distribution metric type, the log field's value can be an array of (parseable) numerics, which is used for the generated metric's sample set.
1. Click **Add Metric**.

[10041]: /metrics/types/
1. Click **Add Metric**.

0 comments on commit 5c0ac5b

Please sign in to comment.