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

Number of database connections per user #35196

Open
epochstamp opened this issue Sep 16, 2024 · 3 comments
Open

Number of database connections per user #35196

epochstamp opened this issue Sep 16, 2024 · 3 comments
Labels

Comments

@epochstamp
Copy link

Component(s)

receiver/postgresql

Is your feature request related to a problem? Please describe.

The number of maximum database active connections can be configured and is already tracked through the postgresql_connection_max metrics, yet there is no metrics to track the active number of connections. However this is an essential thing to monitor.

Describe the solution you'd like

Add a metrics named postgresql_connection_active with the following additional entries:

  • application_name - Name of the client application that started the session.
  • backend_start - Timestamp when the backend process was initiated.

Describe alternatives you've considered

Parse Loki logs to track connections vs disconnections, but this is a very rough approximation of the actual number of active connections...

Additional context

References:
Why active connections over max connections should be monitored
Query to get active connections per client

@epochstamp epochstamp added enhancement New feature or request needs triage New item requiring triage labels Sep 16, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme
Copy link
Contributor

atoulme commented Oct 2, 2024

backend_start would create a high cardinality situation. That won't work for this metric.

@atoulme atoulme removed the needs triage New item requiring triage label Oct 2, 2024
@epochstamp
Copy link
Author

epochstamp commented Oct 4, 2024

After further thinking I do not see any use-case (in the context of observability systems, at least from my place) of this anyway.

We could then just keep the application_name attribute.

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

No branches or pull requests

2 participants