Skip to content

Add a collector for pg_proctab. - #1168

Open
sfc-gh-pnuttall wants to merge 2 commits into
prometheus-community:masterfrom
Snowflake-Labs:proctab
Open

sfc-gh-pnuttall wants to merge 2 commits into
prometheus-community:masterfrom
Snowflake-Labs:proctab

Conversation

@sfc-gh-pnuttall

Copy link
Copy Markdown
Contributor

Docs: https://github.com/markwkm/pg_proctab/tree/main

This collector is useful when:

  • You have access to postgres, but not the underlying machine the postgres server is running on.
  • The pg_proctab extension is installed.

We use this in AWS RDS and GCP CloudSQL.

Docs: https://github.com/markwkm/pg_proctab/tree/main

This collector is useful when:
 * You have access to postgres, but not the underlying machine the
   postgres server is running on.
 * The `pg_proctab` extension is installed.

We use this in AWS RDS and GCP CloudSQL.

Signed-off-by: Peter Nuttall <peter.nuttall@snowflake.com>
Signed-off-by: Peter Nuttall <peter.nuttall@snowflake.com>

@ArthurSens ArthurSens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for the delayed review here! The codebase has been heavily refactored a few months back, so we might need to do a heavy rebase or start the work fresh from a new PR 😓

I've added comments below. Also, do we want to include load5, load15, swapfree and swapcached?

Comment thread collector/pg_proctab.go
prometheus.BuildFQName(
namespace,
proctabSubsystem,
"memused",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following Prometheus naming conventions, the unit of the metric should be part of its name as a suffix. Can we include _bytes?

This apply to all other memory metrics

Comment thread collector/pg_proctab.go
Comment on lines +220 to +225
emitMemMetric(memused, pgMemusedDesc, ch)
emitMemMetric(memfree, pgMemfreeDesc, ch)
emitMemMetric(memshared, pgMemsharedDesc, ch)
emitMemMetric(membuffers, pgMembuffersDesc, ch)
emitMemMetric(memcached, pgMemcachedDesc, ch)
emitMemMetric(swapused, pgSwapusedDesc, ch)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets move this to after we query the CPU/load metrics. If CPU/load collection fails, this collector will report a failure while providing partial data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants