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

PMM now checks Docker environment variables and warns about invalid ones.

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.6.0
    • Component/s: PMM ManageD
    • Labels:
    • Story Points:
      3
    • Sprint:
      Platform Sprint 9, Platform Sprint 10, Platform Sprint 11, Platform Sprint 12, Platform Sprint 14
    • Needs Review:
      Yes
    • Needs QA:
      Yes
    • Needs Packaging:
      Yes
    • Needs Doc:
      Yes

      Description

      Currently, invalid environment variable values are logged by pmm-managed and ignored. Invalid variable names are ignored completely. That's problematic. See comments at PMM-4785 and PMM-4673.

      DoD

      • Invalid environment variable values cause Docker container to exit early with a good error message.
      • Unexpected environment variable names cause Docker container to print a warning and continue.

      Implementation

      Coding

      • Extract a part of UpdateSettingsFromEnv method into a separate utils package. It should not depend on models, database/sql, gRPC, etc.
      • Use that new package in UpdateSettingsFromEnv.
      • Use that new package in pmm-managed-init tool. os.Exit(1) after printing a good human-readable error messaage into stderr if environment variable value is invalid.
      • Check against a allow list of environment variables names (from UpdateSettingsFromEnv plus "PATH", "HOSTNAME", "TERM", "HOME" plus "GF_" prefix for Grafana) and print a warning for unexpected names, but do not exit as it might break production usage.
      • Remove environment variables handling in qan-api2 – pmm-managed uses only flags to configure qan-api2.

      Packaging

      • Add pmm-managed-init binary (produced by make release) to pmm-managed package.
      • Run it before starting supervisord in entrypoint.sh.

      DOC

      • Warn users in Release notes
      • Mention validation in Documentation about pmm Docker setup

      Discussion

      • TBD

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              roma.novikov Roma Novikov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 4 days, 1 hour, 2 minutes
                  4d 1h 2m

                    Smart Checklist