How to remove collected data in PMM after removing a service?

Description:

We want to provide collected data of a mysql in PMM to vendor to analyze issue.
Since PMM contains data of mysql and we cannot provide the whole VM to vendor.

One of the solution is to clone VM in our env and remove data of other services. Then, provide the resulted VM to vendor.

From PMM document, removing service does not remove collected according to link (pmm-admin - PMM Administration Tool - Percona Monitoring and Management)

Can we remove the collected data after removing a service?

Steps to Reproduce:

typical add service and remove service

Version:

PMM version 2.9.1 docker container

Logs:

N/A

Expected Result:

remove corresponding data after removing a specific service

Actual Result:

remove service does not remove collected data of it in PMM according to link (pmm-admin - PMM Administration Tool - Percona Monitoring and Management)

Additional Information:

N/A

Hi @frelist

Are you using 2.9.1 version?

Here is a command for the latest pmm version.
You should set the correct service_name

curl -s -G -u admin:admin http://127.0.0.1/prometheus/api/v1/admin/tsdb/delete_series -d 'match={__name__=~".*",service_name=~"pmm-server-postgresql"}'

Hi @Vadim_Yalovets ,

Thanks for the reply. We are using PMM version 2.9.1

We got the service from PMM inventory and tried the command. But got message “Method Not Allowed”. We are using admin account already.

Regards,
William Wong

Hi

Please use the next command for your installation with the correct service name. It’s used pmm-server-postgresql in the example.

curl -X POST -u admin:admin -g ‘http://localhost/prometheus/api/v1/admin/tsdb/delete_series?match[]={__name__=~“.*”,service_name=~“pmm-server-postgresql”}

@frelist, you can also use a new feature in PMM PMM 2.41.0 - Percona Monitoring and Management to create a dump and share it with a vendor.
This feature will allow other users to restore the PMM data (Metrics and QAN) to analyze.
This will also allow you to dump specific services; not all services are added to the PMM.

For more details, Export PMM data with PMM Dump - Percona Monitoring and Management
and
Installation - PMM Dump

In Percona Monitoring and Management (PMM), the process of removing a service using the pmm-admin tool does not inherently trigger the automatic removal of historical collected data associated with that service. The removal of a service primarily pertains to halting the monitoring and ceasing the collection of new data. To facilitate a comprehensive cleanup, especially in the context of B2B API integration, administrators may need to implement additional steps or integrate specific procedures to ensure the systematic removal of both current and historical data linked to the discontinued service. This ensures a streamlined approach to data management and aligns with best practices in B2B API integration scenarios.