Enables or disables the specified calculated service metric on Grail.
PUT | SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/service/metricsOnGrail/{metricKey} |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/service/metricsOnGrail/{metricKey} |
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
metricKey | string | The key of the calculated service metric to be enabled/disabled on Grail. | path | required |
body | Service | The JSON body of the request. | body | required |
ServiceMetricToGrail
objectEnable/Disable a calculated service metric on Grail
Element | Type | Description | Required |
---|---|---|---|
enabledOnGrail | boolean | Is calculated service metric enabled on Grail | required |
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}
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 | Error | Failed. The input is invalid |
In this example, the request enables the Top 10 queries calculated service metric, which has the metric key of calc:service.top10queries.
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'
https://mySampleEnv.live.dynatrace.com/api/config/v1/calculatedMetrics/service/metricsOnGrail/calc%3Aservice.top10queries
204