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

adding prometheus output #256

Merged
merged 5 commits into from
Mar 11, 2017
Merged

adding prometheus output #256

merged 5 commits into from
Mar 11, 2017

Conversation

sstarcher
Copy link
Contributor

This is an example for integrating with prometheus. Prometheus unlike statsd and others keeps state and integrates better when the objects are group smartly.

@jantman
Copy link
Owner

jantman commented Feb 8, 2017

@sstarcher The solution here is really a wrapper around awslimitchecker, not integrating Prometheus.

For the purpose of #152, the solution needs work within the awslimitchecker public API, i.e. it needs to be instantiated inside the AwsLimitChecker class.

I'd be happy to merge this as an example script in the docs/examples/ directory, if you can include full test coverage for it, make the http server port configurable, and fix the pep8/flakes errors. However, incorporation of a metrics solution needs to be something that is inside awslimitchecker itself, and can be enabled and configured via either the existing CLI interface or via arguments to the AwsLimitChecker() class, as described in my comment on 152.

Keep in mind that AwsLimitChecker is only capable of checking one region at a time. Looking at the example code here, if we could simply run prometheus during each individual run (one region), I do feel that this could fit within the current AwsLimitChecker paradigm. We'd simply need to instantiate the metrics service class before doing anything else (this would start the prometheus server, and do whatever other setup is needed) and then have the metrics service class expose methods like before_find_usage(), find_usage_finished(limits), etc.

If we're adding metrics support to awslimitchecker, at a minimum, I'd like it to be something that will work with statsd and DataDog. I think that a generic solution with a class that's instantiated before any usage/limits are checked, and then has methods that are called at various points in the process, should suffice for most use cases that I'm aware of.

@sstarcher
Copy link
Contributor Author

Yep just giving an example. I don't have time to dig into the code and determine the best way to implement it inside of awslimitchecker.

@sstarcher
Copy link
Contributor Author

adding config, moved to examples, linted

@codecov-io
Copy link

codecov-io commented Feb 15, 2017

Codecov Report

Merging #256 into develop will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           develop   #256   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           23     22    -1     
  Lines         1696   1648   -48     
  Branches       262    254    -8     
======================================
- Hits          1696   1648   -48
Impacted Files Coverage Δ
awslimitchecker/checker.py 100% <0%> (ø)
awslimitchecker/services/ec2.py 100% <0%> (ø)
awslimitchecker/services/init.py 100% <0%> (ø)
awslimitchecker/services/redshift.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c74a25...66d3720. Read the comment docs.

@jantman jantman changed the base branch from master to develop March 11, 2017 18:20
@jantman
Copy link
Owner

jantman commented Mar 11, 2017

Updated with develop branch; merging now. Thank you for the contribution!

@jantman jantman merged commit 998ce1a into jantman:develop Mar 11, 2017
jantman added a commit that referenced this pull request Mar 11, 2017
@jantman
Copy link
Owner

jantman commented Mar 11, 2017

This was just released in 0.8.0, which is now live on PyPI. Apologies for the long delay before this release.

@jantman jantman mentioned this pull request Aug 28, 2019
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.

3 participants