Prometheus

Prometheus API Client in Python

Seems like we have everything in Python :)).

Prometheus Query Range
pip install prometheus-api-client
def print_metrics():
from prometheus_api_client import PrometheusConnect
prom = PrometheusConnect(url="http://3.19.55.237:9090", disable_ssl=True)

# Get the list of all the metrics that the Prometheus host scrapes
print(prom.all_metrics())


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_metrics()
['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