Calculated metrics for services

Dynatrace automatically captures important metrics for services with no configuration required. You might need additional business or technical metrics that are specific to your application. These metrics can be calculated and derived based on a wide variety of available data within the captured PurePath. You can also split these metrics by multiple dimensions, for example a requests attribute or an HTTP method.

Only new data is written to calculated metrics; retrospective data is not included.

Create a metric

  1. In the Dynatrace menu, go to Settings > Server-side service monitoring > Calculated service metrics.

  2. Select Create new metric.

  3. Give a meaningful name to your metric. The name is added to the metric key automatically.

  4. Optional If needed, customize the metric key. The calc:service. prefix is added automatically.
    Note that once a metric is created, you can't change its key.

  5. From the Metric source list, select the metric you want to analyze. If needed, select the required unit.

  6. Optional Select the management zone. The new metric will be restricted to data from this zone.

  7. Provide conditions for usage of the metric. Conditions define which requests are included in the calculation. If you provide several conditions, all conditions must be fulfilled to use the metric.

    1. Select Add condition.
    2. Select the attribute to be checked.
    3. Select the operator of the condition.
    4. Optional If needed, specify the reference value. Preview shows the list of services to be included to the custom metric and the estimation of DDU consumption.

    Preview only considers management zone and conditions based on service attributes. These attributes are marked with [Service property] in the attribute list.

  8. Optional Add dimension to your new metric.

    1. Enable Split by dimension.
    2. Place your cursor in the Dimension value pattern field to see the available dimensions and select the required dimension. If the required dimension is not available, you can create a custom placeholder. See the Custom placeholders section below.
    3. In the Dimension name field, specify a meaningful name for your dimension. This name will be used in the UI and API. Note that once a metric is created, you can't change the dimension name.
    4. In the Number of top values field, specify the amount of top X values to be calculated for the metric.
    5. From the Value sorting and Value aggregation lists, select the sorting and aggregation of the top X values.
  9. Select Save metric.

Custom placeholders

There might be a situation when you can't find the required placeholder for your dimension. In that case, you can create a custom placeholder. Note, that it is mandatory to use all created placeholders in the dimension value pattern.

Extraction methods

You have two methods to extract the value for a placeholder:

  • Delimiter-based. In this case, Dynatrace extracts the value by checking the value of the source against a reference value and specified delimiter kind and position.
  • Regex-based. In this case, Dynatrace uses regular expression extraction. To learn how Dynatrace uses regular expressions, see Regular expressions in Dynatrace.

Request attribute placeholders

Placeholders that are based on request attributes provide three options for value extraction:

  • First: The first occurrence of the attribute is used to extract the value.
  • Last: The last occurrence of the attribute is used to extract the value.
  • Count: The value equals the number of attribute occurrences.

Additionally you can use request attributes from child calls. To enable this option, select the Use from downstream services checkbox. You can restrict child calls to those that belong to a particular management zone or carry a particular tag.

Create a custom placeholder

To create a custom placeholder

  1. While creating or editing a calculated service metric, select Add custom placeholder.
  2. Provide a meaningful name for your placeholder. The name will be used in the Dimension value pattern field.
  3. Select the source for the dimension. If the source is a request attribute, additionally select the attribute and extraction method.
    1. Optional Select Use from downstream services checkbox to add child calls as the value source.
    2. Optional Restrict the child calls to a particular management zone or service tag.
  4. Select the extraction method.
  5. Select Add.
  6. Use the newly created placeholder in the dimension value pattern.