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

feat(chart): Added additional service monitor functionality #3645

Merged

Conversation

stevehipwell
Copy link
Contributor

Issue

This PR will allow manual remediation of #2897.

Description

This PR adds the ability to set the Helm chart ServiceMonitor endpoint values for scrapeTimeout, relabelings & metricRelabelings. It also fixes the jobLabel functionality (it should be a label name and not a value) and refactors the ServiceMonitor template for easier readability.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 11, 2024
@stevehipwell
Copy link
Contributor Author

@kishorj @oliviassss could you please take a look at this PR? The failing workflow looks to have been failing for a while and the fix PR (#3600) was closed.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2024
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 22, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2024
@stevehipwell
Copy link
Contributor Author

/retest

1 similar comment
@stevehipwell
Copy link
Contributor Author

/retest

@stevehipwell
Copy link
Contributor Author

@kishorj @oliviassss could you please take a look at this PR?

@@ -29,7 +25,19 @@ spec:
endpoints:
- port: metrics-server
path: /metrics
{{- with .Values.serviceMonitor.interval }}
scheme: http
Copy link
Collaborator

Choose a reason for hiding this comment

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

just for my understanding, why we specify http explicitly here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I always set the scheme so it's very clear what the intent is even for someone who's starting at the ServiceMonitor and working up through the other resources. From an implementation point of view this is something where even though the default is correct we 100% care about the value, so we should explicitly set it.

@oliviassss
Copy link
Collaborator

/retest

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.40%. Comparing base (b44633a) to head (32f83a0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3645   +/-   ##
=======================================
  Coverage   55.40%   55.40%           
=======================================
  Files         151      151           
  Lines        9144     9144           
=======================================
  Hits         5066     5066           
  Misses       3736     3736           
  Partials      342      342           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oliviassss oliviassss added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 6, 2024
@oliviassss
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oliviassss, stevehipwell

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2024
@stevehipwell
Copy link
Contributor Author

@oliviassss it looks like the dependency review job is currently failing across the board (also this PR isn't making any changes to the deps), are you planning on manually merging?

@oliviassss oliviassss merged commit f63a5bc into kubernetes-sigs:main May 7, 2024
7 of 9 checks passed
@stevehipwell stevehipwell deleted the service-monitor-endpoint branch May 8, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants