How to disable Stackdriver Monitoring for a project
Solution 1:
You need to remove the project from your stackdriver account. This will stop the monitoring and not affect your log collecting solution. To remove the project follow the steps listed here:
- https://cloud.google.com/monitoring/accounts/guide#remove-project
Remove Project from Stackdriver Account
Open the Monitoring console.
Select the Stackdriver account that contains the project or AWS connector from the drop-down menu at the top-right of the Monitoring console.
Select Account Settings from the same menu.
On the "Settings" page, click Monitored accounts. You see the following page:
Locate the project or AWS connector you want to remove and select Remove from account from the menu to the right of the project's name.
Delete Stackdriver Account (Applicable if you have only 1 account)
Additionally, if you need to delete your stackdriver account, you need to delete the project that is hosting your stackdriver account in the GCP console:
https://cloud.google.com/monitoring/accounts/guide#delete-account
To delete a Stackdriver account, delete the account's hosting project in the GCP Console. The hosting project has the same name as the account. It is not possible to separate the Stackdriver account from the hosting project without deleting the hosting project.
Stackdriver removes any additional monitored GCP projects or AWS accounts associated with the deleted Stackdriver account. To avoid the loss of monitoring data and logs from these projects, see the sections on Moving projects to a different Stackdriver account, and Merging Stackdriver accounts.
Solution 2:
You can unlink your GCP project from a Stackdriver workspace by Merging the workspace into a new, blank workspace.
Before following these steps, you will need to create an empty project in GCP that you can later delete.
Make sure to unlink the GCP project that you want to keep from the merged workspace before deleting the empty project that hosts the new workspace.
These instructions are taken from here: https://cloud.google.com/monitoring/workspaces/guide#merge-account
Merging Workspace A into Workspace B moves all the GCP projects except AWS connector projects from Workspace A to Workspace B. Specifically, here is the effect of merging A into B:
- All GCP projects that were added to Workspace A are moved into Workspace B.
All AWS accounts in Workspace A are removed from A. You have to manually add the accounts to Workspace B. You can delete the AWS connector projects unless you need to retrieve the AWS account's logs from them. The project that hosts Workspace A is added to Workspace B, even if the project is empty.
The host project is the project you use to create the Workspace. This project typically has resources in the case of a single-project Workspace but is empty for a multi-project Workspace. Merging is the only way to separate this project from its Workspace.
All the monitoring and other configuration information in Workspace A is deleted. This includes dashboards, alerting policies, uptime checks, and so on. Workspace A no longer exists.
To merge Workspaces, do the following:
Open the Stackdriver Monitoring console.
If necessary, create Workspace B using an empty project.
Select the Workspace that is to be kept ("B" in this scenario) from the drop-down menu at the top-right of the Monitoring console.
Select Workspace Settings from the same menu.
Click Monitored accounts from the left-side menu.
Click Merge another Workspace into this one.
Select the Workspace that is to be removed ("A" in this scenario).
Read about what information is lost during the merge.
Click Merge.
You can then delete the newly created empty project/workspace
Deleting a Workspace
Before deleting a Workspace, check if project you used to create the Workspace has resources you want to preserve, or if the Workspace is still linked to additional GCP projects or AWS accounts. If so, see Merging Workspaces for a way to move resources to another place before deleting the Workspace.
If your Workspace project has nothing of value, then delete the Workspace by deleting the Workspace's project in the GCP Console. Go to IAM & admin > Settings and click Shut Down.