Metrics
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed
- Status: Beta
This feature is not under active development.
The availability of this feature is controlled by a feature flag. For more information, see the history. This feature is available for testing, but not ready for production use.
Metrics provide insight about the operational health of monitored systems. Use metrics to learn more about your systems and applications in a given time range.
Metrics are structured as time series data, and are:
- Indexed by timestamp
- Continuously expanding as additional data is gathered
- Usually aggregated, downsampled, and queried by range
- Have write-intensive requirements
Configure metrics
Configure metrics to enable them for a project.
Prerequisites:
You must have at least the Maintainer role for the project.
Create an access token:
- On the left sidebar, select Search or go to and find your project.
- Select Settings > Access tokens.
- Create an access token with the
api
scope and Developer role or greater. Save the access token value for later.
To configure your application to send GitLab metrics, set the following environment variables:
OTEL_EXPORTER = "otlphttp" OTEL_EXPORTER_OTLP_ENDPOINT = "https://gitlab.example.com/api/v4/projects/<gitlab-project-id>/observability/" OTEL_EXPORTER_OTLP_HEADERS = "PRIVATE-TOKEN=<gitlab-access-token>"
Use the following values:
gitlab.example.com
- The hostname for your GitLab Self-Managed instance, orgitlab.com
gitlab-project-id
- The project IDgitlab-access-token
- The access token you created
Metrics are configured for your project. When you run your application, the OpenTelemetry exporter sends metrics to GitLab.
View metrics
You can view the metrics for a given project:
- On the left sidebar, select Search or go to and find your project.
- Select Monitor > Metrics.
A list of metrics is displayed. Select a metric to view its details.
Each metric contains one or more attributes. You can filter metrics by attribute with the search bar.
Metric details
Metrics are displayed as either a sum, a gauge, or a histogram. The metric details page displays a chart depending on the type of metric.
On the metric details page, you can also view metrics for a specific time range, and aggregate metrics by attribute:
To make data lookups fast, depending on what time period you filter by, GitLab automatically chooses the proper aggregation. For example, if you search for more than seven days of data, the API returns only daily aggregates.
Aggregations by search period
The following table shows what type of aggregation is used for each search period:
Period | Aggregation used |
---|---|
Less than 30 minutes | Raw data as ingested |
More than 30 minutes and less than one hour | By minute |
More than one hour and less than 72 hours | Hourly |
More than 72 hours | Daily |
Metrics ingestion limits
Metrics ingest a maximum of 102,400 bytes per minute.
When the limit is exceeded, a 429 Too Many Requests
response is returned.
To request a limit increase to 1,048,576 bytes per minute, contact GitLab support.
Data retention
GitLab has a retention limit of 30 days for all ingested metrics.
Create an issue for a metric
You can create an issue to track any action taken to resolve or investigate a metric. To create an issue for a metric:
- On the left sidebar, select Search or go to and find your project.
- Select Monitor > Metrics.
- From the list of metrics, select a metric.
- Select Create issue.
The issue is created in the selected project and pre-filled with information from the metric. You can edit the issue title and description.
View issues related to a metric
- On the left sidebar, select Search or go to and find your project.
- Select Monitor > Metrics.
- From the list of metrics, select a metric.
- Scroll to Related issues.
- Optional. To view the issue details, select an issue.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support