pig pe
Use pig pe to read metrics from a running pg_exporter
and reload its configuration. The full command name is pig pg_exporter.
Aliases are pe, pgexp, and pgexporter.
Select an exporter
The default endpoint is http://127.0.0.1:9630. Use these options to select another instance:
| Option | Default | Description |
|---|---|---|
--host | 127.0.0.1 | Host name or IPv4 address |
-p, --port | 9630 | HTTP port |
PIG uses HTTP and the standard /metrics, /stat, and /reload paths.
For HTTPS, authentication, client certificates, or a custom path, use an HTTP client such as curl.
pe get
Read /metrics. Print samples whose names start with pg_, plus their Prometheus HELP and TYPE lines.
To include process and runtime metrics that do not start with pg_, read the complete endpoint:
pe list
Read /metrics. Print one HELP line for each pg_ metric family in the response.
The list reflects the exporter’s current configuration.
pe stat
Read /stat and print its response. The response format depends on the installed pg_exporter version.
pe reload
After editing the exporter’s configuration, request a reload through /reload:
Output and errors
Use -o json or -o yaml for a PIG result that contains the command’s text output.
Prometheus metrics remain text inside that result.
Network errors, response-read errors, and HTTP 4xx/5xx responses return a nonzero exit code. HTTP error details contain the status code and standard description, without the response body. Successful responses retain the filtering or raw text behavior described above.
To install pg_exporter, use pig ext add pg-exporter. Configure and start the exporter before
using pig pe; these commands access its HTTP API.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)