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

[MySQL] Configurable Fingerprint and Example length in QAN

Details

    • 5.5
    • No
    • No
    • Yes
    • C/S Core
    • Hide

      1. Start PMM server and client
      2. Add mysql perfschema:
      ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema
      3. Run some long queries (longer than 2048 chars). You can use long comment in this case to make it easier.
      4. Find this long query in QAN.
      5. Open details and see example and explain. Both should not work because query should be truncated after 2048th char.
      6. Remove this service.
      7. Add mysql perfschema with new flag set to 10.
      ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema --max-query-length=10
      8. Repeat point 3, 4. Open details and see example and explain. Both should not work because query should be truncated after 10th char.
      9. Remove this service.
      10. Add mysql perfschema with new flag set to -1 (unlimited).
      ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema --max-query-length=-1
      11. Repeat point 3, 4. Open details and see example and explain. Both should work and they should not be truncated at all.
      12. Remove this service.
      13. Repeat point 1 to 12 with slowlog as query-source instead perschema.

      Show
      1. Start PMM server and client 2. Add mysql perfschema: ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema 3. Run some long queries (longer than 2048 chars). You can use long comment in this case to make it easier. 4. Find this long query in QAN. 5. Open details and see example and explain. Both should not work because query should be truncated after 2048th char. 6. Remove this service. 7. Add mysql perfschema with new flag set to 10. ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema --max-query-length=10 8. Repeat point 3, 4. Open details and see example and explain. Both should not work because query should be truncated after 10th char. 9. Remove this service. 10. Add mysql perfschema with new flag set to -1 (unlimited). ../bin/pmm-admin add mysql --username=root --password=root-password --query-source=perfschema --max-query-length=-1 11. Repeat point 3, 4. Open details and see example and explain. Both should work and they should not be truncated at all. 12. Remove this service. 13. Repeat point 1 to 12 with slowlog as query-source instead perschema.

    Description

      *FB: https://github.com/Percona-Lab/pmm-submodules/pull/2765*

      User story:

      • As a PMM user, I need to be able to change the default length of Query Example and Query Examples in QAN so that I can see some longer queries if I have them

      UI/UX:
      1) #pmm-admin add ..... --max-query-length = 50000
      2) an additional field on Remote instances pages

      query-length - in bytes ..?

      Acceptance criteria

      • User able to specify query-length for all monitored services (Mysql, mongodb, Postgresql) where we have QAN while adding in CLI
      • USer can control this parameter when adding Service over UI
      • Documentation
      • Documentation on the parameter
      • short explanation of how this can affect the monitoring and monitored system

      Out of scope:
      TBD

      Suggested implementation:
      Add a new parameter MaxQueryExampleLength for

      Add the new parameter to pmm-managed agent mode MySQLOptions and in the places they are used

      Update API test

      Update pmm-agent's QAN for SlowLog and PerfSchema to use the new parametrized value for query length instead the hardcoded value

      Add a new parameter in pmm-admin for add mysql

      How to test:
      TBD

      Details:
      Please note: we can't store Full Example/Fingerprint by default as this might affect the performance of QAN/PMM for longer fingerprints. We already fixed the bug when PMM was very slow with very long queries. So people need to use this flag with caution

      Attachments

        1. 4444chars.png
          4444chars.png
          1.16 MB
        2. default.png
          default.png
          906 kB
        3. nolimit_explain.png
          nolimit_explain.png
          747 kB
        4. nolimit.png
          nolimit.png
          1.19 MB

        Issue Links

          Activity

            People

              jiri.ctvrtka Jiří Čtvrtka
              roma.novikov Roma Novikov
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist