Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
added readme for prometheus loader
Browse files Browse the repository at this point in the history
  • Loading branch information
mjimenezp committed Feb 2, 2024
1 parent aa80972 commit 8edd92d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions llama_hub/prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Prometheus Loader

This loader loads metrics from Prometheus. The user specifies a Prometheus instance to initialize the reader. They then specify the query, the date range, steps, Http parameters and which fields must be used as metadata.

Automatically adds to the metadata the timestamp value and create a document per value returned by the prometheus query.

## Usage

Here's an example usage of the PrometheusReader.

```python
from llama_index import download_loader
import os

PrometheusReader = download_loader('PrometheusReader')

endpoint = "<endpoint>"
size = "<size>"
# query_dict is passed into db.collection.find()
query = ""
end_time = datetime.utcnow()
start_time = end_time - timedelta(hours=1)
metadata_fields = ['id', "host"]
reader = PrometheusReader(endpoint, size)
documents = reader.load_data(query=query,
start_time=start_time,
end_time=end_time,
step="1m",
get_pararameters=None,
metadata_fields=metadata_fields)
```

0 comments on commit 8edd92d

Please sign in to comment.