prometheus-charts

module
v0.0.0-...-b5e4fe0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: MIT

README

Prometheus Charts Golang CI FOSSA Status

prometheus-charts is used for plotting the metrics in prometheus to images.

Install
  • With Go:
$ go get -u github.com/ylz-at/prometheus-charts
  • From Source:
$ go build -o bin/grafana-plot cmd/grafana-plot/main.go
$ go build -o bin/prometheus-plot cmd/prometheus-plot/main.go
Usage
$ 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
$ docker run --rm -d --name prometheus -p 9090:9090 prometheus/prometheus
  • run this program
$ go run cmd/prometheus-plot/main.go -query go_memstats_frees_total
  • check the output
$ ls Metric.png
Metric.png

Output

License

FOSSA Status

Directories

Path Synopsis
cmd
pkg
flags
Package flags defines flag types that can be used with the default flag package.
Package flags defines flag types that can be used with the default flag package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL