TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Custom Chart

Last modified: 20 April 2023

Overview



In TeamCity, it is possible to configure a build script to report statistical build data (build metrics) and then display the data on charts.

To display a custom chart you will need to Reporting-Custom-Charts-Data your build script to report the data and configure TeamCity to show the corresponding charts.

Configuring Charts Presentation



TeamCity allows to display custom charts either on the Statistics page or on the Project Statistics Page, depending on the settings.

The settings for custom charts are stored in the XML files. In the chart configuration, you can use either pre-defined metrics provided by TeamCity, or the values reported from the build script.

Build-Configuration Level Charts



The chart is shown on the Statistics tab of the Build Configuration. The chart is displayed for those Build Configurations that has appropriate data reported by the builds.

The settings are configured in the < TeamCity data dir >/config/main-config.xml file by "graph" tags. You can edit the file while server is running, it will be automatically reloaded.

Project-Level Charts



The chart is shown on the Statistics tab for the individual Project.

The settings are configured in the < TeamCity data dir >/config/<Project Name>/plugin-settings.xml file by "graph" tags. You can edit the file while server is running, it will be automatically reloaded.

Almost the same as for main-config.xml, but there is an intermediate custom-graphs tag:

Tags description



<graph>



This tag describes a single chart. It may contain one or more valueType subtags, which describe series of data shown on the chart.

<valueType>



This tag describes a series of data shown on the chart. Each series is drawn with a separate color and you may choose one or another series using a filter. The attributes of the tag are:

Data Sources (valueType keys)



Pre-defined Value Providers



Reporting Custom Charts Data



There are two ways to publish values for custom metrics — Build Script Interaction with TeamCity file or using Build Script Interaction with TeamCity from your build.