Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-9632

Read and reflect values from pg_stat_monitor_settings view.

Details

    • Improvement
    • Status: Done
    • Medium
    • Resolution: Done
    • None
    • 2.30.0
    • None
    • None

    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:

      1. Remove hardcoded values.
      2. Use pg_stat_monitor_settings view.
      3. Use these values on proper places.
      4. Create test for this.
      5. Add unused values into comment with ticket number.
      6. 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

          Activity

            People

              jiri.ctvrtka Jiří Čtvrtka
              jiri.ctvrtka Jiří Čtvrtka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist