promclient

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

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

Go to latest
Published: Jun 23, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

README

promclient

CLI for Prometheus API

Local Installation

go get -d github.com/rejohnst/promclient/cmd
go build -o $GOPATH/bin/promclient github.com/rejohnst/promclient/cmd

Usage Summary

Print CLI version
promurl -version
Print Prometheus runtime configuration
promurl -promurl=<arg>|-promip=<arg> -command=runtime [-timeout=<# secs>] \
  [-insecure]
Print Status of Prometheus Metric Targets
promurl -promurl=<arg>|-promip=<arg> -command=targets [-active|-down] \
  [-verbose] [-timeout=<# secs>] [-insecure]

  -active
    	only display active targets

  -down
    	only display active targets that are down (implies -active)

  -job string
    	show only targets from specified job (implies -active)
Print Active Alerts
promurl -promurl=<arg>|-promip=<arg> -command=alerts \
  [-severity=<severity>] \
  [-timeout=<# secs>] [-insecure]

  -severity
    filter results by specified severity
Print Metric Metadata
promurl -promurl=<arg>|-promip=<arg> -command=metrics [-job=<arg>] [-count] \
  [-csv] [-timeout=<# secs>] [-insecure]

  -csv
    	output metric metadata as CSV

  -job string
    	show only metrics from specified job
Print Prometheus Rule Status
promurl -promurl=<arg>|-promip=<arg> -command=rules [-rule=<arg>|-group=<arg>] \
  [-timeout=<# secs>] [-insecure]

  -rule
    	show detailed info for specified rule

  -group
        show only data for specified rule group
Query the Prometheus TSDB
promurl -promurl=<arg>|-promip=<arg> -command=query -query=<arg> \
  [-len=<arg>] [-step=<arg>] [-timed] [-timeout=<# secs>] [-insecure]

  -len string
    	Length of query range

  -query string
    	PromQL query string

  -step string
    	Range resolution (default "1m")

  -timed
      Show query time
CLI options common to multiple commands:
  -command string
    	<alerts|metrics|query|rules|runtime|targets>

  -count
    	only display a count of the requested items

  -insecure
      Skip certificate verification

  -promip string
    	IP address of Prometheus server
 
  -promurl string
    	URL of Prometheus server

  -timeout int
      Request timeout length in seconds (default 30)

  -verbose
    	enable verbose mode

Example Usages

Print info on down node-exporter targets

promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=targets job=node-exporter -down

Show only critical active Prometheus alerts

promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=alerts -critical

Print metadata for metrics exported by kube-state-metrics as a CSV file

promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=metrics -job=kube-state-metrics -csv | sort -u

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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