Skip to content
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

Setting Prometheus Remote_write Period default value to 1m #38553

Merged
merged 25 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
22f93e2
Correcting period for Prometheus remote_write
gizas Mar 22, 2024
fc75d6c
Merge branch 'main' of github.com:elastic/beats
gizas Mar 22, 2024
102f805
Correcting period for Prometheus remote_write
gizas Mar 22, 2024
d905adf
Adding changelog
gizas Mar 22, 2024
f0ec4f7
Updating metricbeat.reference.yaml file
gizas Mar 22, 2024
0517a07
Update x-pack/metricbeat/metricbeat.reference.yml
gizas Mar 27, 2024
cd5056b
Update x-pack/metricbeat/module/prometheus/remote_write/data.go
gizas Mar 27, 2024
f5c20ab
Update CHANGELOG.next.asciidoc
gizas Mar 27, 2024
c0e4a0c
Merge branch 'main' into remote_write_ratefix
gizas Mar 27, 2024
89369c7
Correcting typos and referring to correct variable
gizas Mar 28, 2024
300b1f7
Fixing conflicts
gizas Mar 28, 2024
cbc2d4c
Adding default value to config period of remote_write
gizas Mar 28, 2024
0802621
Adding default value to config period of remote_write
gizas Mar 28, 2024
11831b4
Removing spaces from doc
gizas Mar 28, 2024
3fbe7c0
Merge branch 'main' into remote_write_ratefix
gizas Mar 28, 2024
4cfcf01
Moving check functions to validate inside config
gizas Mar 29, 2024
f82c624
Moving check functions to validate inside config
gizas Mar 29, 2024
0cd2e64
Merge branch 'main' into remote_write_ratefix
gizas Mar 29, 2024
d1d18f4
Updating reference file
gizas Mar 29, 2024
6ae51f8
After running make check
gizas Mar 29, 2024
689422c
Merge branch 'main' into remote_write_ratefix
gizas Apr 9, 2024
a696943
Merge branch 'main' into remote_write_ratefix
gizas Apr 10, 2024
cbf265f
Merge branch 'main' of github.com:elastic/beats into remote_write_rat…
gizas Apr 10, 2024
b1b674a
Merge branch 'remote_write_ratefix' of github.com:elastic/beats into …
gizas Apr 10, 2024
d709ca0
Merge branch 'main' into remote_write_ratefix
gizas Apr 10, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
*Heartbeat*

*Metricbeat*

- Setting period for counter cache for Prometheus remote_write at least to 60sec {pull}38553[38553]

*Osquerybeat*

Expand Down
3 changes: 3 additions & 0 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,9 @@ metricbeat.modules:
# Store counter rates instead of original cumulative counters (experimental, default: false)
#rate_counters: true

# Set timeout period for the counter cache. This cache is used to calculate the rates of counters between fetches (experimental, default: 60sec)
#period: 1m

# Define patterns for counter and histogram types so as to identify metrics' types according to these patterns
#types_patterns:
# counter_patterns: []
Expand Down
10 changes: 9 additions & 1 deletion x-pack/metricbeat/module/prometheus/remote_write/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ func remoteWriteEventsGeneratorFactory(base mb.BaseMetricSet) (remote_write.Remo
}

if config.UseTypes {

// /metricbeat/module/mb/mb.go defines default as Period: time.Second * 10,
// We are setting Period at least 60secs because of issue https://github.com/elastic/beats/issues/38458
gizas marked this conversation as resolved.
Show resolved Hide resolved
duration := base.Module().Config().Period
if time.Duration(duration.Seconds()) < 60*time.Second {
duration = 60 * time.Second
}

// use a counter cache with a timeout of 5x the period, as a safe value
// to make sure that all counters are available between fetches
counters := collector.NewCounterCache(base.Module().Config().Period * 5)
counters := collector.NewCounterCache(duration * 5)

g := remoteWriteTypedGenerator{
counterCache: counters,
Expand Down
Loading