Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 1 addition & 1 deletion api/server/v1/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ message ChangeSettingsRequest {
optional bool enable_updates = 1;
optional bool enable_telemetry = 2;
MetricsResolutions metrics_resolutions = 3;
// A number of full days for Prometheus and QAN data retention. Should have a suffix in JSON: 2592000s, 43200m, 720h.
// A number of full days for Prometheus and QAN data retention. Must be specified in seconds in JSON, for example: 2592000s.
google.protobuf.Duration data_retention = 4;
optional string ssh_key = 5;
optional common.StringArray aws_partitions = 6;
Expand Down
54 changes: 52 additions & 2 deletions documentation/api/pmm-server-config/pmm-server-settings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: PMM Server Settings
title: Configure PMM Server settings
slug: pmm-server-settings
category:
uri: pmm-server-maintenance
Expand All @@ -8,4 +8,54 @@ privacy:
view: anyone_with_link
---

This section will explain how to configure your PMM Server to get the most out of its functionality.
You can use the PMM Server Settings API to retrieve and update your PMM Server configuration programmatically. Use [Get settings](ref:getsettings) to check the current configuration, and [Change settings](ref:changesettings) to update it.

## Get current settings

```sh
curl -X GET https://<pmm-server-address>/v1/server/settings \
-H "Authorization: Basic <base64-encoded-credentials>"
Comment thread
catalinaadam marked this conversation as resolved.
Outdated
```

## Change settings

```sh
curl -X PUT https://<pmm-server-address>/v1/server/settings \
-H "Authorization: Basic <base64-encoded-credentials>" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to be consistent with the rest of the documentation, where we promote the use of Service Account Tokens, not the Basic Auth: -H "Authorization: Bearer glsa_xxxxx.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ademidoff thanks, updated with commit a36a5ba

-H "Content-Type: application/json" \
-d '{"data_retention": "2592000s"}'
```

## Field reference

### data_retention

Use this field to set how long PMM retains Prometheus and QAN data. You must express the value in seconds. If you use hours or minutes, the request will fail with an error.

| Format | Example | Supported |
|--------|---------|--------|
| Seconds | `2592000s` | ✔ |
| Minutes | `43200m` | ✘ |
| Hours | `720h` | ✘ |

Common values:

| Retention period | Value |
|-----------------|-------|
| 7 days | `604800s` |
| 30 days | `2592000s` |
| 90 days | `7776000s` |

### metrics_resolutions

Use this field to control how frequently PMM collects metrics. You can set high (`hr`), medium (`mr`), and low (`lr`) resolution intervals independently:

```json
{
"metrics_resolutions": {
"hr": "5s",
"mr": "10s",
"lr": "60s"
}
}
```
6 changes: 6 additions & 0 deletions documentation/docs/configure-pmm/advanced_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

**Data retention** specifies how long data is stored by PMM Server. By default, time-series data is stored for 30 days. You can adjust the data retention time to balance your system's available disk space with your metrics history requirements.

### Set data retention via the API

If you configure data retention using the [Change Settings API](https://percona-pmm.readme.io/reference/changesettings) (`PUT /v1/server/settings`), express the value in seconds. Hours and minutes formats are not supported and will return an error.

For example, to set 30-day retention: `"data_retention": "2592000s"`

## Telemetry

The **Telemetry** switch enables gathering and sending basic **anonymous** data to Percona, which helps us to determine where to focus the development and what is the uptake for each release of PMM.
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/release-notes/3.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For the full list of available collectors per database type, see [Connect MySQL

- [PMM-15118](https://perconadev.atlassian.net/browse/PMM-15118): Fixed the **Oplog GB/Hour** panels in the **MongoDB ReplSet Summary**, **MongoDB Sharded Cluster Summary**, and **MongoDB Oplog Details** dashboards showing an empty metric name in the legend instead of the service name.

- [PMM-15114](https://perconadev.atlassian.net/browse/PMM-15114): Fixed the **Scanned and Moved Objects** panel in the **MongoDB Instance Summary** dashboard showing blank labels in the legend instead of the operation type (`scanned`, `scanned_objects`).
- [PMM-13911](https://perconadev.atlassian.net/browse/PMM-13911): Fixed misleading API documentation that caused `data_retention` requests to fail. If you set data retention via the [Change Settings](https://percona-pmm.readme.io/reference/changesettings) API, use seconds only (for example, `2592000s` for 30 days). Hours and minutes are not accepted.



Loading