Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add partition_of tag to postgresql.seq_scans metric #19298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions postgres/datadog_checks/postgres/relationsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
current_database(),
N.nspname,
C.relname,
Inh.inhparent::regclass AS partition_of,
pg_stat_get_numscans(C.oid),
pg_stat_get_tuples_returned(C.oid),
I.idx_scan,
Expand Down Expand Up @@ -191,6 +192,7 @@
C.xmin
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN pg_inherits Inh ON (Inh.inhrelid = C.oid)
LEFT JOIN pg_locks L ON C.oid = L.relation AND L.locktype = 'relation'
LEFT JOIN pg_index idx_toast ON (idx_toast.indrelid = C.reltoastrelid)
LEFT JOIN LATERAL (
Expand All @@ -207,6 +209,7 @@
{'name': 'db', 'type': 'tag'},
{'name': 'schema', 'type': 'tag'},
{'name': 'table', 'type': 'tag'},
{'name': 'partition_of', 'type': 'tag_not_null'},
{'name': 'seq_scans', 'type': 'rate'},
{'name': 'seq_rows_read', 'type': 'rate'},
{'name': 'index_rel_scans', 'type': 'rate'},
Expand Down
Loading