Vonng / pg_exporter

Advanced PostgreSQL & Pgbouncer Metrics Exporter for Prometheus
https://pigsty.io
Apache License 2.0
164 stars 42 forks source link

Add Column.Default option to set default value when null #19

Closed Vonng closed 2 years ago

Vonng commented 3 years ago

It would be convenient to have the ability to define default value for metrics if null is acquired.

E.g: Lot's of metrics could be better to have 0 instead of NaN.

While using coalesce(col, 0) could work. It's just too ugly and hacky.

It would be nice to do it in configuration


    - exec_time:
        usage: COUNTER
        default: 0
        description: Total time spent executing the statement, in µs
Vonng commented 2 years ago

resolved by v0.5.0