goettl79 / parides

Prometheus metrics to Panda Dataframe / CSV exporter. Mainly useful to analyze your metrics with datascience tools.

Home Page:https://goettl79.github.io/parides/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parides python-package

Parides is a simple python module/script to convert Prometheus metrics data to a pandas data frame, or a comma-separated file.

Docker (Quickstart)

Parides fetches all data from the Prometheus url provided using its defaults. The metrics are converted to a CSV file which is stored to the docker-mounted local folder $(pwd)/timeseries.

docker run \
    -v $(pwd)/timeseries:/usr/src/app/timeseries \
    -i goettl/parides \
        http://192.168.1.114:9090 "{__name__=~\".+\"}>0"

Python (Quickstart)

Same example as above, however using a python cli

pip install parides
parides http://192.168.1.114:9090 {__name__=~\".+\"}>0

Example

A Simple Plot: Extended example from above using a dataframe and matplotlib to visualize a simple timeseries (cpu metrics).

from matplotlib import pyplot
from parides.prom_conv import from_prom_to_df
df = from_prom_to_df(
    resolution="15s",
    url="http://192.168.1.114:9090",
    metrics_query="irate(node_cpu_seconds_total{instance=\"192.168.1.114:9100\"}[5m]) * 100"
)
df.plot()
pyplot.show()

python-package

ezoic increase your site revenue

About

Prometheus metrics to Panda Dataframe / CSV exporter. Mainly useful to analyze your metrics with datascience tools.

https://goettl79.github.io/parides/

License:Apache License 2.0


Languages

Language:Python 98.2%Language:Dockerfile 1.8%