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

Report number of services per namespace and type #2247

Merged
merged 2 commits into from
Oct 5, 2018
Merged

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Sep 17, 2018

What does this PR do?

Add a kubernetes_state.service.count gauge, tagged by namespace, type and service name, to monitor the number of services in a cluster.

Instead of sending one gauge per service, the same strategy as persistentvolumes.by_phase is used: count by relevant tags. The PV code has been refactored in a generic count_objects_by_tags method to do that.

Other object types could benefit from this generic client-side counting logic, to reduce the number of gauges the check sends

Review checklist

  • PR has a meaningful title or PR has the no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo

Additional Notes

Anything else we should know when reviewing?

@codecov-io
Copy link

codecov-io commented Sep 17, 2018

Codecov Report

Merging #2247 into master will decrease coverage by 3.12%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2247      +/-   ##
==========================================
- Coverage   85.83%   82.71%   -3.13%     
==========================================
  Files         189        4     -185     
  Lines       12646      376   -12270     
  Branches     1325       72    -1253     
==========================================
- Hits        10855      311   -10544     
+ Misses       1408       44    -1364     
+ Partials      383       21     -362

gzussa
gzussa previously approved these changes Sep 17, 2018
Copy link
Contributor

@gzussa gzussa left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mfpierre mfpierre left a comment

Choose a reason for hiding this comment

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

Nice use of metric transformers 👍

@xvello xvello merged commit 1ef4c6b into master Oct 5, 2018
@xvello xvello deleted the xvello/ksm-services branch October 5, 2018 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants