Service metrics migration guide

Latest Dynatrace

This guide provides insights into migrating service metrics to Grail. Typically, a Grail metric is equivalent to a Metrics Classic metric. In some cases, however, there's no one-to-one relation:

  • Convergent: a single Grail metric represents multiple Metrics Classic metrics of a similar scope.
  • Unsupported: no Grail metric is planned to represent the Metrics Classic metric.

Convergent metrics

When a single Grail metric provides support for multiple Metrics Classic metrics, you can obtain comparable results for values of individual metrics through metric dimensions.

HTTP 4xx and HTTP 5xx

Example: The following DQL queries return respectively the rate of requests with HTTP response status code 5xx and 4xx—an equivalent of builtin:service.errors.fivexx.rate and builtin:service.errors.fourxx.rate.

// calculate HTTP 5xx response status code request rate
timeseries {total = sum(dt.service.request.count)}
| join [
timeseries {fiveXX = sum(dt.service.request.count, default: 0.0)},
filter:http.response.status_code >= 500 and http.response.status_code <= 599
], kind:leftOuter, prefix: "httpState.", on:{ timeframe }
| fieldsAdd {rate5xx = httpState.fiveXX[] / total[] * 100}
| fields rate5xx, timeframe, interval
// calculate HTTP 4xx response status code request rate
timeseries {total = sum(dt.service.request.count)}
| join [
timeseries {fourXX = sum(dt.service.request.count, default: 0.0)},
filter: http.response.status_code >= 400 and http.response.status_code<=499
], kind:leftOuter, prefix: "httpState.", on:{ timeframe }
| fieldsAdd {rate4xx = httpState.fourXX[] / total[] * 100}
| fields rate4xx, timeframe, interval
Metric key (Grail)Filter by Metric key (Classic)

dt.service.request.count

http.response.status_code (5xx or 4xx)

builtin:service.errors.fivexx.rate builtin:service.errors.fourxx.rate

Failure and success

Example: The following DQL query returns the average number of successful requests to MY_SERVICE-00000—an equivalent ofbuiltin:service.errors.total.successCount.

timeseries sum(dt.service.request.count),
by:{dt.entity.service, failed},
filter:{
dt.entity.service == "<MY_SERVICE-00000>"
and failed == false
}
Metric key (Grail)Filter by Metric key (Classic)

dt.service.request.count

failed (false or true)

builtin:service.errors.client.successCount
builtin:service.errors.server.successCount
builtin:service.errors.total.successCount
builtin:service.successes.server.rate
builtin:service.errors.server.count
builtin:service.errors.server.rate
builtin:service.errors.total.rate

Failure and success of HTTP 4xx and HTTP 5xx

Example: The following DQL query returns the average number of failed requests to MY_SERVICE-00000 with HTTP response status code 4xx—an equivalent ofbuiltin:service.errors.fourxx.count.

timeseries sum(dt.service.request.count),
by:{dt.entity.service, failed, http.response.status_code},
filter:{
dt.entity.service == "<MY_SERVICE-00000>"
and failed == true
and http.response.status_code >= 400
and http.response.status_code <= 499
}
Metric key (Grail)Filter by Metric key (Classic)

dt.service.request.count

failed (false or true) AND http.response.status_code (5xx or 4xx)

builtin:service.errors.fivexx.successCount
builtin:service.errors.fivexx.count
builtin:service.errors.fourxx.successCount
builtin:service.errors.fourxx.count

Key requests

From key requests to endpoints

Endpoints replace key requests in Grail. To learn more about endpoint.name, see the Semantic dictionary.

Example: The following DQL query example returns the sum of the number of requests of the request /orange.jsf with HTTP response status code 5xx, as builtin:service.keyRequest.errors.fivexx.rate.

timeseries sum(dt.service.request.count),
by:{endpoint.name, http.response.status_code},
filter:{
endpoint.name == "/orange.jsf"
and http.response.status_code >= 500
and http.response.status_code <= 599
}
Metric key (Grail)Filter by Metric key (Classic)

dt.service.request.failure_count

endpoint.name (<Key request name>)

builtin:service.keyRequest.errors.client.count
builtin:service.keyRequest.errors.client.rate

dt.service.request.response_time

endpoint.name (<Key request name>)

builtin:service.keyRequest.response.client
builtin:service.keyRequest.response.server
builtin:service.keyRequest.response.time

dt.service.request.count

endpoint.name (<Key request name>)

builtin:service.keyRequest.count.client
builtin:service.keyRequest.count.server
builtin:service.keyRequest.count.total

endpoint.name (<Key request name>) AND failed (false or true)

builtin:service.keyRequest.errors.client.successCount
builtin:service.keyRequest.errors.server.successCount
builtin:service.keyRequest.successes.server.rate
builtin:service.keyRequest.errors.server.count
builtin:service.keyRequest.errors.server.rate

endpoint.name (<Key request name>) AND http.response.status_code (5xx or 4xx)

builtin:service.keyRequest.errors.fivexx.rate
builtin:service.keyRequest.errors.fourxx.rate

endpoint.name (<Key request name>) AND failed (false or true) AND http.response.status_code (5xx or 4xx)

builtin:service.keyRequest.errors.fivexx.successCount
builtin:service.keyRequest.errors.fivexx.count
builtin:service.keyRequest.errors.fourxx.successCount
builtin:service.keyRequest.errors.fourxx.count

Unsupported metrics

The following Metrics Classic metrics don't have a dedicated Grail metric. Support is planned with Traces in Grail. To learn more about what's coming, see Blog post: Expanded Grail data lakehouse and new Dynatrace user experience unlock boundless analytics.

Database

Example: The following DQL query returns the amount and the duration of database spans for each database service, similarly to builtin:service.dbChildCallCount and builtin:service.dbChildCallTime.

fetch spans, samplingRatio:1
// get only database client span
| filter span.kind == "client" and isNotNull(db.statement)
// calculate how frequently each span is sampled
| fieldsAdd sampling.probability = (power(2, 56) - coalesce(sampling.threshold, 0)) * power(2, -56)
| fieldsAdd sampling.multiplicity = 1/sampling.probability
// calculate the number of database spans after sampling
| fieldsAdd multiplicity = coalesce(sampling.multiplicity, 1)
* coalesce(aggregation.count, 1)
* dt.system.sampling_ratio
// calculate the duration of database spans after sampling
| fieldsAdd duration = coalesce(aggregation.duration_sum / aggregation.count, duration)
// aggregate records with the same values, by service ID
| summarize {
operation_count_extrapolated = sum(multiplicity),
operation_duration_avg_extrapolated = sum(duration * multiplicity) / sum(multiplicity)
}, by: { entityName(dt.entity.service), db.namespace }
  • builtin:service.dbChildCallCount
  • builtin:service.dbChildCallTime
  • builtin:service.keyRequest.dbChildCallCount
  • builtin:service.keyRequest.dbChildCallTime
  • builtin:service.keyRequest.nonDbChildCallCount
  • builtin:service.keyRequest.nonDbChildCallTime
  • builtin:service.nonDbChildCallCount
  • builtin:service.nonDbChildCallTime

CPU

  • builtin:service.cpu.instance
  • builtin:service.cpu.perRequest
  • builtin:service.cpu.time
  • builtin:service.ioTime
  • builtin:service.keyRequest.cpu.perRequest
  • builtin:service.keyRequest.cpu.time
  • builtin:service.keyRequest.ioTime
  • builtin:service.keyRequest.lockTime
  • builtin:service.keyRequest.waitTime
  • builtin:service.lockTime
  • builtin:service.waitTime

Service method groups

  • builtin:service.cpu.group.perRequest
  • builtin:service.cpu.group.time
  • builtin:service.errors.group.client.count
  • builtin:service.errors.group.client.rate
  • builtin:service.errors.group.client.successCount
  • builtin:service.errors.group.server.count
  • builtin:service.errors.group.server.rate
  • builtin:service.errors.group.server.successCount
  • builtin:service.errors.group.total.count
  • builtin:service.errors.group.total.rate
  • builtin:service.errors.group.total.successCount
  • builtin:service.response.group.client
  • builtin:service.response.group.server
  • builtin:service.totalProcessingTime.group.totalProcessingTime

Other

  • builtin:service.calledFromNetworksCount
  • builtin:service.keyRequest.totalProcessingTime
  • builtin:service.totalProcessingTime