Skip to content

Add connections by client collector #1093

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Sticksman
Copy link
Contributor

Fixes #969

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
@Sticksman
Copy link
Contributor Author

👓 @SuperQ

pgConnectionsByClientQuery = `
SELECT
count(*) as count,
client_hostname
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a bad field to use for this data. According to the docs, this is the reverse dns of the IP. I would prefer to see this use the IP.

https://www.postgresql.org/docs/17/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I would prefer this to be client_addr.

Suggested change
client_hostname
client_addr

pgConnectionsByClientQuery = `
SELECT
count(*) as count,
client_hostname
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I would prefer this to be client_addr.

Suggested change
client_hostname
client_addr

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add collector for pg_connections
3 participants