Extend Insights to support the query option
Release notes
This issue is a breakdown from a spike issue which makes the DORA metrics exposable via the Insights feature.
High-level Steps
- Introduce an extra library layer for supporting the new YAML schema and delegating to the correct backend (finder).
- Adjust the Insights parameter validation rules to accommodate the new schema changes.
- Update the documentation with examples.
Details
To make this work, we can introduce an extra layer (maybe a lib?) which is responsible for the YAML options processing and delegation to the correct backend (finder). This is currently implemented as a mixin on the controller-level: InsightsActions
After this change, the controller would look much cleaner, something like this:
def query
Gitlab::Insights::Validators::ParamsValidator.new(params).validate!
render json: Serializer.new(Insights::Loader.new(chart_params).call)
end
The Loader is responsible for the following:
- Handle/transform the incoming parameters in a backwards-compatible manner (old Insights files should still work.
- Delegate to the correct Finder class and return the data to the serializer.
Configuration
Old configuration (it should work with the new changes):
bugsCharts:
title: "Charts for bugs"
charts:
- title: "Monthly bugs created"
description: "Open bugs created per month"
type: bar
query:
issuable_type: issue
issuable_state: opened
group_by: month
period_limit: 12
New configuration (with 2 charts, Issuable finder based and DORA base):
bugsCharts:
title: "Charts for bugs"
charts:
- title: "Monthly bugs created"
description: "Open bugs created per month"
type: bar
query:
data_source: issuable
params:
issuable_type: issue
issuable_state: opened
group_by: month
period_limit: 12
- title: "DORA DF"
description: "Deployment frequency"
type: bar
query:
data_source: dora
params:
metric: deployment_frequency
environment_tiers:
- production
period_limit: 12
Note: the DORA finder might not support all the possible chart times or period options.
Designs
- Show closed items
Blocks
Relates to
- #327222Next 4-6 releases
- #10830Next 4-6 releases6
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Adam Hegyi changed milestone to %15.3
changed milestone to %15.3
- Adam Hegyi added devopsmanage groupoptimize labels
added devopsmanage groupoptimize labels
- Adam Hegyi marked this issue as related to #354805 (closed)
marked this issue as related to #354805 (closed)
- Adam Hegyi added Deliverable backend priority2 sectiondev labels
added Deliverable backend priority2 sectiondev labels
- Adam Hegyi changed the description
Compare with previous version changed the description
- Adam Hegyi mentioned in issue #354805 (closed)
mentioned in issue #354805 (closed)
- Maintainer
@ahegyi, please can you add a type label to this issue to help with issue discovery in issue reports.
- 🤖 GitLab Bot 🤖 added auto updated label
added auto updated label
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- Adam Hegyi added featureenhancement label
added featureenhancement label
- 🤖 GitLab Bot 🤖 added typefeature label
added typefeature label
- Developer
@ahegyi could you add the weight as well, please?
Collapse replies - Author Maintainer
added
1
- Adam Hegyi set weight to 6
set weight to 6
- Haim Snir added documentation label
added documentation label
- Haim Snir added GitLab Ultimate label
added GitLab Ultimate label
@ahegyi thanks for opening this issue!
Can you clarify if all the other Insights chart parameters can also be configured with this new configuration?
For example, can the following be configured:
- Chart
type: line
? - Page with 4 Charts?
- Group data per
week
orday
? -
filter_labels
?
Also, can we label this workflowready for development
Edited by Haim Snir- Chart
Collapse replies - Author Maintainer
Can you clarify if all the other Insights chart parameters can also be configured with this new configuration?
The chart params would be different for each query "backend", this needs to be carefully documented. All mentioned options could be configured for DORA, except the labels. Labels are not associated with the DORA data.
Thanks @ahegyi for the clarification.
What about the example below - will it be supported once this issue is completed?
bugsCharts: title: "Monthly Deployment Frequency per Environments" charts: - title: "Production Deployment Frequency" description: "Monthly Production Deployment Frequency" type: line query: data_source: dora params: metric: deployment_frequency environment_tiers: - production period_limit: 12 - title: "Monthly Testing Deployment Frequency" description: "Testing Deployment Frequency" type: line query: data_source: dora params: metric: deployment_frequency environment_tiers: - testing period_limit: 12 - title: "Monthly Staging Deployment Frequency" description: "Staging Deployment Frequency" type: line query: data_source: dora params: metric: deployment_frequency environment_tiers: - staging period_limit: 12
- Author Maintainer
@hsnir1, yes, this will work. We also need to specify the group by param:
group_by: month
. 1 Thanks @ahegyi, could you elaborate more about these questions:
- Will the projects.only option be supported?
- What other
line charts
parameters be supported? I can't find much details in the documentation page. - How does the axis granularity (scale) render? Does it calculate the min and max values per chart?
- Is the following use case of "DORA Team productivity report" also supported:
bugsCharts: title: "Monthly team productivity report (DORA)" charts: - title: "Monthly Deployment Frequency" description: "Deployment Frequency" type: line query: data_source: dora params: metric: deployment_frequency environment_tiers: - production period_limit: 12 - title: "Monthly Lead Time for Changes" description: "Lead Time for Changes" type: line query: data_source: dora params: metric: lead_time_for_changes environment_tiers: - production period_limit: 12 - title: "Monthly Change Failure Rate" description: "Change Failure Rate" type: line query: data_source: dora params: metric: change_failure_rate environment_tiers: - production period_limit: 12 - title: "Monthly Time to restore service" description: "Time to restore service" type: line query: data_source: dora params: metric: time_to_restore_service environment_tiers: - production period_limit: 12
- Author Maintainer
Will the projects.only option be supported?
Yes, projects within the group.
What other
line charts
parameters be supported? I can't find much details in the documentation page.Supported:
- Line or bar chart
- Group by: daily or monthly aggregation
- Period limit
- Environment tiers (array)
- metric (DF, etc.)
Not supported:
- Stacked chart
- Group by: weekly (the DORA API exposes only daily and monthly data)
- Labels
How does the axis granularity (scale) render? Does it calculate the min and max values per chart?
AFAIK this is done by the chart library on the FE. cc @ekigbo
Is the following use case of "DORA Team productivity report" also supported:
Yes. This would work.
- Maintainer
How does the axis granularity (scale) render? Does it calculate the min and max values per chart?
AFAIK this is done by the chart library on the FE. cc
@ekigbo
Yes that sounds correct, we would be simply passing the data to the chart library (echarts) and it calculates the axis scale.
- Haim Snir removed the relation with #354805 (closed)
removed the relation with #354805 (closed)
- Haim Snir marked this issue as related to #354805 (closed)
marked this issue as related to #354805 (closed)
- Adam Hegyi added workflowready for development label
added workflowready for development label
- Magdalena Frankiewicz removed [deprecated] Accepting merge requests label
removed [deprecated] Accepting merge requests label
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- Haim Snir mentioned in issue gitlab-org/manage/general-discussion#17523
mentioned in issue gitlab-org/manage/general-discussion#17523
- Adam Hegyi mentioned in merge request !92521 (merged)
mentioned in merge request !92521 (merged)
- Haim Snir mentioned in issue gitlab-com/Product#4480 (closed)
mentioned in issue gitlab-com/Product#4480 (closed)
- Contributor
@hsnir1 ia this customer facing? What will be the improved experience for the user once this is delivered?
Collapse replies @ogolowinski Once, we have this new DORA query configuration, we will deliver a custom DORA Charts report for all environments.
In the first iteration:
- We will start with only one example, but with guidelines how to customize it.
- This new example will be located under the insight - Analytics > Insights. Later once we collect more validation and feedback, we will link it into a complete VSA / DORA flow.
- Contributor
@hsnir1 I still dont understand. Is this customer facing? In this ,milestone, what will users see? Is it the documentation piece?
@ogolowinski from this issue, users will only see the documentation.
- Adam Hegyi added workflowin dev label and removed workflowready for development label
added workflowin dev label and removed workflowready for development label
- Haim Snir mentioned in issue #364432 (closed)
mentioned in issue #364432 (closed)
- Maintainer
- Ezekiel Kigbo removed [deprecated] Accepting merge requests label
removed [deprecated] Accepting merge requests label
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- Adam Hegyi assigned to @ahegyi
assigned to @ahegyi
- 🤖 GitLab Bot 🤖 removed [deprecated] Accepting merge requests label
removed [deprecated] Accepting merge requests label
- Adam Hegyi mentioned in merge request !93544 (merged)
mentioned in merge request !93544 (merged)
- Haim Snir mentioned in issue gitlab-com/Product#4620
mentioned in issue gitlab-com/Product#4620
- Haim Snir marked this issue as related to #354653 (closed)
marked this issue as related to #354653 (closed)
- Haim Snir mentioned in issue #354653 (closed)
mentioned in issue #354653 (closed)
- Haim Snir changed the description
Compare with previous version changed the description
- Haim Snir added release post itemsecondary label
added release post itemsecondary label
- 🤖 GitLab Bot 🤖 added release post itemin review label and removed release post itemsecondary label
added release post itemin review label and removed release post itemsecondary label
- 🤖 GitLab Bot 🤖 mentioned in merge request gitlab-com/www-gitlab-com!108970 (closed)
mentioned in merge request gitlab-com/www-gitlab-com!108970 (closed)
- Maintainer
@ahegyi This issue looks like it may slip this current milestone. Can you leave a
or to signify if you are on track to deliver this issue? Please also consider updating the issue's Health Status or Milestone to reflect its current state, and communicate with your Product Manager as appropriate. 1 - Adam Hegyi added workflowin review label and removed workflowin dev label
added workflowin review label and removed workflowin dev label
- Pavel Shutsin mentioned in issue #370260
mentioned in issue #370260
- Adam Hegyi added workflowverification label and removed workflowin review label
added workflowverification label and removed workflowin review label
- Author Maintainer
@hsnir1, the DORA charts within the Insights feature should be available on production. We need to test these somehow though. What do you think about preparing a YAML configuration and adding it to our current insights.yml file? Located here: https://gitlab.com/gitlab-org/quality/insights-config/-/blob/master/.gitlab/insights.yml (I can prepare the MR)
Could you take a look at the docs, do you think we missed something here?
I did a test on staging but we don't have data to show:
Collapse replies the DORA charts within the Insights feature should be available on production.
Thanks @ahegyi!
What do you think about preparing a YAML configuration and adding it to our current insights.yml file? Located here: https://gitlab.com/gitlab-org/quality/insights-config/-/blob/master/.gitlab/insights.yml (I can prepare the MR)
Agreed, can this be done with environment_tiers for
gprd
,gprd-cny
andgstg
?This is also aligned with Deployment Frequency Line Charts For All Enviro... (#354805 - closed) and will solve it, right?
Could you take a look at the docs, do you think we missed something here?
It would also be helpful if we elaborated more on what is supported and what is not:
Supported:
- Line or bar chart
- Group by: daily or monthly aggregation
- Period limit
- Filter by project
- Environment tiers (array)
- metric (DF, etc.)
Not supported:
- Stacked chart
- Group by: weekly (the DORA API exposes only daily and monthly data)
- Filter by labels
- Is there any difference between
Insights for projects
andInsights for groups
? Why do they have separate docs?
- Author Maintainer
Agreed, can this be done with environment_tiers for
gprd
,gprd-cny
andgstg
?The following tiers are supported:
- production
- staging
- testing
- development
We can include the production and staging environment tiers.
Note: the environment tiers will be aggregated together and the data will be presented as one bar chart. We don't have multiple series at the moment.
This is also aligned with Deployment Frequency Line Charts For All Enviro... (#354805 - closed) and will solve it, right?
That's correct.
It would also be helpful if we elaborated more on what is supported and what is not:
Right, I missed the chart type part. I'll update the docs shortly.
- Haim Snir mentioned in merge request gitlab-com/www-gitlab-com!109691 (merged)
mentioned in merge request gitlab-com/www-gitlab-com!109691 (merged)
- Author Maintainer
Charts are visible at https://gitlab.com/groups/gitlab-org/-/insights/#/dora
We got a bug where 2 charts is not rendering, the fix is under review: !95555 (merged)
1 Collapse replies - Author Maintainer
Fixed
1
- Adam Hegyi closed
closed
- Orit Golowinski marked this issue as related to #371867 (closed)
marked this issue as related to #371867 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue #371867 (closed)
mentioned in issue #371867 (closed)
- Haim Snir mentioned in issue gitlab-com/Product#5043 (closed)
mentioned in issue gitlab-com/Product#5043 (closed)
- Brandon Labuschagne added devopsmonitor label and removed devopsfoundations label
added devopsmonitor label and removed devopsfoundations label