- Before you begin
- Create a project from a template
- Invite users to the project
- Create project labels
- Create a value stream with a custom stage
- Create an Insights report
- View merge request and issue analytics
Tutorial: Set up an analytics-powered website project
When you work on a complex project (for example, a website), you likely collaborate with other people to build and maintain it. The way you collaborate and communicate in your team can make or break the project, so you want processes in place that help team members follow and achieve the common goal. Analytics metrics help you understand how the team is doing, and if you need to adjust processes so you can work better together. GitLab provides different types of analytics insights at the instance, group, and project level. If this list seems long and you’re not sure where to start, then this tutorial is for you.
Follow along to learn how to set up an example website project, collaborate with other GitLab users, and use project-level analytics reports to evaluate the development of your project.
Here’s an overview of what we’re going to do:
- Create a project from a template.
- Invite users to the project.
- Create project labels.
- Create a value stream with a custom stage.
- Create an Insights report.
- View merge request and issue analytics.
Before you begin
- You must have the Owner role for the group in which you create the project.
Create a project from a template
First of all, you need to create a project in your group.
GitLab provides project templates, which make it easier to set up a project with all the necessary files for various use cases. Here, you’ll create a project for a Hugo website.
To create a project:
- On the left sidebar, at the top, select Create new () and New project/repository.
- Select Create from template.
- Select the Pages/Hugo template.
- In the Project name text box, enter a name (for example
My website
). - From the Project URL dropdown list, select the group you want to create the project in.
- In the Project slug text box, enter a slug for your project (for example,
my-website
). - Optional. In the Project description text box, enter a description of your project. For example, “Analytics-powered project for a website built with Hugo”. You can add or edit this description at any time.
- Under Visibility Level, select the desired level for the project. If you create the project in a group, the visibility setting for a project must be at least as restrictive as the visibility of its parent group.
- Select Create project.
Now you have a project with all the files you need for a Hugo website.
Invite users to the project
When working on a large project such as a website, you’ll likely need to collaborate with other people, such as developers and designers. You have to invite them to your project, so that they get access to all the files, issues, and reports.
To invite a user to the My website
project:
- In the project, select Manage > Members.
- Select Invite members.
- Enter the user’s username.
- From the Role dropdown list, select the Developer role or higher. Users must have at least the Developer role to view analytics and contribute to issues and merge requests.
- Optional. In the Access expiration date picker, select a date. This step is recommended if the invited member is expected to contribute to the project only for a limited time.
- Select Invite.
The invited user should now be a member of the project. You can view, filter, and search for members of your project.
Create project labels
Labels help you organize and track issues, merge requests, and epics.
You can create as many labels as you need for your projects and groups.
For example, for a website project like this one, the labels feature request
and bug
might be useful.
To create a project label, in the My website
project:
- Select Manage > Labels.
- Select New label.
- In the Title field, enter
feature request
. - Optional. In the Description field, enter additional information about how and when to use this label.
- Optional. Select a color by selecting from the available colors, or enter a hex color value for a specific color in the Background color field.
- Select Create label.
The label should now appear in the label list, and you can use it to create a value stream with a custom stage.
Create a value stream with a custom stage
Now that you have a project with collaborators, you can start tracking and visualizing the activity. Value Stream Analytics helps you measure the time it takes to go from an idea to production, and identify inefficiencies in the development process. For a click-through demo of analytics features, see the Value Stream Management product tour.
To get started, create a value stream in the My website
project:
- Select Analyze > Value Stream Analytics.
- Select New Value Stream.
- Enter a name for the value stream, for example
My website value stream
. - Select Create from default template.
- To add a custom stage, select Add a stage.
- Enter a name for the stage, for example
Labeled MRs merged
. - From the Start event dropdown list, select Merge request label was added, then the
feature request
label. - From the Stop event dropdown list, select Merge request merged.
- Enter a name for the stage, for example
- Select Create value stream.
After you create the value stream, data starts collecting and loading. This process might take a while. When it’s ready, the dashboard is displayed in Analyze > Value Stream Analytics.
In the meantime, you can start creating an Insights report for your project.
Create an Insights report
While Value Stream Analytics give an overview of the entire development process, Insights provide a more granular view of a project’s issues created and closed, and average merge time of merge requests. This data visualization can help you triage issues at a glance.
You can create as many Insights reports with different charts as you need. For example, a stacked bar chart for bugs by severity or a line chart for issues opened over the month.
To create an Insights report, in the My website
project:
- Above the file list, select the plus icon, then select New file.
- In the File name text box, enter
.gitlab/insights.yml
. -
In the large text box, enter the following code:
bugsCharts: title: "Charts for bugs" charts: - title: "Monthly bugs created" description: "Open bugs created per month" type: bar query: data_source: issuables params: issuable_type: issue issuable_state: opened filter_labels: - bug group_by: month period_limit: 12
- Select Commit changes.
Now you have an Insights bar chart that displays the number of issues with the label ~bug
created per month, for the past 12 months.
You and project members with at least the Developer role can view the Insights report in Analyze > Insights.
View merge request and issue analytics
In addition to the Insights reports, you can get detailed analytics on the merge requests and issues of your project. Merge request analytics and Issue analytics display charts and tables with metrics such as assignees, merge request throughput, and issue status.
To view merge request and issue analytics, in the My website
project, select Analyze > Merge request analytics or Analyze > Issue analytics.
That was it! Now you have an analytics-powered website project on which you can collaborate efficiently with your team.