Metrics Reports
Introduced in GitLab Premium 11.10. Requires GitLab Runner 11.10 and above.
Overview
GitLab provides a lot of great reporting tools for merge requests - JUnit reports, codequality, performance tests, etc. While JUnit is a great open framework for tests that “pass” or “fail”, it is also important to see other types of metrics from a given change.
You can configure your job to use custom Metrics Reports, and GitLab will display a report on the merge request so that it’s easier and faster to identify changes without having to check the entire log.
Use cases
Consider the following examples of data that can utilize Metrics Reports:
- Memory usage
- Load testing results
- Code complexity
- Code coverage stats
How it works
Metrics are read from the metrics report (default: metrics.txt
). They are parsed and displayed in the MR widget.
All values are considered strings and string compare is used to find differences between the latest available metrics
artifact from:
master
- The feature branch
How to set it up
Add a job that creates a metrics report (default filename: metrics.txt
). The file should conform to the OpenMetrics format.
For example:
metrics:
script:
- echo 'metric_name metric_value' > metrics.txt
artifacts:
reports:
metrics: metrics.txt
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc