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

Cherry-pick #19699 to 7.x: Fix k8s scheduler compatibility issue #19723

Merged
merged 1 commit into from
Jul 8, 2020

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jul 8, 2020

Cherry-pick of PR #19699 to 7.x branch. Original message:

What does this PR do?

This PR introduces OpSetSuffix in order to solve a compatibility issue in Kubernetes Scheduler metricset.
In older version of k8s the Prometheus metric scheduler_pod_preemption_victims was a Gauge but recently they changed it
to a Histogram. Until now we have been mapping this Gauge metric to scheduling.pod.preemption.victims.count field. This makes it impossible for the module to parse Prometheus metrics from newer versions of Scheduler where this filed is a Histogram. With this PR OpSetSuffix can try to check if the value of this metric is numeric and extend it with counter suffix otherwise it is of Histogram type and we do nothing. This makes scheduling.pod.preemption.victims.count filed to be actually numeric in all cases since Histograms create this filed by default and when it is a Gauge we leverage the OpSetSuffix to do the mapping appropriately.

Why is it important?

In order to preserve compatibility with old and new versions of Prometheus metrics exported by Kubernetes Scheduler.

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.

Related issues

@ChrsMark ChrsMark added [zube]: In Review backport Team:Platforms Label for the Integrations - Platforms team labels Jul 8, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2020
@ChrsMark ChrsMark self-assigned this Jul 8, 2020
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19723 opened]

  • Start Time: 2020-07-08T07:09:44.041+0000

  • Duration: 77 min 30 sec

Test stats 🧪

Test Results
Failed 0
Passed 2972
Skipped 685
Total 3657

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@ChrsMark ChrsMark merged commit c887fab into elastic:7.x Jul 8, 2020
@zube zube bot removed the [zube]: Done label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants