Logging and Monitoring Setup
Default Dashboard
- Navigate to the Monitoring section where you can find the Dashboard section on the left as shown in the image below
- Where you can see the available services for monitoring, choose the service you want
- Here you can find the cloud run services we have created. Select the cloud run you want to view
Logging
- Navigate to Cloud Logging → Logs Explorer
- Cloud Logging stores all logs in a centralized location. In the Logs Explorer, you can navigate to the logs for a specific resource, create alerts, and run queries to filter logs quickly.
We can also view the logs in the console of specific services
To View cloud run logs:
- Navigate to cloud run
- Click the name of the cloud run svc
- Navigate to the logs as shown below
Slack Alert Notification
- Navigate to notification channels
- Navigate to slack and click on add new
- Allow Google Cloud Monitoring to access your slack workspace
- Give your Slack Channel Name and Cloud Alerting Display Name
Deployment Pipelines
For infrastructure and application deployment, all is managed through Terraform Cloud consisting of multiple projects [ sts-nonprod-gcp, sts-prod-gcp, sts-bootstrap-gcp ], each of these projects further consist multiple workspaces related to infra, apps, monitoring, and alerts.
Terraform Cloud
Modules are being published in the Terraform Cloud registry for each individual resource for GCP. These root modules are then called out in workspaces as and when required.
We have below workspaces created for GCP Non-Prod environment,
Arthur-gcp-bootstrap : This is for a bootstrap project, Artifact Registry is present. Arthur-gcp-nonprod-control-plane-infra : This is for infra deployment. Arthur-gcp-nonprod-control-plane-apps : This is for app deployment. Arthur-gcp-nonprod-control-plane-monitoring : This is for control plane monitoring. Arthur-gcp-nonprod-control-plane-alerts : This is for control plane alerts. Arthur-gcp-nonprod-data-plane-infra : This is for infra deployment. Arthur-gcp-nonprod-data-plane-apps : This is for app deployment. Arthur-gcp-nonprod-data-plane-monitoring : This is for data plane monitoring. Arthur-gcp-nonprod-data-plane-alerts : This is for data plane alerts.
To replicate the same single tenant for different environments, we need to make a copy of the above eight [2 to 9] workspaces, update the tfvars file as required and add the service account in bootstrap project for pulling images to the new projects created.
Need to add the service account key which is used for terraform deployment as a workspace variable in Terraform Cloud, so it can authenticate with GCP and start the deployments.
Updated 1 day ago