https://github.com/ylz-at/prometheus-charts
Visualize Prometheus queries in image format.
https://github.com/ylz-at/prometheus-charts
prometheus-client prometheus-monitoring-solution
Last synced: 5 months ago
JSON representation
Visualize Prometheus queries in image format.
- Host: GitHub
- URL: https://github.com/ylz-at/prometheus-charts
- Owner: ylz-at
- License: mit
- Created: 2021-09-25T13:02:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-01-06T04:04:22.000Z (5 months ago)
- Last Synced: 2026-01-08T21:31:54.651Z (5 months ago)
- Topics: prometheus-client, prometheus-monitoring-solution
- Language: Go
- Homepage:
- Size: 236 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prometheus Charts [](https://github.com/ylz-at/prometheus-charts/actions/workflows/go.yml) [](https://app.fossa.com/projects/git%2Bgithub.com%2Fylz-at%2Fprometheus-charts?ref=badge_shield)
`prometheus-charts` is used for plotting the metrics in prometheus to images.
### Install
- With Go:
```shell script
$ go get -u github.com/ylz-at/prometheus-charts
```
- From Source:
```shell script
$ go build -o bin/grafana-plot cmd/grafana-plot/main.go
$ go build -o bin/prometheus-plot cmd/prometheus-plot/main.go
```
### Usage
```shell script
$ go run cmd/prometheus-plot/main.go --help
Usage of prometheus-plot:
-addr string
Prometheus address (default "http://127.0.0.1:9090")
-format string
Output format (default "png")
-offset value
Query time offset (default 1h0m0s)
-output string
Output file
-query string
Query
-step value
Query step (default 15s)
-t value
Query point time (default Sat Aug 8 17:26:29 CST 2020)
-title string
Metric title (default "Metric")
```
### Example
- start prometheus
```shell script
$ docker run --rm -d --name prometheus -p 9090:9090 prometheus/prometheus
```
- run this program
```shell script
$ go run cmd/prometheus-plot/main.go -query go_memstats_frees_total
```
- check the output
```shell script
$ ls Metric.png
Metric.png
```

## License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fylz-at%2Fprometheus-charts?ref=badge_large)