Skip to content

Add a period parameter to the counter cache in remote write #9424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/prometheus/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Prometheus Integration

This integration can collect metrics from:
- [Prometheus Exporters (Collectors)](#prometheus-exporters-collectors)
- [Prometheus Server Remote-Write](#prometheus-server-remote-write)
- [Prometheus Queries (PromQL)](#prometheus-queries-promql)
- [Prometheus Exporters (Collectors)](#prometheus-exporters-collectors)
- [Prometheus Server Remote-Write](#prometheus-server-remote-write)
- [Prometheus Queries (PromQL)](#prometheus-queries-promql)

## Metrics

Expand Down Expand Up @@ -241,6 +241,10 @@ types, including {{ url "elasticsearch-histograms" "histograms" }}.
the counter increment since the last collection. This metric should make some aggregations easier and with better
performance. This parameter can only be enabled in combination with `use_types`.

`period` parameter (default: 60s) configures the timeout of internal cache, which stores counter values in order to calculate rates between consecutive fetches. The parameter will be validated and all values lower than 60sec will be reset to the default value.

Note that by default prometheus pushes data with the interval of 60s (in remote write). In case that prometheus push rate is changed, the `period` parameter needs to be configured accordingly.

When `use_types` and `rate_counters` are enabled, metrics are stored like this:

```json
Expand Down
5 changes: 5 additions & 0 deletions packages/prometheus/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.15.1"
changes:
- description: Add a "period" parameter to the counter cache.
type: bugfix
link: https://github.com/elastic/integrations/pull/9424
- version: "1.15.0"
changes:
- description: Enable secrets for sensitive fields. For more details, refer https://www.elastic.co/guide/en/fleet/current/agent-policy.html#agent-policy-secret-values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ssl.certificate_authorities:
- {{this}}
{{/each}}
{{/if}}
period: {{period}}
rate_counters: {{rate_counters}}
use_types: {{use_types}}
types_patterns.exclude:
Expand Down
8 changes: 8 additions & 0 deletions packages/prometheus/data_stream/remote_write/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ streams:
multi: true
required: false
show_user: false
- name: period
type: text
title: Period
description: This is the timeout period for the counter cache, which is used to calculate counter rates.
multi: false
required: true
show_user: false
default: 1m
- name: rate_counters
type: bool
title: Rate Counters
Expand Down
10 changes: 7 additions & 3 deletions packages/prometheus/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Prometheus Integration

This integration can collect metrics from:
- [Prometheus Exporters (Collectors)](#prometheus-exporters-collectors)
- [Prometheus Server Remote-Write](#prometheus-server-remote-write)
- [Prometheus Queries (PromQL)](#prometheus-queries-promql)
- [Prometheus Exporters (Collectors)](#prometheus-exporters-collectors)
- [Prometheus Server Remote-Write](#prometheus-server-remote-write)
- [Prometheus Queries (PromQL)](#prometheus-queries-promql)

## Metrics

Expand Down Expand Up @@ -453,6 +453,10 @@ types, including [histograms](https://www.elastic.co/guide/en/elasticsearch/refe
the counter increment since the last collection. This metric should make some aggregations easier and with better
performance. This parameter can only be enabled in combination with `use_types`.

`period` parameter (default: 60s) configures the timeout of internal cache, which stores counter values in order to calculate rates between consecutive fetches. The parameter will be validated and all values lower than 60sec will be reset to the default value.

Note that by default prometheus pushes data with the interval of 60s (in remote write). In case that prometheus push rate is changed, the `period` parameter needs to be configured accordingly.

When `use_types` and `rate_counters` are enabled, metrics are stored like this:

```json
Expand Down
2 changes: 1 addition & 1 deletion packages/prometheus/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 2.10.0
name: prometheus
title: Prometheus
version: 1.15.0
version: 1.15.1
description: Collect metrics from Prometheus servers with Elastic Agent.
type: integration
categories:
Expand Down