---
url: /howto/tracking-metrics-in-merge-requests.md
---

# Tracking of Metrics in Merge Requests

This guide provides a comprehensive approach on tracking any metric available in Teamscale in merge requests. Teamscale
automatically generates and posts metric change badges to merge requests within your code collaboration platform, while
also displaying a detailed overview of these metrics in the merge request details view in Teamscale. Through Teamscale’s
configurable metric threshold system, you can set yellow and red warning thresholds for any metric, enabling you to
quickly identify unexpected changes in key metrics and take proactive action before they escalate into significant
issues.

:::tip Beta (Limited Availability)
This feature is currently in a Beta state and only available for GitHub, Bitbucket Data Center, and GitLab. Please contact our support
to request this feature for other code collaboration platforms.
:::

![Screenshot of Metrics Section in Merge Request Details View](./metrics-section.png)

## Prerequisites

Prerequisites for the configuration are:

* A running Teamscale instance which can connect to [GitHub](../connecting-version-control-system/github/index.md), [Bitbucket Data Center](../connecting-version-control-system/bitbucket/index.md), or [GitLab](../connecting-version-control-system/gitlab/index.md).
* A metric threshold configuration containing the relevant metrics. Details can be found [here](../../reference/ui/project/metric-threshold-configuration/index.md).

# Connector Configuration

If Teamscale supports this feature for your configured code collaboration platform, the respective connector will have
an option to set *Badges for Metrics*. Click the `Edit metric badges configuration` button to open a dialog which will
display all available metrics. Select the metrics you want to track with this connector, click `OK` to save your
selection, and finally save the project configuration.

![Screenshot of Badges Configuration](./badges-configuration.png)

To validate your configuration, go to *Activity > Merge Requests* and select any merge request with changes. In the
merge request's details view you will see a new section *Metrics* which contains a summary table of all selected
metrics.

:::tip Updates in Merge Requests
Changes in this configuration are only updated in merge requests on the next vote. This includes adding, renaming, or
removing metrics from the configuration.
:::
