prom_check is created to do prometheus analysis by querying prometheus api
Build and install it yourself as:
gem build
gem install prom_check-<VERSION>.gem
Build Image
docker build . -t prom_check:0.1.0
-
Using externally accessible url
Example:
docker run prom_check:0.1.0 prom_check labels -u http://demo.robustperception.io:9090
-
If need to pass localhost link of prometheus running on hostmachine
Example:
docker run --network=host prom_check:0.1.0 prom_check labels
or
docker run --network=host prom_check:0.1.0 prom_check labels -u http://localhost:9090
Other examples is applicable for docker as well or use help
flag to get options available
- Get Labels
- Review Labels (Labels, Label Name Lengths and Label Values)
Commands:
prom_check help [COMMAND] # Describe available commands or one specific command
prom_check labels # Get Labels
prom_check review_labels # Review Labels
Options:
-l, [--log-level=LOG_LEVEL] # loglevel, default info
-u, [--prom-url=PROM_URL] # prometheus_url, default http://localhost:9090
Get all labels from prometheus
Usage:
prom_check labels
Options:
-l, [--log-level=LOG_LEVEL] # loglevel, default info
-u, [--prom-url=PROM_URL] # prometheus_url, default http://localhost:9090
Get Labels
Get all labels, analyze label name lengths, label value lengths and print analysis
Usage:
prom_check review_labels
Options:
-n, [--lv-display-count=N]
# Default: 100000
-l, [--log-level=LOG_LEVEL] # loglevel, default info
-u, [--prom-url=PROM_URL] # prometheus_url, default http://localhost:9090
Review Labels
-
Without debug mode
prom_check labels -u http://demo.robustperception.io:9090
-
With debug mode
Note: Nothing specific in debug mode for this command
prom_check labels -u http://demo.robustperception.io:9090 -l debug
-
Without debug mode
prom_check review_labels -u http://demo.robustperception.io:9090
-
With debug mode
prom_check labels -u http://demo.robustperception.io:9090 -l debug
-
Display only top 20 label values by label value length (default if not passed the
-n
flag it will display all (max 100000))prom_check review_labels -n 20 -u http://demo.robustperception.io:9090
After checking out the repo, run bundle install
to install dependencies. You can also run bundle exec bin/prom_check
for an interactive prompt that will allow you to experiment.
- Print metric corresponding to large label values
- Add more features
- Add Tests
-
Bug reports and pull requests are welcome
- Fork the project on GitHub
- Clone the project
- Add changes (and tests if applicable)
- Commit and push
- Create a pull request