For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/ci-visibility-pipelines/aggregate-pipelines-events.md. A documentation index is available at /llms.txt.
Language
Datadog site

Aggregate pipelines events

POSThttps://api.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.us3.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.us5.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.datadoghq.eu/api/v2/ci/pipelines/analytics/aggregatehttps://api.ap1.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.ap2.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.uk1.datadoghq.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.ddog-gov.com/api/v2/ci/pipelines/analytics/aggregatehttps://api.us2.ddog-gov.com/api/v2/ci/pipelines/analytics/aggregate

Overview

Use this API endpoint to aggregate CI Visibility pipeline events into buckets of computed metrics and timeseries.

This endpoint requires the ci_visibility_read permission.

OAuth apps require the ci_visibility_read authorization scope to access this endpoint.

Request

Body Data (required)

Field
Type
Description
compute
[object]

The list of metrics or timeseries to compute for the retrieved buckets.

filter
object

The search and filter query settings.

group_by
[object]

The rules for the group-by.

options
object

Global query options that are used during the query. Only supply timezone or time offset, not both. Otherwise, the query fails.

Response

OK

The response object for the pipeline events aggregate API endpoint.

Field
Type
Description
data
object

The query results.

links
object

Links attributes.

meta
object

The metadata associated with a request.

Code Example

Aggregate pipelines events returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/ci/pipelines/analytics/aggregate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "compute": [
    {
      "aggregation": "pc90",
      "metric": "@duration",
      "type": "total"
    }
  ],
  "filter": {
    "from": "now-15m",
    "query": "@ci.provider.name:(gitlab OR github)",
    "to": "now"
  },
  "group_by": [
    {
      "facet": "@ci.status",
      "limit": 10,
      "total": false
    }
  ],
  "options": {
    "timezone": "GMT"
  }
}
EOF