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 @@ -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 "";
Expand All @@ -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;
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
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 @@ -102,6 +100,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
Loading