Skip to content

Commit b013b8e

Browse files
idoqoademidoff
andauthored
PMM-13596 fix logs redirect (#3867)
* fix nginx config * improve comments and docs * update docs * include dump route in tests * fix broken markdown link * trigger rebuild --------- Co-authored-by: Alex Demidoff <[email protected]>
1 parent bc46d62 commit b013b8e

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

build/ansible/roles/nginx/files/conf.d/pmm.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
rewrite ^/logs.zip$ /v1/server/logs.zip;
251251

252252
# logs.zip in both PMM 1.x and 2.x variants
253-
location /v1/server/logz.zip {
253+
location /v1/server/logs.zip {
254254
proxy_pass http://managed-json;
255255
proxy_http_version 1.1;
256256
proxy_set_header Connection "";
@@ -261,7 +261,7 @@
261261
alias /srv/dump/;
262262
}
263263

264-
# This localtion stores static content for general pmm-server purposes.
264+
# This location stores static content for general pmm-server purposes.
265265
# Ex.: local-rss.xml - contains Percona's news when no internet connection.
266266
location /pmm-static {
267267
auth_request off;

docs/api/pmm-server-config/troubleshooting/logs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Download the logs and components configuration to troubleshoot any issues with t
1010

1111
PMM Server offers three ways to access and download logs:
1212

13-
1. Through direct URL, by visiting `https://<address-of-your-pmm-server>/logs.zip`.
13+
1. Through direct URL, by visiting `https://<address-of-your-pmm-server>/v1/server/logs.zip`.
1414
2. By calling the Logs endpoint. This method enables you to customize the log content using the `line-count` parameter: For example:
1515

16-
- Default 50,000 lines: `https://<pmm-server>/logs.zip`
17-
- Custom number of lines: `https://<pmm-server>/logs.zip?line-count=10000`
18-
- Unlimited, full log: `https://<pmm-server>/logs.zip?line-count=-1`
16+
- Default 50,000 lines: `https://<pmm-server>/v1/server/logs.zip`
17+
- Custom number of lines: `https://<pmm-server>/v1/server/logs.zip?line-count=10000`
18+
- Unlimited, full log: `https://<pmm-server>/v1/server/logs.zip?line-count=-1`
1919
3. Through the UI, by selecting the **Help > PMM Logs** option from the main menu.
2020
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.
2121
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.

documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ To ensure your MongoDB sharded cluster components appear in the correct sections
142142
- use the same `--cluster` name for all components of your sharded cluster
143143
- add each component (config servers, shard nodes, and mongos routers) as a separate service.
144144

145-
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).
145+
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).
146146

147147

148148
??? info "Example command for adding a MongoDB shard node"

documentation/docs/troubleshoot/pmm_dump.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The **dump.tar.gz** dump file is a .TAR archive compressed via Gzip. Here's what
2020
To create a dump of your dataset:
2121
{.power-number}
2222

23-
1. From the main menu on the left, go to <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
23+
1. From the top-right corner of the PMM home page, go to <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
2424
2. Click **Create dataset** to go to the **Export new dataset** page.
2525
3. Choose the service for which you want to create the dataset or leave it empty to export all data.
2626
4. Define the time range for the dataset.
@@ -33,7 +33,7 @@ To create a dump of your dataset:
3333
If you are a Percona Customer, you can securely share PMM data dumps with Percona Support via SFTP.
3434
{.power-number}
3535

36-
1. From the main menu on the left, go to <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
36+
1. From the top-right corner of the PMM home page, go to <i class="uil uil-question-circle"></i> **Help > PMM Dump**.
3737
2. Select the PMM dump entry which you want to send to Support.
3838
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**.
3939
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**.

managed/services/grafana/auth_server.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var rules = map[string]role{
6767
"/v1/actions/": viewer,
6868
"/v1/actions:": viewer,
6969
"/v1/backups": admin,
70-
"/v1/dump": admin,
70+
"/v1/dumps": admin,
7171
"/v1/accesscontrol": admin,
7272
"/v1/inventory/": admin,
7373
"/v1/inventory/services:getTypes": viewer,
@@ -84,13 +84,11 @@ var rules = map[string]role{
8484
"/v1/users": viewer,
8585

8686
// must be available without authentication for health checking
87-
"/v1/readyz": none, // TODO: remove before v3 GA
8887
"/v1/server/readyz": none,
8988
"/v1/server/leaderHealthCheck": none,
9089
"/ping": none, // PMM 1.x variant
9190

9291
// must not be available without authentication as it can leak data
93-
"/v1/version": viewer, // TODO: remove before v3 GA
9492
"/v1/server/version": viewer,
9593

9694
"/v1/qan": viewer,
@@ -103,6 +101,12 @@ var rules = map[string]role{
103101
"/swagger": none,
104102

105103
"/v1/server/logs.zip": admin,
104+
105+
// kept for backwards compatibility with PMM v2
106+
"/v1/readyz": none, // redirects to /v1/server/readyz
107+
"/v1/version": viewer, // redirects to /v1/server/version
108+
"/logs.zip": admin, // redirects to /v1/server/logs.zip
109+
106110
// "/auth_request" has auth_request disabled in nginx config
107111

108112
// "/" is a special case in this code

managed/services/grafana/auth_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ func TestAuthServerAuthenticate(t *testing.T) {
125125
"/v1/server/settings/readonly": viewer,
126126
"/v1/server/AWSInstance": none,
127127
"/v1/backups": admin,
128+
"/v1/dumps": admin,
128129
"/v1/accesscontrol": admin,
129130
"/v1/users": viewer,
130131
"/v1/platform:connect": admin,

0 commit comments

Comments
 (0)