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.
- 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.
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:
once we will finish histogram completly.
Ununsed/Irrelevant properties on PMM side:
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.