Master GCP Monitoring with Datadog: Google Cloud integration with Datadog
Introduction
This article demonstrates the integration process of Google Cloud with Datadog, illustrating how to effectively monitor your Google Cloud environment using Datadog.
We will be using Datadog free trial account for this demo.
Lets Get started
Go to https://www.datadoghq.com/ and Click on Free Trial.
2. Fill Required details and sign up
Now Create Datadog Principal
- In Datadog, navigate to the Integrations > Google Cloud Platform .
- Click on Add GCP Account. If you have no configured projects, you are automatically redirected to this page.
- If you have not generated a Datadog principal for your org, click the Generate Principal button.
Copy your Datadog principal and keep it for the next section
Now , In order to integrate Datadog with Google Cloud, it’s essential for Datadog to access Logging and Monitoring data from Google Cloud. To establish this connection, setting up authentication between these platforms is crucial, which involves utilizing a Service Account.
Create your Google Cloud service account
- Open your Google Cloud console .
- Navigate to IAM & Admin > Service Accounts.
- Click on Create service account at the top.
- Give the service account a unique name, then click Create and continue.
- Add the following roles to the service account:
- Monitoring Viewer
- Compute Viewer
- Cloud Asset Viewer
- Browser
Click Continue, then Done to complete creating the service account.
- In Google Cloud console , under the Service Acounts menu, find the service account you created in the first section .
- Go to the Permissions tab and click on Grant Access
- Paste your Datadog principal into the New principals text box.
- Assign the role of Service Account Token Creator and click Save.
Now Validate Infrastructure List ,Showing Availavle VM Instance
Serverless Tab to See Metrics related to Cloud Run and Cloud Function
Now we will see how to send Google Cloud logs to Data Dog
- Go to the Cloud Pub Sub console and create a new topic.
- Give that topic an explicit name such as
export-logs-to-datadog
and Save. - Go back to the Pub/Sub that was previously created, and add a new
subscription
. - Select the
Push
method and enter the followinghttps://gcp-intake.logs.us5.datadoghq.com/api/v2/logs?dd-api-key=<YOUR_DATADOGA_API_KEY>&dd-protocol=gcp
- Verify if above datadog URL is correct for your datadog instance and replace with your datadog URL.
- Hit
Create
at the bottom. - Go to Log Router and filter the logs that need to be exported.
- Hit
Create Export
and name the sink accordingly. - Choose
Cloud Pub/Sub
as the destination and select the Pub/Sub that was created for that purpose. Note that the Pub/Sub can be located in a different project. - Hit
Create
and wait for the confirmation message to show up. - Lets wait for sometime to receive logs.
Now we can analysze all logs in Datadog.
Refer below video for demo
About Me
As an experienced Fully certified (11x certified) Google Cloud Architect with over 7+ years of expertise in Google Cloud Networking,Data ,Devops, Security and ML, I am passionate about technology and innovation. Being a Champion Innovator and Google Cloud Architect, I am always exploring new ways to leverage cloud technologies to deliver innovative solutions that make a difference.
If you have any queries or would like to get in touch, you can reach me at my email address vishal.bulbule@techtrapture.com or connect with me on LinkedIn at https://www.linkedin.com/in/vishal-bulbule/. For a more personal connection, you can also find me on Instagram at https://www.instagram.com/vishal_bulbule/?hl=en.
Additionally, please check out my YouTube Channel at https://www.youtube.com/@techtrapture for tutorials and demos on Google Cloud.