From cc429a594e49c0d114d4cd6e1e78e1ccd14bb21b Mon Sep 17 00:00:00 2001 From: Richard Treu Date: Tue, 20 Aug 2024 20:00:56 +0200 Subject: [PATCH 1/4] filter_log_to_metrics: Add interval options for metric emission Signed-off-by: Richard Treu --- pipeline/filters/log_to_metrics.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipeline/filters/log_to_metrics.md b/pipeline/filters/log_to_metrics.md index 6e1630fbf..0cd211596 100644 --- a/pipeline/filters/log_to_metrics.md +++ b/pipeline/filters/log_to_metrics.md @@ -28,6 +28,8 @@ The plugin supports the following configuration parameters: | kubernetes_mode | If enabled, it will automatically put pod_id, pod_name, namespace_name, docker_id and container_name into the metric as labels. This option is intended to be used in combination with the [kubernetes](./kubernetes.md) filter plugin, which fills those fields. | | | Regex | Include records in which the content of KEY matches the regular expression. | | KEY REGEX | Exclude | Exclude records in which the content of KEY matches the regular expression. | | KEY REGEX +| Interval\_Sec | Defines interval in seconds for metrics emission. Default value is _0_. If Interval\_Sec and Interval\_Nsec are not set or both have value _0_, metrics are emitted immediately into the pipeline for every filter match. Otherwise new metric updates will only be emitted into the pipeline in the defined interval. Setting an interval can lower the resource consumption in high load situations. | +| Interval\_Nsec | Nanoseconds interval for metrics emission. It works in conjunction with the Interval\_Sec configuration key. Default value is _0_. | ## Getting Started @@ -209,4 +211,4 @@ As you can see in the output, there are per default the buckets `0.005, 0.01, 0. Please note, that the `+Inf` bucket will always be included implicitly. The buckets in a histogram are cumulative, so a value added to one bucket will add to all larger buckets, too. -You can also see, that all the kubernetes labels have been attached to the metric, idential to the behavior of `label_field` described in [the previous chapter](#metric-label_values). That results in two sets for the histogram. \ No newline at end of file +You can also see, that all the kubernetes labels have been attached to the metric, idential to the behavior of `label_field` described in [the previous chapter](#metric-label_values). That results in two sets for the histogram. From 5d1fa80ff6b6d1cfaa46d29eac19c25b00e31941 Mon Sep 17 00:00:00 2001 From: Richard Treu Date: Tue, 20 Aug 2024 23:33:29 +0200 Subject: [PATCH 2/4] filter_log_to_metrics: Improve interval description Thanks @alexakreizinger Co-authored-by: Alexa Kreizinger Signed-off-by: Richard Treu --- pipeline/filters/log_to_metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/filters/log_to_metrics.md b/pipeline/filters/log_to_metrics.md index 0cd211596..9c2f60f00 100644 --- a/pipeline/filters/log_to_metrics.md +++ b/pipeline/filters/log_to_metrics.md @@ -28,8 +28,8 @@ The plugin supports the following configuration parameters: | kubernetes_mode | If enabled, it will automatically put pod_id, pod_name, namespace_name, docker_id and container_name into the metric as labels. This option is intended to be used in combination with the [kubernetes](./kubernetes.md) filter plugin, which fills those fields. | | | Regex | Include records in which the content of KEY matches the regular expression. | | KEY REGEX | Exclude | Exclude records in which the content of KEY matches the regular expression. | | KEY REGEX -| Interval\_Sec | Defines interval in seconds for metrics emission. Default value is _0_. If Interval\_Sec and Interval\_Nsec are not set or both have value _0_, metrics are emitted immediately into the pipeline for every filter match. Otherwise new metric updates will only be emitted into the pipeline in the defined interval. Setting an interval can lower the resource consumption in high load situations. | -| Interval\_Nsec | Nanoseconds interval for metrics emission. It works in conjunction with the Interval\_Sec configuration key. Default value is _0_. | +| Interval\_Sec | The interval for metrics emission, in seconds. If **Interval\_Sec** and **Interval\_Nsec** are either both unset or both set to `0`, the filter emits metrics immediately after each filter match. Otherwise, if either parameter is set to a non-zero value, the filter emits metrics at the specified interval. Longer intervals help lower resource consumption in high-load situations. Default value: `0`. | +| Interval\_Nsec | The interval for metrics emission, in nanoseconds. This parameter works in conjunction with **Interval\_Sec**. Default value: `0`. | ## Getting Started From d379ab695095f67946b718ab71b3bd5e085ca635 Mon Sep 17 00:00:00 2001 From: Richard Treu Date: Tue, 20 Aug 2024 23:34:42 +0200 Subject: [PATCH 3/4] filter_log_to_metrics: Improve example Thanks @alexakreizinger Co-authored-by: Alexa Kreizinger Signed-off-by: Richard Treu --- pipeline/filters/log_to_metrics.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline/filters/log_to_metrics.md b/pipeline/filters/log_to_metrics.md index 9c2f60f00..a429aaf86 100644 --- a/pipeline/filters/log_to_metrics.md +++ b/pipeline/filters/log_to_metrics.md @@ -211,4 +211,5 @@ As you can see in the output, there are per default the buckets `0.005, 0.01, 0. Please note, that the `+Inf` bucket will always be included implicitly. The buckets in a histogram are cumulative, so a value added to one bucket will add to all larger buckets, too. -You can also see, that all the kubernetes labels have been attached to the metric, idential to the behavior of `label_field` described in [the previous chapter](#metric-label_values). That results in two sets for the histogram. +This filter also attaches Kubernetes labels to each metric, identical to the behavior of `label_field`. +This results in two sets for the histogram. From dfeb2df449a69d5db749d3aaebd988e60f1adba9 Mon Sep 17 00:00:00 2001 From: Richard Treu Date: Thu, 22 Aug 2024 14:24:33 +0200 Subject: [PATCH 4/4] filter_log_to_metrics: Correct parameter names Signed-off-by: Richard Treu --- pipeline/filters/log_to_metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/filters/log_to_metrics.md b/pipeline/filters/log_to_metrics.md index a429aaf86..753bb7a2d 100644 --- a/pipeline/filters/log_to_metrics.md +++ b/pipeline/filters/log_to_metrics.md @@ -28,8 +28,8 @@ The plugin supports the following configuration parameters: | kubernetes_mode | If enabled, it will automatically put pod_id, pod_name, namespace_name, docker_id and container_name into the metric as labels. This option is intended to be used in combination with the [kubernetes](./kubernetes.md) filter plugin, which fills those fields. | | | Regex | Include records in which the content of KEY matches the regular expression. | | KEY REGEX | Exclude | Exclude records in which the content of KEY matches the regular expression. | | KEY REGEX -| Interval\_Sec | The interval for metrics emission, in seconds. If **Interval\_Sec** and **Interval\_Nsec** are either both unset or both set to `0`, the filter emits metrics immediately after each filter match. Otherwise, if either parameter is set to a non-zero value, the filter emits metrics at the specified interval. Longer intervals help lower resource consumption in high-load situations. Default value: `0`. | -| Interval\_Nsec | The interval for metrics emission, in nanoseconds. This parameter works in conjunction with **Interval\_Sec**. Default value: `0`. | +| Flush\_Interval\_Sec | The interval for metrics emission, in seconds. If **Flush\_Interval\_Sec** and **Flush\_Interval\_Nsec** are either both unset or both set to `0`, the filter emits metrics immediately after each filter match. Otherwise, if either parameter is set to a non-zero value, the filter emits metrics at the specified interval. Longer intervals help lower resource consumption in high-load situations. Default value: `0`. | +| Flush\_Interval\_Nsec | The interval for metrics emission, in nanoseconds. This parameter works in conjunction with **Flush\_Interval\_Sec**. Default value: `0`. | ## Getting Started