From 8edd92d6318a7901aee0e58cd19f485e5bb8a078 Mon Sep 17 00:00:00 2001 From: mjimenezp Date: Thu, 1 Feb 2024 20:30:05 -0600 Subject: [PATCH] added readme for prometheus loader --- llama_hub/prometheus/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 llama_hub/prometheus/README.md diff --git a/llama_hub/prometheus/README.md b/llama_hub/prometheus/README.md new file mode 100644 index 0000000000..0ee546fe4b --- /dev/null +++ b/llama_hub/prometheus/README.md @@ -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 = "" +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) +```