prometheus-community / prometheus-community/postgres_exporter

How to exclude the zero matrics?

Open
#719 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.6k
Forks
835
Avg merge
2d 4h
Merged PRs (30d)
10

Description

Hi,I want to let the exporter do not return the zero matrics,because my matrics is too large.
For example I want to exclude these matrics of zero value:
pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="accessexclusivelock",server="10.93.50.47:5432"} 0 pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="accesssharelock",server="10.93.50.47:5432"} 0 pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="exclusivelock",server="10.93.50.47:5432"} 0 pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="rowexclusivelock",server="10.93.50.47:5432"} 3 pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="rowsharelock",server="10.93.50.47:5432"} 2 pg_locks_count{datname="check_split_10c67626617311eda61d0025908bebb9",mode="sharelock",server="10.93.50.47:5432"} 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named in the issue. Start by locating where PostgreSQL lock metrics are collected and rendered by the exporter, then determine whether zero-valued series can be excluded without affecting metric semantics. Done means the exporter omits the requested zero-valued metrics while retaining nonzero series, with coverage for the example behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql, prometheus
Domain
databases, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.