Help us learn about your current experience with the documentation. Take the survey.

Duo workflows

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed
  • Status: Experiment

This data source reads from the GitLab Duo Agent Platform flow analytics engine, which is controlled by a feature flag named dap_impact_v1. The flag is disabled by default. Until an administrator enables it, queries return an error.

This data source provides aggregated metrics about GitLab Duo Agent Platform flows (also called Duo workflows) run across your project or group, including how many credits they used.

Allowed modes

Allowed scopes

ScopeDescription
projectQuery GitLab Duo Agent Platform flows in a specific project.
groupQuery GitLab Duo Agent Platform flows across all projects in a group, including subgroups.

To aggregate GitLab Duo workflows across multiple groups or projects, use a list with the in operator. For more information, see multiple groups and projects.

Query fields

Use these fields in the query parameter to filter your results.

FieldName (and alias)Operators
Createdcreated (opened, openedAt, createdAt)=, >, <, >=, <=
Flow typeflowType=, in
Useruser=, in

Created

Description: Filter flows by date they were created. Use multiple created conditions to define a specified time period.

Allowed value types:

  • AbsoluteDate (in the format YYYY-MM-DD)
  • RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted, digit is an integer, and unit is one of d (days), w (weeks), m (months), or y (years))

Notes:

  • For the = operator, GLQL considers the time range from 00:00 to 23:59 in the user’s time zone.

Flow type

Description: Filter flows by their type. For example, software_development or code_review/v1.

Allowed value types:

  • String
  • List (use in operator for multiple values)

User

Description: Filter by the user who ran the flow.

Allowed value types:

  • Number (user ID)
  • List (use in operator for multiple user IDs)

Support for username filtering is being tracked in issue 599750.

Dimensions

DimensionNameDescription
CreatedcreatedGroup by date. Accepts a granularity parameter of daily, weekly, or monthly (default: monthly). For example, created(weekly).
Flow typeflowTypeGroup by flow type.
ProjectprojectGroup by project. Flows that are not scoped to a project are grouped into a single row with no project.
UseruserGroup by user (displays avatar, name, and username).

Metrics

MetricNameDescription
Credits used maxcreditsUsedMaxMost credits used by a single flow.
Credits used meancreditsUsedMeanAverage credits used per flow.
Credits used mincreditsUsedMinFewest credits used by a single flow.
Credits used quantilecreditsUsedQuantileCredits used per flow at a given quantile. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, creditsUsedQuantile(0.95).
Credits used sumcreditsUsedSumTotal credits used by all flows.
Projects countprojectsCountNumber of unique projects. Flows that are not scoped to a project are not counted, so the row for those flows shows 0.
Total counttotalCountTotal number of flows.
Users countusersCountNumber of unique users.

The credits metrics require the Owner or Security Manager role for the group or project, or a custom role with the read_agent_artifacts permission. For other users, these metrics are empty.

Sort fields

Sort by any field included in your selected dimensions or metrics. For more information, see analytics mode sorting.

Examples

  • Flows by flow type for the last 30 days:

    ```glql
    title: "Duo workflows by flow type (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: flowType as "Flow"
    metrics: totalCount as "Flows", usersCount as "Users", creditsUsedSum as "Credits"
    sort: totalCount desc
    ```
  • Monthly credit usage trend:

    ```glql
    title: "Monthly Duo workflow credit usage trend"
    display: columnChart
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -90d
    dimensions: created(monthly) as "Month"
    metrics: creditsUsedSum as "Credits used"
    sort: created asc
    ```
  • Top users by credits for the last 30 days:

    ```glql
    title: "Top users by Duo workflow credits (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    dimensions: user as "User"
    metrics: totalCount as "Flows", creditsUsedSum as "Credits", creditsUsedMean as "Avg credits per flow"
    sort: creditsUsedSum desc
    limit: 10
    ```
  • Overall usage without grouping:

    ```glql
    title: "Duo workflow usage overview (last 30 days)"
    display: table
    mode: analytics
    query: type = DuoWorkflow and group = "gitlab-org" and created > -30d
    metrics: totalCount as "Flows", usersCount as "Users", projectsCount as "Projects", creditsUsedQuantile(0.5) as "Median credits"
    ```