Service metrics API - PUT a metric on Grail

  • Reference

Enables or disables the specified calculated service metric on Grail.

PUTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/service/metricsOnGrail/{metricKey}
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/service/metricsOnGrail/{metricKey}

Authentication

To execute this request, you need an access token with WriteConfig scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
metricKeystring

The key of the calculated service metric to be enabled/disabled on Grail.

pathrequired
bodyServiceMetricToGrail

The JSON body of the request.

bodyrequired

Request body objects

The ServiceMetricToGrail object

Enable/Disable a calculated service metric on Grail

ElementTypeDescriptionRequired
enabledOnGrailboolean

Is calculated service metric enabled on Grail

required

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"enabledOnGrail": true
}

Response

Response codes

CodeTypeDescription
204-

Success. The calculated service metric already was or has been enabled/disabled on Grail. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid

Example

In this example, the request enables the Top 10 queries calculated service metric, which has the metric key of calc:service.top10queries.

Curl

curl -X 'PUT' \
'https://mySampleEnv.live.dynatrace.com/api/config/v1/calculatedMetrics/service/metricsOnGrail/calc%3Aservice.top10queries' \
-H 'accept: */*' \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/calculatedMetrics/service/metricsOnGrail/calc%3Aservice.top10queries

Response code

204