LogoLogo
Login to CortexBook a DemoCortex Academycortex.ioCortex Status
  • Cortex Docs
  • Cortex Quick Start
  • Ingesting data into Cortex
    • Managing Entities
      • Adding entities
        • Add services
        • Add domains
        • Add teams
        • Add custom entity types
        • Defining dependencies
      • Entity details page
      • Defining ownership
      • Defining relationship types
      • Grouping entities
      • Adding external documentation
      • Adding Deploy data
      • Adding custom data
      • Viewing discovered entities
      • Archiving entities
      • Relationship graph
      • Using On-call Assistant for incidents
      • Managing Terraform infra in Cortex
    • Managing Catalogs
    • Integrations
      • Internally hosted integrations
      • ArgoCD
      • AWS
      • Azure DevOps
      • Azure Resources
      • BambooHR
      • Bitbucket
      • BugSnag
      • Buildkite
      • Checkmarx
      • CircleCI
      • ClickUp
      • Codecov
      • Coralogix
      • Custom webhook integrations
      • Datadog
      • Dynatrace
      • Entra ID (Azure AD)
      • FireHydrant
      • GitHub
      • GitLab
      • Google
      • Grafana
      • incident.io
      • Instana
      • Jenkins
      • Jira
      • Kubernetes
      • LaunchDarkly
      • Lightstep
      • Mend
      • Microsoft Teams
      • New Relic
      • Okta
      • Opsgenie
      • PagerDuty
      • Prometheus
      • Rollbar
      • Rootly
      • Sentry
      • Semgrep
      • ServiceNow
      • Slack
      • Snyk
      • SonarQube
      • Splunk Observability Cloud (SignalFx)
      • Splunk On-Call (VictorOps)
      • Sumo Logic
      • Veracode
      • Wiz
      • Workday
      • xMatters
  • Scorecards
    • Initiatives and Action items
      • Creating issues based on Initiatives
    • Scorecard rule exemptions
    • Scorecard rule filters
    • Scorecard examples
    • Scorecards as code
  • Reports
    • Executive report
    • All Scorecards report
    • Bird's eye report
    • Progress report
    • Report card
  • Eng Intelligence
    • Custom Metrics
    • Jira Metrics
    • Metrics Explorer (Beta)
    • Velocity Dashboard (Beta)
  • Cortex Query Language (CQL)
    • Running and saving CQL queries
    • Using CQL reports
    • Using JQ in Cortex
  • Workflows
    • Creating a Workflow
      • Workflows as code
    • Blocks
    • Running a Workflow
    • Registering a Scaffolder template
      • Scaffolder advanced usage
    • Using a Workflow to sync in ArgoCD
    • Kicking off a Jenkins pipeline in a Workflow
    • Calling internal service endpoints in a Workflow
  • Plugins
    • Creating a plugin
      • Creating a plugin proxy
    • Migrating Backstage plugins to Cortex
  • Engineering homepage
  • Workspace Settings
    • Using GitOps for Cortex
      • GitOps logs
    • Managing users
      • Roles and permissions
        • Custom roles
        • Team ownership entity editing
      • Configuring SSO
        • Microsoft Entra ID
        • Google
        • Other OIDC providers
        • Okta
          • Okta SCIM
      • Configuring identity mappings
      • Onboarding management
    • API keys, secrets, and tokens
      • Secrets
      • Personal tokens
    • Audit logs
    • Entity settings
      • Data verification
      • Auto archiving entities
    • IP allowlist
    • Notifications
      • Notification logs
    • Customizing your workspace
    • Using search in Cortex
  • Cortex API
    • REST API operations
      • API Keys
      • Audit Logs
      • Catalog Entities
      • Custom Data
        • Custom Data (Advanced)
      • Custom Events
      • Custom Metrics
      • Dependencies
      • Deploys
      • Discovery Audit
      • Docs
      • Eng Intel: User Labels
      • Entity Relationship Types (Beta)
      • Entity Relationships (Beta)
      • Entity Types
      • GitOps Logs
      • Groups
      • Initiatives
      • Integrations APIs
        • Azure Active Directory (Entra ID) API
        • Azure Resources API
        • AWS API
        • Azure DevOps API
        • CircleCI API
        • Coralogix API
        • Datadog API
        • GitHub API
        • GitLab API
        • incident.io API
        • LaunchDarkly API
        • New Relic API
        • PagerDuty API
        • Prometheus API
        • SonarQube API
      • IP Allowlist
      • Notification Logs
      • On call
      • Packages
      • Plugins
      • Queries
      • SCIM
      • Scorecards
      • Secrets
      • Team Hierarchies
      • Teams
      • Workflows
Powered by GitBook
On this page
  • Overview
  • How to configure Datadog with Cortex
  • Prerequisites
  • Configure the integration in Cortex
  • How to connect Cortex entities to Datadog
  • Tag discovery
  • Import entities from Datadog
  • Editing the entity descriptor
  • Dependency mapping
  • Using the Datadog integration
  • View Datadog monitors and SLOs on entity pages
  • Scorecards and CQL
  • Discovery audit
  • Background sync
  • FAQs and troubleshooting

Was this helpful?

Export as PDF
  1. Ingesting data into Cortex
  2. Integrations

Datadog

Last updated 5 days ago

Was this helpful?

Overview

is an application performance monitoring platform that provides real-time observability into entities, servers, databases, and tools, providing developers with a comprehensive understanding of their infrastructure as well as the ability to identify areas for improvement.

Cortex is uniquely equipped to augment Datadog's tools, providing greater visibility into your entities. In this guide, you'll learn how to set up the Datadog integration to pull in services and metrics for entities:

  • Monitors

  • SLOs

  • Dependencies

How to configure Datadog with Cortex

Prerequisites

Before getting started, make sure you have created the following:

    • You can create this in Datadog under Organizational Settings > Applications Key.

    • Include the following scopes:

      • monitors_read

      • apm_api_catalog_read

      • dashboards_read

      • metrics_read

      • timeseries_query

      • apm_service_catalog_read

      • slos_read

      • apm_read

    • You can create this in Datadog under Organizational Settings > API Key.

Configure the integration in Cortex

    1. In Cortex, click your avatar in the lower left corner, then click Settings.

    2. Under "Integrations", click Datadog.

  1. Click Add configuration.

  2. Configure the Datadog integration form:

    • Account alias: Enter a name that Cortex will associate this configuration with.

    • App key: Enter the application key you generated in Datadog.

      • This key appears under the Key column in Datadog while viewing your list of Application Keys.

    • API key: Enter the API key you generated in Datadog.

    • Custom subdomain: Enter the custom subdomain for your Datadog instance.

      • This field only takes the subdomain, not the entire URL. For example, this field would take cortex-docs from https://cortex-docs.datadoghq.com.

    • Environments: Optionally, enter environment tags for Datadog entities.

  3. Click Save.

After saving your configuration, you are redirected to the Datadog integration settings page in Cortex. In the upper right corner of the page, click Test configuration to ensure Datadog was configured properly.

The Datadog integration has multi-account support. You can add a configuration for each additional by repeating the process above.

Each configuration requires an alias, which Cortex uses to correlate the designated with registrations for various entities. Registrations can also use a default configuration without a listed alias. You can edit aliases and default configurations from the Datadog page in your Cortex settings. Select the edit icon next to a given configuration and toggle Set as default on. If you only have one configuration, it will automatically be set as the default.How to connect Cortex entities to Datadog

How to connect Cortex entities to Datadog

Tag discovery

If your Datadog tags don’t cleanly match the Cortex entity tag, you can override this in the Cortex entity descriptor.

Import entities from Datadog

Editing the entity descriptor

You can use service tags to connect Datadog services to Cortex entities.

x-cortex-apm:
  datadog:
    serviceTags:
      - tag: entity
        value: brain
        alias: my-default-alias
      - tag: entity
        value: cerebrum
        alias: my-other-alias
Field
Description
Required

tag

Tag for the project in Datadog

✓

value

Value for the project; Cortex will find monitors and SLOs by querying tag:value OR tag:value2 ...

✓

alias

Alias for the configuration in Cortex (only needed if you have opted into multi-account support)

These tags are used to "discover" your monitors and SLOs. Cortex will find monitors and SLOs by querying tag:value OR tag:value2 ...

If you want to hard code and/or override discovery, you can define a monitor or SLOs block in the entity descriptor, as described below.

Monitors and SLOs

The ID of a monitor is found in the URL when you click on a monitor in your Datadog dashboard i.e., https://app.datadoghq.com/monitors/****.

info:
  x-cortex-apm:
    datadog: 
      monitors:
        - id: 12345
          alias: my-default-alias
        - id: 67890
          alias: my-other-alias

The ID for the SLO can be found in the URL when you click on an SLO in the Datadog dashboard. For example, https://app.datadoghq.com/slo?slo_id=****&timeframe=7d&tab=status_and_history.

info:
  x-cortex-slos:
    datadog:
      - id: 0b73859a3e2504bf09ad23a161702654
        alias: my-default-alias
      - id: 228499184a9efe34d4e4e9df838c7fa1
        alias: my-other-alias

Monitors and SLOs have the same field definitions.

Field
Description
Required

id

Datadog ID for the monitor or SLO

✓

alias

Alias for the configuration in Cortex (only needed if you have opted into multi-account support)

Dependency mapping

If you have two entities - for example, entity-one and entity-two - that have a dependency edge in Datadog's Service Map, both entities should exist in Cortex with the same entity identifiers.

If the entity tag in Cortex does not exactly match the entity identifier in Datadog, the dependencies will not automatically sync. You can override automatic discovery by defining values in the entity descriptor.

You can connect an APM service for dependency mapping in the entity descriptor:

x-cortex-apm:
  datadog:
    serviceName: cortex-gateway.gateway

Using the Datadog integration

View Datadog monitors and SLOs on entity pages

With the Datadog integration, you'll be able to find monitors and SLOs on an entity's home page. High-level information about monitors and SLOs appears in the Overview tab.

Click Monitoring in the entity's sidebar to see more detailed data about both monitors and SLOS. Both sections display tags for Pass, Fail, Warning, and No Data for each monitor or SLO.

  • The SLOs column shows each SLO, its target(s), the current value for that entity, its status. and the period of time the SLO is being calculated for. For example, if the time listed is "7 days ago," then the SLO is looking at the time range starting 7 days ago to now..

  • The Monitors column shows the title for each monitor, its query (if available), and its status.

Clicking any block with a nonzero value will open a modal with more detailed information. The monitor modals will list all monitors with the applicable status. The SLO modals will also display targets for each SLO that is passing or failing.

Scorecards and CQL

With the Datadog integration, you can create Scorecard rules and write CQL queries based on Datadog metrics, monitors, and SLOS.

Metrics
  • Metric

  • Timestamp

Definition: datadog.metrics(query: Text, lookback: Duration, alias: Text | Null)

Example

You can use the datadog.metrics() expression to evaluate the health of your entities in a Scorecard:

datadog.metrics(query="system.cpu.usage{service:" + datadog.serviceNames().join(" OR service:") + "}",lookback=duration("P2D")).averageBy((point) => point.metricValue) < 0.10

This rule makes sure that a given entity's average CPU usage is less than 10% over the last two days.

Monitors

Monitors associated with a given entity via ID or tags. You can use these data to check whether an entity has monitors associated with it, or whether an entity has the right types of monitors.

  • Created at

  • Creator email

  • Creator name

  • Name

  • Overall state

  • Query

  • Tags

  • URL

Definition: datadog.monitors()

Example

For a Scorecard focused on operational maturity, this expression can be used to make sure an entity has at least one Datadog monitor set up:

datadog.monitors().length >= 1
SLOs

SLOs associated with a given entity via ID or tags. You can use these data to check whether an entity has SLOs associated with it and if those SLOs are passing.

  • History

  • ID

  • Name

  • Operation

  • Remaining budget

  • SLI value

    • Datum

    • Timeseries

  • SLO target

  • Source

  • Thresholds

    • Name

    • Threshold

Definition: slos()

Examples

For a Scorecard focused on operational maturity, this expression can be used to make sure an entity has associated SLOs in Datadog:

slos().length > 0

This rule checks that there is at least one SLO is set up. While this rule makes sense in a Scorecard's first level, a rule checking the status of the SLO would make sense in a higher level:

slos().all((slo) => slo.passing)

Entities will pass this rule if all SLOs associated with it have "passing" status.

Discovery audit

Background sync

The dependency sync runs automatically each day at 12 a.m. UTC, and can be run manually via the Sync dependencies button.

FAQs and troubleshooting

Can I set a Scorecard rule to monitor Datadog monitors/SLOs based on tags?

How does Datadog work with other dependency sources?

When leveraging multiple dependency sources such as Datadog and a catalog entity's YAML, all the sources would be merged together and Cortex will de-duplicate the dependencies.

For example, if an entity YAML indicates X → Y and Datadog indicates X → Y and X → Z, the entity will display two edges presented as X → Y and X → Z.

In Cortex, navigate to the :

Region: Select your from the dropdown.

If you set an environment tag here, make sure to set the to match.

Configure the integration for multiple Datadog accounts

By default, Cortex will use the (e.g. my-entity) as the "best guess" for Datadog tag. For example, if your entity tag is my-entity, then the corresponding tag in Datadog should also be my-entity.

See the for instructions on importing entities.

Adding monitors let you see information about their current status directly from a catalog - via the Monitors column - and under the Operations section of an entity page. You can find your monitors from Datadog's .

Like monitors, Datadog SLOs can be found in the Operations section of an entity page. You can find the SLOs for your instance on Datadog's .

Cortex automatically syncs dependencies from Datadog's , using the entity identifier (x-cortex-tag) to map entities found in the Service Map.

The relationships Cortex discovers through the integration will feed directly into the , so you can easily visualize the connections between your entities.

You can override this by where tag = entity and value = entity name in Datadog Service Map.

See more examples in the in Cortex.

You can read more about Datadog's and in their docs.

from Datadog.

Cortex will pull recent changes from your Datadog environment into the . Here, you can find new entities in Datadog that have not been imported into the catalog - these will have the tag New APM Resource - as well as entities in the catalog that no longer exist in Datadog - these will have the tag APM Resource Not Detected.

Yes, you can that allow Cortex to discover your SLOs and monitors, and use these tags in Scorecard rules.

Datadog
Datadog application key
Datadog API key
Datadog settings page
Datadog region
env dropdown in Datadog
​
Manage Monitors page
SLO status page
Service Map
Relationships graph
CQL Explorer
metrics
custom metrics
Timeseries data
discovered entities list
defining entity tags
specify key-value pairs
entity tag
Create services documentation