garf for Prometheus HTTP API
garf-prometheus simplifies fetching data from Prometheus HTTP API using SQL-like queries.
Prerequisites
- Running Prometheus instance
Installation
pip install garf-prometheus
Usage
Run as a library
import os
from garf.io import writer
from garf.community.prometheus import PrometheusApiReportFetcher
query = """
SELECT
timestamp,
instance,
job,
value
FROM query
WHERE query = up
"""
fetched_report = (
PrometheusApiReportFetcher(
endpoint='http://localhost:9090'
)
.fetch(query)
)
console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'query')
Run via CLI
Install
garf-executorspackage to run queries via CLI (pip install garf-executors).
garf <PATH_TO_QUERIES> --source prometheus \
--output <OUTPUT_TYPE> \
--prometheus.endpoint=http://localhost:9090
where:
PATH_TO_QUERIES- local or remove files containing queriesoutput- output supported bygarf-iolibrary.SOURCE_PARAMETER=VALUE- key-value pairs to refine fetching, check available source parameters.
Available source parameters
| name | values | comments |
|---|---|---|
endpoint |
Base URL when Prometheus is running (http://localhost:9090 by default) |
Documentation
You can find a documentation on garf-prometheus here.
Metadata
Release files for garf-prometheus 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| garf_prometheus-0.0.2.tar.gz | 4.3 kB | Without provenance | Details for garf_prometheus-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| garf_prometheus-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for garf_prometheus-0.0.2-py3-none-any.whl |
Total release size: 11.7 kB
Release files / garf_prometheus-0.0.2.tar.gz
| Download URL | garf_prometheus-0.0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3305a0e7a7f96a49efc1bcf7f408b1aeaae691eb8da0ebf06f0b8fdb07f7f696
|
|
BLAKE2b-256 checksum How to use checksums |
d5c349f5572ef4f3203bfcfcbb263b1678090b06f35a8142dc4e2c337b4b1ccb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|
Release files / garf_prometheus-0.0.2-py3-none-any.whl
| Download URL | garf_prometheus-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9119b592277178f378af391e95cebd3615f6d0f169455f55c746b9bc1b297de2
|
|
BLAKE2b-256 checksum How to use checksums |
2903708bafd914d3ebe9f22d7cd41b7d3d83ef970123e903cec583ca6223bf5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|
Security for garf-prometheus 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.