Skip to content

PMM-13596 fix logs redirect #3867

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

Merged
merged 12 commits into from
May 13, 2025
4 changes: 2 additions & 2 deletions build/ansible/roles/nginx/files/conf.d/pmm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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 "";
Expand All @@ -261,7 +261,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;
Expand Down
8 changes: 4 additions & 4 deletions docs/api/pmm-server-config/troubleshooting/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<address-of-your-pmm-server>/logs.zip`.
1. Through direct URL, by visiting `https://<address-of-your-pmm-server>/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://<pmm-server>/logs.zip`
- Custom number of lines: `https://<pmm-server>/logs.zip?line-count=10000`
- Unlimited, full log: `https://<pmm-server>/logs.zip?line-count=-1`
- Default 50,000 lines: `https://<pmm-server>/v1/server/logs.zip`
- Custom number of lines: `https://<pmm-server>/v1/server/logs.zip?line-count=10000`
- Unlimited, full log: `https://<pmm-server>/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.
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/troubleshoot/pmm_dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
1. From the top-right corner of the PMM home page, go to <i class="uil uil-question-circle"></i> **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.
Expand All @@ -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 <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
1. From the top-right corner of the PMM home page, go to <i class="uil uil-question-circle"></i> **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**.
Expand Down
10 changes: 7 additions & 3 deletions managed/services/grafana/auth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -103,6 +101,12 @@ var rules = map[string]role{
"/swagger": none,

"/v1/server/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
Expand Down
1 change: 1 addition & 0 deletions managed/services/grafana/auth_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading