Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-12619: Make PMM environment variables more consistent #2857

Merged
merged 29 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e009ada
refactored environment variables
idoqo Feb 28, 2024
526f2a6
update migration doc
idoqo Feb 28, 2024
881108d
replace test line
idoqo Feb 28, 2024
f40cc41
drop no lint rule
idoqo Feb 28, 2024
68a08ad
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Mar 3, 2024
21f48ea
fix parser tests
idoqo Mar 4, 2024
3311ed6
re-order table values
idoqo Mar 5, 2024
00d71ba
remove deprecated env variables
idoqo Mar 6, 2024
2812cb8
fix tests
idoqo Mar 6, 2024
8a66c6d
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Mar 11, 2024
47c31c6
use singluar advisor
idoqo Mar 11, 2024
dd23674
introduce PMM_DEV_ prefix for dev-related variables
idoqo Mar 12, 2024
2819f8a
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Mar 19, 2024
9f5d946
clean up environment variables
idoqo Mar 21, 2024
dd1a234
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Mar 21, 2024
e6a4d06
drop printf
idoqo Mar 21, 2024
0ae4b04
drop unused variable
idoqo Mar 26, 2024
78bae3e
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Mar 26, 2024
88b44ba
update tests
idoqo Mar 27, 2024
e920f5f
add notes for removed variable
idoqo Mar 27, 2024
9c4c072
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Apr 2, 2024
3e64259
update oauth variables
idoqo Apr 2, 2024
d52729d
update changed variable list
idoqo Apr 2, 2024
8c2ad98
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Apr 9, 2024
fd81967
update variable check validation
idoqo Apr 9, 2024
4f0939b
refactor tests
idoqo Apr 23, 2024
1557b56
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Apr 23, 2024
01d86a2
Merge branch 'v3' into PMM-12619-env-vars-rename
idoqo Apr 23, 2024
9d049da
surpress linter error
idoqo Apr 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ jobs:
environment:
- PMM_DEBUG=1
- PERCONA_TEST_CHECKS_INTERVAL=10s
idoqo marked this conversation as resolved.
Show resolved Hide resolved
- PMM_PERCONA_TEST_PLATFORM_ADDRESS=https://check-dev.percona.com
- PMM_PERCONA_TEST_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
- PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check-dev.percona.com
- PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
ports:
- 80:8080
- 443:8443
Expand Down
6 changes: 3 additions & 3 deletions agent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ services:
- PMM_DEBUG=1
- PERCONA_TEST_CHECKS_INTERVAL=10s
# for local development
- PMM_ADVISORS_CHECKS_FILE=/srv/checks/custom-checks.yml
- PMM_DEV_ADVISOR_CHECKS_FILE=/srv/checks/custom-checks.yml
# for check-dev
# - PMM_TEST_SAAS_HOST=check-dev.percona.com:443
# - PMM_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
# - PMM_DEV_PERCONA_PLATFORM_ADDRESS=check-dev.percona.com:443
# - PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
volumes:
- ./testdata/checks:/srv/checks

Expand Down
6 changes: 3 additions & 3 deletions api-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ services:
- PMM_DEBUG=1
- PERCONA_TEST_CHECKS_INTERVAL=10s
# for local development
# - PMM_ADVISORS_CHECKS_FILE=/srv/checks/custom-checks.yml
# - PMM_DEV_ADVISOR_CHECKS_FILE=/srv/checks/custom-checks.yml
# for check-dev
- PMM_TEST_SAAS_HOST=check-dev.percona.com
- PMM_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
- PMM_DEV_PERCONA_PLATFORM_ADDRESS=check-dev.percona.com
- PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
volumes:
- ./testdata/checks:/srv/checks

Expand Down
2 changes: 1 addition & 1 deletion build/docker/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can use these environment variables (-e VAR) when running the Docker image.
| PMM_METRICS_RESOLUTION_LR | Low metrics resolution in seconds |
| PMM_DATA_RETENTION | How long to keep time-series data in ClickHouse. This variable accepts golang style duration format, example: 24h, 30m, 10s |
| PMM_ENABLE_VM_CACHE | Enable cache in VM |
| PMM_ENABLE_AZUREDISCOVER | Enable support for discovery of Azure databases |
| PMM_ENABLE_AZURE_DISCOVER | Enable support for discovery of Azure databases |
idoqo marked this conversation as resolved.
Show resolved Hide resolved
| PMM_PUBLIC_ADDRESS | External IP address or the DNS name on which PMM server is running. |
| PMM_DEBUG | Enables a more verbose log level |
| PMM_TRACE | Enables a more verbose log level including traceback information |
Expand Down
52 changes: 26 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ services:
- PMM_LESS_LOG_NOISE=1
- PMM_RELEASE_PATH=/root/go/bin
- PMM_ENABLE_RBAC=${PMM_ENABLE_RBAC:-0}
- PMM_TEST_VERSION_SERVICE_URL=${PMM_TEST_VERSION_SERVICE_URL}
# - PMM_PERCONA_TEST_PLATFORM_ADDRESS=https://check.localhost
# - PMM_PERCONA_TEST_PLATFORM_INSECURE=1
# - PMM_PERCONA_TEST_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_TEST_TELEMETRY_INTERVAL=10s
# - PMM_TEST_TELEMETRY_DISABLE_START_DELAY=1
# - PMM_TEST_TELEMETRY_RETRY_BACKOFF=10s
- PMM_DEV_VERSION_SERVICE_URL=${PMM_DEV_VERSION_SERVICE_URL}
# - PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check.localhost
# - PMM_DEV_PERCONA_PLATFORM_INSECURE=1
# - PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_DEV_TELEMETRY_INTERVAL=10s
# - PMM_DEV_TELEMETRY_DISABLE_START_DELAY=1
# - PMM_DEV_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_CLICKHOUSE_ADDR=127.0.0.1:9000
# - PMM_CLICKHOUSE_DATABASE=pmm
# - PMM_CLICKHOUSE_BLOCK_SIZE=10000
# - PMM_CLICKHOUSE_POOL_SIZE=2
# - PMM_DEBUG=1
# - PMM_ADVISORS_CHECKS_FILE=/srv/checks/local-checks.yml
# - PMM_DEV_ADVISOR_CHECKS_FILE=/srv/checks/local-checks.yml
# - PMM_POSTGRES_ADDR=pg
# - PMM_POSTGRES_DBNAME=pmm-managed
# - PMM_POSTGRES_USERNAME=pmm-managed
Expand Down Expand Up @@ -206,12 +206,12 @@ services:
- REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN}
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
# - PMM_PERCONA_TEST_PLATFORM_ADDRESS=https://check.localhost
# - PMM_PERCONA_TEST_PLATFORM_INSECURE=1
# - PMM_PERCONA_TEST_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_TEST_TELEMETRY_INTERVAL=10s
# - PMM_TEST_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_TEST_TELEMETRY_DISABLE_START_DELAY=1
# - PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check.localhost
# - PMM_DEV_PERCONA_PLATFORM_INSECURE=1
# - PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_DEV_TELEMETRY_INTERVAL=10s
# - PMM_DEV_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_DEV_TELEMETRY_DISABLE_START_DELAY=1
- PMM_CLICKHOUSE_ADDR=${CH_HOSTNAME:-ch}:9000
- PMM_CLICKHOUSE_DATABASE=pmm
- PMM_CLICKHOUSE_BLOCK_SIZE=10000
Expand Down Expand Up @@ -289,12 +289,12 @@ services:
- REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN}
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
# - PMM_PERCONA_TEST_PLATFORM_ADDRESS=https://check.localhost
# - PMM_PERCONA_TEST_PLATFORM_INSECURE=1
# - PMM_PERCONA_TEST_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_TEST_TELEMETRY_INTERVAL=10s
# - PMM_TEST_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_TEST_TELEMETRY_DISABLE_START_DELAY=1
# - PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check.localhost
# - PMM_DEV_PERCONA_PLATFORM_INSECURE=1
# - PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_DEV_TELEMETRY_INTERVAL=10s
# - PMM_DEV_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_DEV_TELEMETRY_DISABLE_START_DELAY=1
- PMM_CLICKHOUSE_ADDR=${CH_HOSTNAME:-ch}:9000
- PMM_CLICKHOUSE_DATABASE=pmm
- PMM_CLICKHOUSE_BLOCK_SIZE=10000
Expand Down Expand Up @@ -371,12 +371,12 @@ services:
- REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN}
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
# - PMM_PERCONA_TEST_PLATFORM_ADDRESS=https://check.localhost
# - PMM_PERCONA_TEST_PLATFORM_INSECURE=1
# - PMM_PERCONA_TEST_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_TEST_TELEMETRY_INTERVAL=10s
# - PMM_TEST_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_TEST_TELEMETRY_DISABLE_START_DELAY=1
# - PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check.localhost
# - PMM_DEV_PERCONA_PLATFORM_INSECURE=1
# - PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=<public key>
# - PMM_DEV_TELEMETRY_INTERVAL=10s
# - PMM_DEV_TELEMETRY_RETRY_BACKOFF=10s
# - PMM_DEV_TELEMETRY_DISABLE_START_DELAY=1
- PMM_CLICKHOUSE_ADDR=${CH_HOSTNAME:-ch}:9000
- PMM_CLICKHOUSE_DATABASE=pmm
- PMM_CLICKHOUSE_BLOCK_SIZE=10000
Expand Down
8 changes: 8 additions & 0 deletions docs/process/best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
- Supervisor-level dependencies between services are not strictly required (due to restarts everything will work eventually), but are nice to have: they help avoid scarry errors in logs.
- The big exception is exporters: we should follow practices established by the Prometheus community and not fail if the system under monitoring is not available. Other startup errors, like a missing certificate file, should still terminate the exporter.

### Environment Variables
For consistency, environment variables should keep to the following suggestions:
- Use the `PMM_DEV_` prefix for any environment variable that is to be used for *only* development/test purposes i.e.,
variables that are not meant for end-users in any circumstance e.g., `PMM_DEV_PERCONA_PLATFORM_ADDRESS`
- Use the `PMM_TEST_` prefix for any variable that is not part of PMM GA functionality.
- Use the `PMM_` prefix for variables that is part of PMM GA functionality.
- Use a sub-prefix if a number of env vars relate to one component, e.g., `PMM_TEST_HA_`
- The use of PERCONA_ prefix is prohibited (exception: PMM_PERCONA_PLATFORM_URL, since it's part of a proper name, not a prefix)
## Code style

- `gofumpt -s ` (note the `-s`)
Expand Down
Loading
Loading