-
Notifications
You must be signed in to change notification settings - Fork 494
feat: database_observability: stop tracking own instrumentation queries #4991
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: database_observability: stop tracking own instrumentation queries #4991
Conversation
internal/component/database_observability/postgres/collector/query_samples.go
Show resolved
Hide resolved
d37df3f to
d8a065d
Compare
|
💻 Deploy preview available (dbo11y: stop tracking alloy's own queries in |
d8a065d to
39091a0
Compare
pg_stat_activity|
💻 Deploy preview available (feat: database_observability: stop tracking own instrumentation queries): |
This PR introduces a change for excluding "own queries" in postgres from `pg_stat_activity`: we need to drop samples (and wait events) for the currently connected user. This new behaviour is enabled by default through the setting `exclude_current_user`, as it's deemed safe / recommended. No changes to be done on `pg_stat_statements` as that is achieved through user permissions update (docs on the website).
6f3ad1e to
5061da1
Compare
| columns := []string{ | ||
| "now", "datname", "pid", "leader_pid", | ||
| "usename", "application_name", "client_addr", "client_port", | ||
| "backend_type", "backend_start", "backend_xid", "backend_xmin", | ||
| "xact_start", "state", "state_change", "wait_event_type", | ||
| "wait_event", "blocked_by_pids", "query_start", "query_id", | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by change: I've tried to fix flakyness of these tests and make the style more consistent.
docs/sources/reference/components/database_observability/database_observability.postgres.md
Show resolved
Hide resolved
matthewnolf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
b44955e to
4e3c751
Compare
PR Description
This PR introduces a change for excluding "own queries" in postgres from
pg_stat_activity: we need to drop samples (and wait events) for the currently connected user. This new behaviour is enabled by default through the settingexclude_current_user, as it's deemed safe / recommended.No changes to be done on
pg_stat_statementsas that is achieved through user permissions update (docs on the website).Which issue(s) this PR fixes
Relates to https://github.com/grafana/grafana-dbo11y-app/issues/1307
Notes to the Reviewer
PR Checklist
BEGIN_COMMIT_OVERRIDE
feat: database_observability: stop tracking own instrumentation queries (#4991)
This PR introduces a change for excluding "own queries" in postgres from
pg_stat_activity: we need to drop samples (and wait events) for thecurrently connected user. This new behaviour is enabled by default
through the setting
exclude_current_user, as it's deemed safe /recommended.
No changes to be done on
pg_stat_statementsas that is achievedthrough user permissions update (docs on the website).
END_COMMIT_OVERRIDE