Skip to main content
Datadog integration plugin for Soundcheck. Datadog integration plugin supports the extraction of the following facts:

Prerequisites

Configure Datadog integration in Backstage

Integrations are configured at the root level of app-config.yaml, here’s an example configuration for Datadog:

Add the DataDogFactCollector to Soundcheck

First add the package:
Then add the following to your packages/backend/src/index.ts file:
packages/backend/src/index.ts
Consult the Soundcheck Backend documentation for additional details on setting up the Soundcheck backend.

Plugin Configuration

Collection of facts is driven by config. To learn more about the config, see the Defining Datadog Fact Collectors. Datadog Fact Collector can be configured via YAML or No-Code UI. If you configure it via both YAML and No-Code UI, the configurations will be merged. It’s preferable to choose a single source for the Fact Collectors configuration (either No-Code UI or YAML) to avoid confusing merge results.

No-Code UI Configuration Option

  1. Make sure the prerequisite Configure Datadog integration in Backstage is completed and Datadog instance details are configured.
  2. To enable the Datadog Integration, go to Soundcheck > Integrations > Datadog and click the Configure button. To learn more about the No-Code UI config, see the Configuring a fact collector (integration) via the no-code UI.
Datadog
Integration

YAML Configuration Option

  1. Create datadog-facts-collectors.yaml in the root of your Backstage repository and fill in all your Datadog fact collectors. A simple example Datadog fact collector is listed below.
Note: this file will be loaded at runtime along with the rest of your Backstage configuration files, so make sure it’s available in deployed environments in the same way as your app-config.yaml files.
  1. Add a soundcheck collectors field to app-config.yaml and reference the newly created datadog-facts-collectors.yaml

Rate Limiting (Optional)

This fact collector can be rate limited in Soundcheck using the following configuration:
In this example the fact collector is limited to 1000 executions per minute. This fact collector handles 429 rate limit errors from Datadog. Soundcheck will automatically wait and retry requests that are rate limited.

Defining Datadog Fact Collectors

This section describes the data shape and semantics of Datadog Fact Collectors.

Overall Shape Of A Datadog Fact Collector

The following is an example of a descriptor file for a Datadog Fact Collector:
See below for details about these fields.

baseUrl [optional]

The base URL of the Datadog instance to use. If not provided, the plugin will attempt to use the default URL https://api.datadoghq.com.

appKey [optional]

The Datadog appKey to use for authentication.

apiKey [optional]

The Datadog apiKey to use for authentication.

collects [required]

An array describing which facts to collect and how to extract them. See below for details about the overall shape of a fact extractor.

Overall Shape Of A Fact Extractor

Each extractor supports the fields described below.

type [required]

The type of the extractor (e.g. service-definition, service-level-objective).

frequency [optional]

The frequency at which the fact extraction should be executed. Possible values are either a cron expression { cron: ... } or HumanDuration. If provided it overrides the default frequency provided at the top level. If not provided it defaults to the frequency provided at the top level. If neither extractor’s frequency nor default frequency is provided the fact will only be collected on demand. Example:

initialDelay [optional]

The amount of time that should pass before the first invocation happens. Possible values are either a cron expression { cron: ... } or HumanDuration. Example:

batchSize [optional]

The number of entities to collect facts for at once. Optional, the default value is 1. Note: Fact collection for a batch of entities is still considered as one hit towards the rate limits by the Soundcheck Rate Limiting engine, while the actual number of hits will be equal to the batchSize. Example:

filter [optional]

A filter specifying which entities to collect the specified facts for. Matches the filter format used by the Catalog API. If provided it overrides the default filter provided at the top level. If not provided it defaults to the filter provided at the top level. If neither extractor’s filter nor default filter is provided the fact will be collected for all entities. See filters for more details.

exclude [optional]

Entities matching this filter will be skipped during the fact collection process. Can be used in combination with filter. Matches the filter format used by the Catalog API.

cache [optional]

If the collected facts should be cached, and if so for how long. Possible values are either true or false or a nested { duration: HumanDuration } field. If provided it overrides the default cache config provided at the top level. If not provided it defaults to the cache config provided at the top level. If neither extractor’s cache nor default cache config is provided the fact will not be cached. Example:

Entity configuration

In your catalog-info.yaml add the following metadata annotation to allow the plugin to map an entity to a service in Datadog. Make sure your SLO is tagged service:service-id in Datadog so that it can be mapped too.
NoteThe datadoghq.com/service-id annotation is required for the integration to work, if this is missing then we will not be able to collect the facts for the entity

Collecting Service Definition Fact

A service definition fact contains information about service definition from Datadog Service Definition API.

Shape of A Service Definition Fact Collector

The shape of a Service Definition Fact Collector matches the Overall Shape Of A Datadog Fact Collector (restriction: type: service-definition). The following is an example of the Service Definition Fact Collector config:

Shape of A Service Definition Fact Check

The shape of a service-definition Fact Check matches the Shape of a Fact Check. The following is an example of the service-definition fact check:
The following is an example response from the Service Definition Fact collector. See Datadog’s documentation for more detail.

Collecting Service Level Objective Fact

An service-level-objective fact contains information about service-level-objective from Datadog Service Level Objective API.

Shape of A Service Level Objective Fact Collector

The shape of an Service Level Objective Fact Collector matches the Overall Shape Of A Datadog Fact Collector (restriction: type: service-level-objective). The following is an example of the Service Level Objective Fact Collector config:

Shape of A Service Level Objective Fact Check

The shape of a service-level-objective Fact Check matches the Shape of a Fact Check. The following is an example of the service-level-objective fact check:
The following is an example response from the Service Level Objective Fact collector. See Datadog’s documentation for more detail.

Shape of A Datadog Track

The following is an example of the Soundcheck track that utilizes these checks