Skip to content

Expose VSA metrics via GraphQL

Adam Hegyi requested to merge 410327-add-aggregation-metrics-to-vsa-api into master

What does this MR do and why?

This MR exposes the VSA aggregation metrics with basic filtering capabilities via GraphQL.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Generate a project with date:

SEED_CYCLE_ANALYTICS=true  SEED_VSA=true FILTER=cycle_analytics rake db:seed_fu

You can test it in any public FOSS project:

{
  project(fullPath: "flightjs/flight") {
    name
    id
    valueStreams {
      nodes {
        id
        stages {
          id 
          name
          metrics(timeframe:{ start :"2024-01-01", end: "2024-02-02" }) {
            count {
              identifier
              value
              unit
              title
            }
            median {
              identifier
              value
            }
          }
        }
      }
    }
  }
}

Alternatively, you can test it in licensed projects or groups. Example query:

{
  group(fullPath: "vsmg-1713869259") {
    name
    id
    valueStreams(id: "gid://gitlab/Analytics::CycleAnalytics::ValueStream/7") {
      nodes {
        id
        name
        stages(id: "gid://gitlab/Analytics::CycleAnalytics::Stage/32") {
          id
          name
          metrics(timeframe: {start: "2024-03-01", end: "2024-05-02"}) {
            average {
              value
              title
              unit
            }
            median {
              value
              title
              unit
            }
            count {
              value
              title
              unit
            }
          }
        }
      }
    }
  }
}

Related to #410327 (closed)

Edited by Adam Hegyi

Merge request reports