promql-cli

command module
v0.0.0-...-f812fb1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

promql-cli

Interactive CLI to run PromQL.

Install

$ go install github.com/yfuruyama/promql-cli@latest

Usage

$ promql-cli -h
  -headers string
    	Additional request headers (comma separated) for Query API
  -project string
    	Google Cloud Project ID for Cloud Monitoring
  -url string
    	The URL for the Prometheus server (default "http://localhost:9090")

Example

Run PromQL queries against the local Prometheus server.

$ promql-cli -url http://localhost:9090
promql> up
+-------------------------------+----------+--------------+----------------+-------+
| timestamp                     | __name__ | instance     | job            | value |
+-------------------------------+----------+--------------+----------------+-------+
| 2024-06-25T14:16:37.171+09:00 | up       | otelcol:8888 | otel-collector | 1     |
+-------------------------------+----------+--------------+----------------+-------+
1 values in result

promql> max(histogram_quantile(0.99, http_client_duration_milliseconds_bucket{job="loadgenerator"}))
+-------------------------------+-------+
| timestamp                     | value |
+-------------------------------+-------+
| 2024-06-25T14:25:22.206+09:00 | 10000 |
+-------------------------------+-------+
1 values in result

Run PromQL queries against Google Cloud Monitoring.

$ promql-cli -project ${PROJECT_ID}
promql> max(storage_googleapis_com:storage_object_count)
+-------------------------------+-------+
| timestamp                     | value |
+-------------------------------+-------+
| 2024-06-25T14:28:36.454+09:00 | 31    |
+-------------------------------+-------+
1 values in result

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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