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

[receiver/postgresql] Additional metric: number of sequential scans. #26096

Closed
bjandras opened this issue Aug 24, 2023 · 2 comments
Closed

[receiver/postgresql] Additional metric: number of sequential scans. #26096

bjandras opened this issue Aug 24, 2023 · 2 comments
Assignees
Labels

Comments

@bjandras
Copy link
Contributor

bjandras commented Aug 24, 2023

Component(s)

receiver/postgresql

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

A number of sequential scans per database/table would be a very useful metric, as sequential scans can usually be a symptom of unoptimized queries/schema.

Describe the solution you'd like

An existing metric,postgresql.operation, already counts the number of row insertions, deletions, hot updates, etc., per database and table. These numbers are directly obtained from the pg_stat_user_tables internal PostgreSQL view. The seq_scan column of pg_stat_user_tables contains the number of sequential scans.

We can add an additional value to the operation attribute of the postgresql.operation metric -- seq_scan -- and write out an additional "operations" data point with that attribute value.

Describe alternatives you've considered

If we don't want to add new operation attribute types to postgresql.operation metric, we can introduce a completely new metric, e.g. postgresql.sequential_scans.

Additional context

No response

@bjandras bjandras added enhancement New feature or request needs triage New item requiring triage labels Aug 24, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

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

@djaglowski
Copy link
Member

The current operations metric is focused on CRUD operations, so sequential scans seems like a separate concern. I'd favor adding this as a new metric.

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

3 participants