Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandipb/gcp-prom-query
CLI to query Google's managed prometheus API. Basically promtool with JWT support.
https://github.com/sandipb/gcp-prom-query
Last synced: about 6 hours ago
JSON representation
CLI to query Google's managed prometheus API. Basically promtool with JWT support.
- Host: GitHub
- URL: https://github.com/sandipb/gcp-prom-query
- Owner: sandipb
- License: apache-2.0
- Created: 2022-06-22T15:39:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-23T09:48:27.000Z (over 2 years ago)
- Last Synced: 2024-06-21T13:05:28.482Z (5 months ago)
- Language: Go
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gcp-prom-query - Query GCP Prometheus API
## Usage
```shell-session
$ ./gcp-prom-query -h
usage: gcp-prom-query [] [ ...]Runs query on the gcp prometheus api
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
-v, --version Show version
-d, --debug Debug level logging
-t, --timeout=10 Timeout in seconds for the query
-u, --prom-api="localhost:9090"
URL to API server. Used when gcp-project is not provided.
-p, --gcp-project=GCP-PROJECT Name of the GCP project. If not given, uses 'prom-api'
-a, --gcp-token=GCP-TOKEN Name of the GCP project. Required if project is given. Can also be provided via env var GCP_ACCESS_TOKENCommands:
help [...]
Show help.instant []
Instant query$ ./gcp-prom-query instant -h
usage: gcp-prom-query instant []Instant query
Flags:
...
--now=NOW Time to run instant query as Unix epoch timeArgs:
Promql query
```## Sample output
```shell-session
$ ./gcp-prom-query -p some-gcp-project instant 'sum by(job)(scrape_samples_scraped)'
+--------------------+-------+------------+
| METRIC | VALUE | TIMESTAMP |
+--------------------+-------+------------+
| {job="prometheus"} | 446.0 | 1655917668 |
+--------------------+-------+------------+
```