Service metrics API - PUT a metric on Grail

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}/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

Parameter
Type
Description
In
Required
metricKey
string

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

path
required
body

The JSON body of the request.

body
required

Request body objects

The ServiceMetricToGrail object

Enable/Disable a calculated service metric on Grail

Element
Type
Description
Required
enabledOnGrail
boolean

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

Code
Type
Description
204
-

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

400

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