From 4fb56fff12f5a445d8441330b6e07f652516cc85 Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Wed, 2 Apr 2025 11:13:47 +0100 Subject: [PATCH 1/6] fix nginx config --- build/ansible/roles/nginx/files/conf.d/pmm.conf | 4 ++-- managed/services/grafana/auth_server.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/ansible/roles/nginx/files/conf.d/pmm.conf b/build/ansible/roles/nginx/files/conf.d/pmm.conf index 9ff152c8511..be87048a903 100644 --- a/build/ansible/roles/nginx/files/conf.d/pmm.conf +++ b/build/ansible/roles/nginx/files/conf.d/pmm.conf @@ -220,7 +220,7 @@ rewrite ^/logs.zip$ /v1/server/logs.zip; # logs.zip in both PMM 1.x and 2.x variants - location /v1/server/logz.zip { + location /v1/server/logs.zip { proxy_pass http://managed-json; proxy_http_version 1.1; proxy_set_header Connection ""; @@ -231,7 +231,7 @@ alias /srv/dump/; } - # This localtion stores static content for general pmm-server purposes. + # This location stores static content for general pmm-server purposes. # Ex.: local-rss.xml - contains Percona's news when no internet connection. location /pmm-static { auth_request off; diff --git a/managed/services/grafana/auth_server.go b/managed/services/grafana/auth_server.go index 2e1b0764081..02d74c7f7ef 100644 --- a/managed/services/grafana/auth_server.go +++ b/managed/services/grafana/auth_server.go @@ -67,7 +67,7 @@ var rules = map[string]role{ "/v1/actions/": viewer, "/v1/actions:": viewer, "/v1/backups": admin, - "/v1/dump": admin, + "/v1/dumps": admin, "/v1/accesscontrol": admin, "/v1/inventory/": admin, "/v1/inventory/services:getTypes": viewer, @@ -102,6 +102,7 @@ var rules = map[string]role{ "/swagger": none, "/v1/server/logs.zip": admin, + "/logs.zip": admin, // "/auth_request" has auth_request disabled in nginx config // "/" is a special case in this code From c9358ec82cdca4f32c7b7ab299a528b8aa6fe2e9 Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Wed, 2 Apr 2025 11:38:51 +0100 Subject: [PATCH 2/6] improve comments and docs --- docs/api/pmm-server-config/troubleshooting/logs.md | 8 ++++---- managed/services/grafana/auth_server.go | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/api/pmm-server-config/troubleshooting/logs.md b/docs/api/pmm-server-config/troubleshooting/logs.md index 144c7f9a997..3b36c1d9f3d 100644 --- a/docs/api/pmm-server-config/troubleshooting/logs.md +++ b/docs/api/pmm-server-config/troubleshooting/logs.md @@ -10,12 +10,12 @@ Download the logs and components configuration to troubleshoot any issues with t PMM Server offers three ways to access and download logs: -1. Through direct URL, by visiting `https:///logs.zip`. +1. Through direct URL, by visiting `https:///v1/server/logs.zip`. 2. By calling the Logs endpoint. This method enables you to customize the log content using the `line-count` parameter: For example: - - Default 50,000 lines: `https:///logs.zip` - - Custom number of lines: `https:///logs.zip?line-count=10000` - - Unlimited, full log: `https:///logs.zip?line-count=-1` + - Default 50,000 lines: `https:///v1/server/logs.zip` + - Custom number of lines: `https:///v1/server/logs.zip?line-count=10000` + - Unlimited, full log: `https:///v1/server/logs.zip?line-count=-1` 3. Through the UI, by selecting the **Help > PMM Logs** option from the main menu. If you need to share logs with Percona Support via an SFTP server, you can also use the **PMM Dump** option from the Help menu to generate a compressed tarball file with an export of your PMM metrics and QAN data. For more information, see [Export PMM data with PMM Dump](https://docs.percona.com/percona-monitoring-and-management/how-to/PMM_dump.html) topic in the product documentation. diff --git a/managed/services/grafana/auth_server.go b/managed/services/grafana/auth_server.go index 02d74c7f7ef..fb9f4115fed 100644 --- a/managed/services/grafana/auth_server.go +++ b/managed/services/grafana/auth_server.go @@ -84,13 +84,11 @@ var rules = map[string]role{ "/v1/users": viewer, // must be available without authentication for health checking - "/v1/readyz": none, // TODO: remove before v3 GA "/v1/server/readyz": none, "/v1/server/leaderHealthCheck": none, "/ping": none, // PMM 1.x variant // must not be available without authentication as it can leak data - "/v1/version": viewer, // TODO: remove before v3 GA "/v1/server/version": viewer, "/v1/qan": viewer, @@ -102,7 +100,12 @@ var rules = map[string]role{ "/swagger": none, "/v1/server/logs.zip": admin, - "/logs.zip": admin, + + // kept for backwards compatibility with PMM v2 + "/v1/readyz": none, // redirects to /v1/server/readyz + "/v1/version": viewer, // redirects to /v1/server/version + "/logs.zip": admin, // redirects to /v1/server/logs.zip + // "/auth_request" has auth_request disabled in nginx config // "/" is a special case in this code From 06e7d4f3fd7c11b2b6f4744ec0feed9b5bcd714a Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Tue, 6 May 2025 12:40:22 +0100 Subject: [PATCH 3/6] update docs --- documentation/docs/troubleshoot/pmm_dump.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/docs/troubleshoot/pmm_dump.md b/documentation/docs/troubleshoot/pmm_dump.md index c7429ef850a..b237ee6519b 100644 --- a/documentation/docs/troubleshoot/pmm_dump.md +++ b/documentation/docs/troubleshoot/pmm_dump.md @@ -20,7 +20,7 @@ The **dump.tar.gz** dump file is a .TAR archive compressed via Gzip. Here's what To create a dump of your dataset: {.power-number} -1. From the main menu on the left, go to **Help > PMM Dump**. +1. From the top-right corner of the PMM home page, go to **Help > PMM Dump**. 2. Click **Create dataset** to go to the **Export new dataset** page. 3. Choose the service for which you want to create the dataset or leave it empty to export all data. 4. Define the time range for the dataset. @@ -33,7 +33,7 @@ To create a dump of your dataset: If you are a Percona Customer, you can securely share PMM data dumps with Percona Support via SFTP. {.power-number} -1. From the main menu on the left, go to **Help > PMM Dump**. +1. From the top-right corner of the PMM home page, go to **Help > PMM Dump**. 2. Select the PMM dump entry which you want to send to Support. 3. In the **Options** column, expand the table row to check the PMM Service associated with the dataset, click the ellipsis (three vertical dots) and select **Send to Support**. 4. Fill in the [details of the SFTP server](https://percona.service-now.com/percona?id=kb_article_view&sysparm_article=KB0010247&sys_kb_id=bebd04da87e329504035b8c9cebb35a7&spa=1), then click **Send**. From d5fed846f543d54d7d2a422e07d0c7c47fa45da7 Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Tue, 6 May 2025 17:10:11 +0100 Subject: [PATCH 4/6] include dump route in tests --- managed/services/grafana/auth_server_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/managed/services/grafana/auth_server_test.go b/managed/services/grafana/auth_server_test.go index 34331a31816..065167b3efb 100644 --- a/managed/services/grafana/auth_server_test.go +++ b/managed/services/grafana/auth_server_test.go @@ -125,6 +125,7 @@ func TestAuthServerAuthenticate(t *testing.T) { "/v1/server/settings/readonly": viewer, "/v1/server/AWSInstance": none, "/v1/backups": admin, + "/v1/dumps": admin, "/v1/accesscontrol": admin, "/v1/users": viewer, "/v1/platform:connect": admin, From e79db0d59636659e329f882ab7ab10bbb405062a Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Tue, 13 May 2025 08:12:11 +0100 Subject: [PATCH 5/6] fix broken markdown link --- .../reference/dashboards/dashboard-mongodb-cluster-summary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md index 763a82bd1d3..a8c55f3ef73 100644 --- a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md +++ b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md @@ -142,7 +142,7 @@ To ensure your MongoDB sharded cluster components appear in the correct sections - use the same `--cluster` name for all components of your sharded cluster - add each component (config servers, shard nodes, and mongos routers) as a separate service. - For detailed instructions on adding MongoDB nodes, see [Add MongoDB services via CLI](../../install-pmm/install-pmm-client/connect-database/mongodb.md#on-the-command-line). + For detailed instructions on adding MongoDB nodes, see [Add MongoDB services via CLI](../../install-pmm/install-pmm-client/connect-database/mongodb.md#add-mongodb-service-to-pmm). ??? info "Example command for adding a MongoDB shard node" From 70fe29e2e39f2114c3aace1604a1c3a496cddcc0 Mon Sep 17 00:00:00 2001 From: Michael Okoko Date: Tue, 13 May 2025 10:58:21 +0100 Subject: [PATCH 6/6] trigger rebuild