Connect to Datadog
You can connect to Datadog and make it available as a resource. Once complete, you can write queries to interact with the Datadog API.
Requirements
All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.
To create your Datadog resource, you need:
- REST API connection details.
- The API version you want to use.
- Your API Key.
- Your Application Key.
Datadog uses API token authentication. You must provide an API token for Retool to authorize requests. Requests that read data also require an Application Key. Refer to the Datadog documentation on authenticating requests to learn how to obtain your API and Application keys.
If Datadog is behind a firewall, you must also allow access from Retool's IP addresses. Add these IP addresses to your firewall's allowlist before you create the resource.
1. Create a new resource
Sign in to your Retool organization and navigate to the Resources tab. Click Create new, then select Resource.
Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Select the Datadog integration.
2. Configure the resource
Provide the necessary details to configure the resource so Retool can connect to Datadog. Not all settings are required but refer to the Datadog documentation to learn what is needed.
General
These settings configure the name and location of the resource within Retool.
Name
The name to use for the resource (e.g., Datadog).
Folder
The folder in which to save the resource.
Description
A brief description of the resource (e.g., Customer data).
Credentials
These settings configure how Retool connects to Datadog.
Server URL
The base URL for the Datadog API. This is set automatically using the Server variables values.
Server variables
Key-value pairs used to generate the server URL. These are set automatically.
API version
The Datadog API version to use in requests.
API Key
The API Key used to authenticate requests.
Application Key
The Application Key used in requests to read data.
3. Save the resource
Click Create resource to complete the setup. You can then click either Create an app to immediately start building a Retool app or Back to resources to return to the list of resources.
Wrap up
Your Datadog resource is now ready to use. You write queries to make API requests by specifying the request method and endpoint, additional parameters to include, and the request body.
To verify you can successfully interact with Datadog, write a test query to retrieve some data. The following example retrieves the event record for the specific event.
- Request
- Response
GET https://api.datadoghq.com/api/v1/events/1234
{
"event": {
"alert_type": "info",
"date_happened": "1684511704",
"device_name": "my_device",
"host": "my_host",
"id": "1234",
"payload": "{}",
"priority": "normal",
"source_type_name": "my_apps",
"tags": [
"environment:test"
],
"text": "Event 1234",
"title": "This is event 1234"
}
}