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

Agent platform sessions

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

This data source provides aggregated metrics about GitLab Duo Agent Platform session usage across your project or group.

Allowed modes

Allowed scopes

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

For more information, see scopes.

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 by when the session was created. Use range operators to define a time window.

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, the time range is considered from 00:00 to 23:59 in the user’s time zone.

Flow type

Description: Filter by the flow type of the session. For example, chat or code_review/v1.

Allowed value types:

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

User

Description: Filter by the user who owns the session.

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 weekly or monthly (default: weekly). For example, created(monthly).
Flow typeflowTypeGroup by session flow type.
ProjectprojectGroup by project. Sessions 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
Completion ratecompletionRateProportion of sessions that finished, as a value from 0 to 1.
Duration maxdurationMaxLongest finished session duration, in seconds.
Duration meandurationMeanAverage duration of finished sessions, in seconds.
Duration mindurationMinShortest finished session duration, in seconds.
Duration quantiledurationQuantileDuration of finished sessions at a given quantile, in seconds. Accepts a quantile parameter between 0.01 and 0.99 (default: 0.5). For example, durationQuantile(0.95).
Duration sumdurationSumTotal duration of finished sessions, in seconds.
Finished countfinishedCountNumber of finished sessions.
Total counttotalCountTotal number of sessions.
Users countusersCountNumber of unique users.

Sort fields

Sort by any dimension, or by one of these metrics:

  • totalCount
  • finishedCount
  • usersCount
  • completionRate
  • durationQuantile.

These metrics are not sortable:

  • durationMean
  • durationMin
  • durationMax
  • durationSum

For more information, see analytics mode sorting.

Examples

  • Sessions by flow type for the last 30 days:

    ```glql
    title: "Agent Platform sessions by flow (last 30 days)"
    display: table
    mode: analytics
    query: type = AgentPlatformSession and group = "gitlab-org" and created > -30d
    dimensions: flowType as "Flow"
    metrics: totalCount as "Total", finishedCount as "Finished", completionRate as "Completion rate"
    sort: totalCount desc
    ```
  • Weekly session trend:

    ```glql
    title: "Weekly Agent Platform session trend"
    display: columnChart
    mode: analytics
    query: type = AgentPlatformSession and group = "gitlab-org" and created > -90d
    dimensions: created(weekly) as "Week"
    metrics: totalCount as "Total", usersCount as "Users"
    sort: created desc
    ```
  • Sessions per user, with average duration:

    ```glql
    title: "Agent Platform sessions by user"
    display: table
    mode: analytics
    query: type = AgentPlatformSession and group = "gitlab-org" and created > -30d
    dimensions: user as "User"
    metrics: totalCount as "Total", durationMean as "Avg duration"
    sort: totalCount desc
    limit: 10
    ```
  • Overall completion rate and median duration, without grouping:

    ```glql
    title: "Agent Platform session completion (last 30 days)"
    display: table
    mode: analytics
    query: type = AgentPlatformSession and group = "gitlab-org" and created > -30d
    metrics: totalCount as "Total", completionRate as "Completion rate", durationQuantile(0.5) as "Median duration"
    ```