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

[8.15](backport #41570) Metricbeat: add configurable failure threshold before reporting streams as degraded #41723

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 20, 2024

Proposed commit message

Add configurable failure threshold before reporting streams as degraded

With this change it is possible to configure a threshold for the number of consecutive errors that may happen while fetching metrics for a given stream before the stream gets marked as DEGRADED.
To configure such threshold, add a "failure_threshold": <n> to a module configuration block.
Depending on the value of <n> the threshold will be configured in different ways:

  • n == 0: status reporting for the stream has been disabled, the stream will never become DEGRADED no matter how many errors are encountered while fetching metrics
  • n==1 or failure_threshold not specified: backward compatible behavior, the stream will become DEGRADED at the first error encountered
  • n > 1: stream will become DEGRADED after at least n consecutive errors have been encountered

When a fetch operation completes without errors the consecutive errors counter is reset and the stream is set to HEALTHY.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

No disruptive user impact since not specifying the new configuration key maintains the previous behavior

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #41570 done by [Mergify](https://mergify.com).

…ms as degraded (#41570)

* Metricbeat: add configurable failure threshold before reporting streams as degraded

With this change it is possible to configure a threshold for the number of consecutive errors that may happen while fetching metrics for a given stream before the stream gets marked as DEGRADED.
To configure such threshold, add a "failure_threshold": <n> to a module configuration block.
Depending on the value of <n> the threshold will be configured in different ways:

    n == 0: status reporting for the stream has been disabled, the stream will never become DEGRADED no matter how many errors are encountered while fetching metrics
    n==1 or failure_threshold not specified: backward compatible behavior, the stream will become DEGRADED at the first error encountered
    n > 1: stream will become DEGRADED after at least n consecutive errors have been encountered

When a fetch operation completes without errors the consecutive errors counter is reset and the stream is set to HEALTHY.

(cherry picked from commit f84c05b)

# Conflicts:
#	metricbeat/mb/module/wrapper.go
@mergify mergify bot added the backport label Nov 20, 2024
@mergify mergify bot requested a review from a team as a code owner November 20, 2024 21:37
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Nov 20, 2024
@mergify mergify bot requested review from AndersonQ and khushijain21 and removed request for a team November 20, 2024 21:37
@mergify mergify bot assigned pchila Nov 20, 2024
Copy link
Contributor Author

mergify bot commented Nov 20, 2024

Cherry-pick of f84c05b has failed:

On branch mergify/bp/8.15/pr-41570
Your branch is up to date with 'origin/8.15'.

You are currently cherry-picking commit f84c05b577.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   metricbeat/mb/module/wrapper_internal_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   metricbeat/mb/module/wrapper.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 20, 2024
@botelastic
Copy link

botelastic bot commented Nov 20, 2024

This pull request doesn't have a Team:<team> label.

@pchila pchila requested review from pchila and removed request for AndersonQ and khushijain21 November 22, 2024 10:09
@pchila
Copy link
Member

pchila commented Nov 22, 2024

Closing this backport as #40565 is not on 8.15 branch

@pchila pchila closed this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant