From 510ed990169eb98e21305c6c99fb3ea378f3fa1f Mon Sep 17 00:00:00 2001 From: sami Date: Fri, 3 Nov 2023 18:57:01 +0100 Subject: [PATCH] fix readme.md --- README.md | 133 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 91 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 5ed6514..b833bac 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,141 @@ -# Prometheus to CSV Exporter + +# Prometheus 2 CSV Exporter + + This is a Go application that exports data from Prometheus as a CSV file and optionally uploads it to an AWS S3 bucket. This README will guide you through setting up and running the application. + + ## Table of Contents + + +- [Table of Contents](#table-of-contents) - [Prerequisites](#prerequisites) +- [Demo](#demo) - [Installation](#installation) -- [Usage](#usage) -- [Options](#options) +- [Build](#build) - [Examples](#examples) - [Contributing](#contributing) -- [License](#license) -## Demo -[![asciicast](https://asciinema.org/a/dnnGv3ZYarAeXER37uYTKYdZt.png)](https://asciinema.org/a/dnnGv3ZYarAeXER37uYTKYdZt) -Tested on Ubuntu 22.04 and Golang 1.18, 1.21 + + + ## Prerequisites + + Before using this exporter, you should have the following prerequisites installed and configured: -- Go (Golang): Make sure you have Go installed on your system. You can download and install Go from the [official Go website](https://golang.org/doc/install). -- AWS CLI: If you plan to upload the CSV file to an AWS S3 bucket, make sure you have the AWS CLI installed and configured with the appropriate credentials. You can install the AWS CLI and configure it using the `aws configure` command. -- Prometheus: You should have access to a Prometheus server with a valid address to query data. + +- Go (tested with Golang 1.21.1): Make sure you have Go installed on your system, you can download and install Go from the [official Go website](https://golang.org/doc/install). + +- AWS S3 bucket (Optional): If you plan to upload the CSV file to an AWS S3 bucket, make sure you have the AWS credentials configured, the Go script will automatically load the default AWS credentials or take them from enviroment variables `AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID` + +- Prometheus: You must have access to a Prometheus server with a valid address to query data. + + +## Demo + +Tested on Ubuntu 22.04 and Golang 1.18, 1.21 + +[![asciicast](https://asciinema.org/a/dnnGv3ZYarAeXER37uYTKYdZt.png)](https://asciinema.org/a/dnnGv3ZYarAeXER37uYTKYdZt) + + ## Installation + + 1. Clone this repository to your local machine: -```shell -git clone https://github.com/yourusername/prometheus-to-csv-exporter.git + +`git clone https://github.com/fnzv/p2c.git` - Change your working directory to the project folder: + -shell +Change your working directory to the project folder: -cd prometheus-to-csv-exporter + - Build the Go application: +`cd p2c/` -shell +## Build -go build exporter.go + +`go build p2c.go` + The exporter binary will be created in the project folder. -Usage + +`./p2c` + You can run the Prometheus to CSV exporter using the following command: -shell + -./exporter --query --time-range