Skip to main content

Pandas integration for Prometheus

Reason this release was yanked:

Package upload issue

Project description

Prometheus Pandas

Python library for querying Prometheus and accessing the results as Pandas data structures.

This is mostly intended for use in Jupyter notebooks. See Prometheus.ipynb for an example.

Example

Evaluate an instant query at a single point in time:

>>> from prometheus_pandas import query
>>>
>>> p = query.Prometheus('http://localhost:9090')
>>> p.query('node_cpu_seconds_total{mode="system"}', '2020-05-10T00:00:00Z')
node_cpu_seconds_total{cpu="0",instance="localhost:9100",job="node",mode="system"}    15706.47
node_cpu_seconds_total{cpu="1",instance="localhost:9100",job="node",mode="system"}    15133.25
node_cpu_seconds_total{cpu="2",instance="localhost:9100",job="node",mode="system"}    15095.59
node_cpu_seconds_total{cpu="3",instance="localhost:9100",job="node",mode="system"}    14649.20
dtype: float64

Evaluates an expression query over a time range:

>>> from prometheus_pandas import query
>>>
>>> p = query.Prometheus('http://localhost:9090')
>>> print(p.query_range(
        'sum(rate(node_cpu_seconds_total{mode=~"system|user"}[1m])) by (mode)',
        '2020-10-05T00:00:00Z', '2020-10-05T06:00:00Z', '1h'))
dtype: float64
---
                     {mode="system"}  {mode="user"}
2020-10-05 00:00:00         0.022667       0.038222
2020-10-05 01:00:00         0.015333       0.036667
2020-10-05 02:00:00         0.028000       0.040667
2020-10-05 03:00:00         0.015111       0.034889
2020-10-05 04:00:00         0.015556       0.038000
2020-10-05 05:00:00         0.018444       0.040222
2020-10-05 06:00:00         0.018222       0.035111

Installation

Latest release via pip:

pip install prometheus-pandas [--user]

via Git:

git clone https://github.com/dcoles/prometheus-pandas.git; cd prometheus-pandas
python3 setup.py install [--user]

Licence

Licenced under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prometheus-pandas-0.1.1.linux-x86_64.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prometheus_pandas-0.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file prometheus-pandas-0.1.1.linux-x86_64.tar.gz.

File metadata

  • Download URL: prometheus-pandas-0.1.1.linux-x86_64.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for prometheus-pandas-0.1.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 e8ed4b74e6c0704c579efb9891dc4c5dfc09f25ab1cf787293d6730211261dbe
MD5 439b39fe875eb5fe020fbb5d96127b4d
BLAKE2b-256 82c57fa5e38735982a6e456a19b6f8f28a5886349b97591c94dea49dfaa6c034

See more details on using hashes here.

File details

Details for the file prometheus_pandas-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: prometheus_pandas-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for prometheus_pandas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 779902da8088fac487193993b7c6cda02a93fc8ca6154b6e00e88bc9cb98cb9d
MD5 57f594491d1452a804e3a5bef697452b
BLAKE2b-256 83bc1c0a665b3a3a7de0e765d19b91ad6479b1107912de6a7d5a2d978a9fb998

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page