steampipe plugin install datadogsteampipe plugin install datadog

Datadog + Steampipe

Datadog is the essential monitoring and security platform for cloud applications.

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

For example:

select
name,
type,
overall_state
from
datadog_monitor
where
overall_state in ('Alert', 'Warn');
+-------------------------------+---------------+---------------+
| name | type | overall_state |
+-------------------------------+---------------+---------------+
| Spend Alert | query alert | Alert |
| [Auto] Clock in sync with NTP | service check | Warn |
+-------------------------------+---------------+---------------+

Documentation

Get started

Install

Download and install the latest Datadog plugin:

steampipe plugin install datadog

Configuration

Installing the latest datadog plugin will create a config file (~/.steampipe/config/datadog.spc) with a single connection named datadog:

connection "datadog" {
plugin = "datadog"
# Get your API key from https://app.datadoghq.com/organization-settings/api-keys
# Steampipe will resolve the API key in below order:
# 1. The "api_key" specified here in the config
# 2. The `DD_CLIENT_API_KEY` environment variable
# api_key = "1a2345bc6d78e9d98fa7bcd6e5ef56a7"
# Get your application key from https://app.datadoghq.com/organization-settings/application-keys
# Steampipe will resolve the application key in below order:
# 1. The "app_key" specified here in the config
# 2. The `DD_CLIENT_APP_KEY` environment variable
# app_key = "b1cf234c0ed4c567890b524a3b42f1bd91c111a1"
# The API URL. By default it is pointed to "https://api.datadoghq.com/"
# If working with the EU version of Datadog, use "https://api.datadoghq.eu/"
# Please note that this URL must not end with the /api/ path.
# api_url = "https://api.datadoghq.com/"
}
  • api_key (required) - API keys are unique to an organization. An API key is required by the Datadog Agent to submit metrics and events to Datadog. Get an API key. May alternatively be set via the DD_CLIENT_API_KEY environment variable.

  • app_key (required) - Application keys in conjunction with organization’s API key, give users access to Datadog’s programmatic API. Application keys are associated with the user account that created them and have the permissions and capabilities of the user who created them. Get an application key. May alternatively be set via the DD_CLIENT_APP_KEY environment variable.

  • api_url (optional) - The API URL used for all requests. Defaults to "https://api.datadoghq.com/". If working with the EU version, this should be changed to "https://api.datadoghq.eu/".

Get Involved

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- datadog

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_datadog;
CREATE SERVER steampipe_datadog FOREIGN DATA WRAPPER steampipe_postgres_datadog OPTIONS (config '<your_config>');
CREATE SCHEMA datadog;
IMPORT FOREIGN SCHEMA datadog FROM SERVER steampipe_datadog INTO datadog;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- datadog

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_datadog function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_datadog.so
sqlite> select steampipe_configure_datadog('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- datadog

You can pass the configuration to the command with the --config argument:

steampipe_export_datadog --config '<your_config>' <table_name>