Prometheus API Client in Python

Seems like we have everything in Python :)).

Image for post
Image for post
Prometheus Query Range
pip install prometheus-api-client
def print_metrics():
from prometheus_api_client import PrometheusConnect
prom = PrometheusConnect(url="", disable_ssl=True)

# Get the list of all the metrics that the Prometheus host scrapes

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
['CodeGenerator_compilationTime_count', 'CodeGenerator_compilationTime_max', 'CodeGenerator_compilationTime_mean', 'CodeGenerator_compilationTime_min', 'CodeGenerator_compilationTime_p50', 'CodeGenerator_compilationTime_p75', ....

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store