Defining value stream metrics#

Add metric data to your value streams by using the DevOps language query language.

You can provide metric data to your value stream by querying the data integrated into UrbanCodeā„¢ Velocity. The data can originate from plug-in integrations, or REST API calls from external clients. DevOps Query Language (DQL) queries can be defined in the value\_stream.json file attached to a value stream, or in the Query bar on the value stream page. You can add graphs or charts derived from the data to the Metrics bar, or the list view on the Value Streams page.

Note: Currently, you can capture counts on issue data from issue tracking tools, such as Jira.

To add metric data to a Value stream, complete the following steps:

  1. On the Value Stream page, click Download value stream map, .
  2. Using a text editor, add metrics definition to the value_stream_name.json file. The properties are defined later in this topic.
  3. Upload the file to your value stream.

Metric data properties are described in the following table:

Property Description
name Query name.
repeatEvery Defines how frequently the query runs.
repeatAt Time option. Note, currently not used.
metricDefinitionID The metric definition that is used to collect the data.
properties Defines the query that is applied to the collected data. The property field can consist of a simple DQL field statement or an array of objects. When defined as a single field statement, such as issue.tags, or issue.severity, the query groups and then counts the distinct values for the field. When defined as an array of objects, a single name can be assigned to the entire DQL query.

Examples#

In the following example, all work items that do not have a status of "Closed" are grouped by type, and then a count for each group is provided to the metrics collection.

 "metrics": [
    {
      "name": "Work Item Distribution",
      "repeatEvery": "24 hours",
      "repeatAt": null,
      "metricDefinitionId": "WORK_ITEM_TYPE_COUNT",
      "properties": {
        "query": "issue.status != Closed",
        "field": "issue.type"
      }
    }
  ]

In this example, the number of items that match each query in the array is saved to the metric collection.

 "metrics": [
    {
      "name": "Work Item Owners",
      "repeatEvery": "24 hours",
      "repeatAt": null,
      "metricDefinitionId": "WORK_ITEM_OWNER",
      "properties": {
        "query": null,
         "field":[
         {
           "name": "My items",     
           "query": "issue.owner = Some Name"
         },
         {
          "name": "Your Items",
          "query": "issue.owner = Amother Name"
         }
        ]
      }
    }
  ]

Parent topic: Value stream metrics