Details
-
Improvement
-
Status: Done
-
Medium
-
Resolution: Done
-
None
-
None
-
None
-
3
-
Yes
-
Yes
-
Yes
-
[obsolete] C/S Core
Description
User impact: User can change settings and PMM will reflect this immediately in buckets.
Actual result: Right now we using only few values and these values are hardcoded now.
Expected result: Use values from settings. In ideal case reflect all values avalaible in settings view.
How to test:
1. Start PMM with PGSM 1.0 and higher.
2. Check everything is working. (PG 11 to 14).
3. Set normalized query to non default
4. Set bucket time to non default and verify that PMM stopped this agent.
Suggested implementation:
- Remove hardcoded values.
- Use pg_stat_monitor_settings view.
- Use these values on proper places.
- Create test for this.
- Add unused values into comment with ticket number.
Freeze settings to every query and expose it??
Right now we are checking settings everytime when we creating buckets to be able reflect new settings immediately.
Used settings:
pg_stat_monitor.pgsm_bucket_time
pg_stat_monitor.pgsm_normalized_query
These two we are using from very beginning of PG monitor.
In scope and main point of this ticket is I rewrote code to reflect properties right after value changed. For example pg_stat_monitor.pgsm_normalized_query doesnt need restart and with old code this will not reflect without restart pmm-agent.
For future we should use:
pg_stat_monitor.pgsm_histogram_buckets
pg_stat_monitor.pgsm_histogram_max
pg_stat_monitor.pgsm_histogram_min
once we will finish histogram completly.
Ununsed/Irrelevant properties on PMM side:
pg_stat_monitor.pgsm_enable_query_plan
pg_stat_monitor.pgsm_extract_comments
pg_stat_monitor.pgsm_max
pg_stat_monitor.pgsm_max_buckets
pg_stat_monitor.pgsm_overflow_target
pg_stat_monitor.pgsm_query_max_len
pg_stat_monitor.pgsm_query_shared_buffer
pg_stat_monitor.pgsm_track
pg_stat_monitor.pgsm_track_planning
pg_stat_monitor.pgsm_track_utility
As bonus of this solution we can also freeze settings to all queries saved in clickhouse.
Pros: Easier debug/testing and change to have better backward compatibility once we will introduce breaking changes.
Cons: We need store a little bit more data in clickhouse for every query. There is also possiblity that we dont use these data in future at all.
Attachments
Issue Links
- relates to
-
PG-362 pg_stat_monitor: pg_stat_monitor.pgsm_normalized_query needs to be 0 by default
-
- Done
-