Datadog Integration
Connect Datadog to pull CI Visibility test results, code coverage, and monitor events into Koalr.
Connecting Datadog lets Koalr pull CI Visibility data — test pass rates, code coverage percentages, flaky test counts, and pipeline duration — into the Coverage and Code Health dashboards.
What Koalr syncs
- CI test results — pass/fail/skip rates per pipeline run and repository
- Code coverage —
@test.code_coverage.lines_pcttag from CI Visibility pipelines - Flaky tests — tests with inconsistent results across runs, as reported by Datadog
- Pipeline duration — build time trends per branch and service
- Service catalog — service-to-team mapping used in dependency analysis (if configured)
Prerequisites
- Datadog account with CI Visibility enabled (requires the APM or CI plan)
- An API Key and an Application Key with
ci_readscope
Connecting Datadog
- Go to Settings → Integrations → Datadog → Connect
- Paste your API Key from Datadog's organization settings
- Paste your Application Key — create one in Datadog under Personal Settings → Application Keys with the minimum scopes:
ci_visibility:read,metrics:read - Select your Datadog site — the default is
datadoghq.com; EU customers should selectdatadoghq.eu - Click Connect
Koalr will validate the keys immediately and sync the last 30 days of CI Visibility data.
Datadog sites
| Site | Host |
|---|---|
| US1 (default) | datadoghq.com |
| US3 | us3.datadoghq.com |
| US5 | us5.datadoghq.com |
| EU | datadoghq.eu |
| AP1 | ap1.datadoghq.com |
| US1-FED | ddog-gov.com |
Enter the correct site for your organization when connecting. Using the wrong site returns a 403 error.
How coverage data flows
Koalr reads the @test.code_coverage.lines_pct custom attribute from CI Visibility pipeline events. This value must be exported from your test runner and attached as a custom metric.
Example for Jest (GitHub Actions):
- name: Run tests with coverage
run: jest --coverage --json > coverage.json
- name: Export coverage to Datadog
uses: DataDog/datadog-ci@v1
with:
command: junit upload
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_CODEOWNERS: true
Or using the Datadog agent's custom_tag configuration to tag pipeline spans with test.code_coverage.lines_pct.
What appears in Koalr
After connecting:
- Coverage dashboard (
/coverage) — shows Datadog coverage alongside Codecov and SonarCloud data - Code Health (
/code-health) — flaky test count and pipeline health metrics - Repository table — coverage % per repo, sourced from most recent CI run
Sync frequency
Koalr queries the Datadog CI Visibility API daily at 4:00 AM UTC. Historical data is backfilled up to 30 days on first connect.
Troubleshooting
"Invalid API key" error on connect Confirm the API key is from the correct Datadog site. Keys are not portable across sites.
Coverage shows 0% or N/A
CI Visibility coverage requires the @test.code_coverage.lines_pct tag on your test pipeline spans. Verify your CI configuration exports this value.
Missing service data Service catalog sync requires the Datadog Service Catalog to be configured. Enable it in Datadog → Service Catalog → Settings.