Timeseries API v1 - DELETE a custom metric

  • Reference
  • Published Nov 07, 2019

Deletes the specified custom metric. If you delete a metric definition, you lose all of that metric's data, so be careful with deletes.

Built-in metrics can't be deleted.

DELETEManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v1/timeseries/{timeseriesIdentifier}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v1/timeseries/{timeseriesIdentifier}

Authentication

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

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

Parameters

ParameterTypeDescriptionInRequired
timeseriesIdentifierstring

The ID of the metric to delete.

pathRequired

Response

Response codes

CodeTypeDescription
204-

Success. The custom metric has been deleted.

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Response body objects

The ErrorEnvelope object

ElementTypeDescription
errorError-

The Error object

ElementTypeDescription
codeinteger

The HTTP status code

constraintViolationsConstraintViolation[]

A list of constraint violations

messagestring

The error message

The ConstraintViolation object

A list of constraint violations

ElementTypeDescription
locationstring-
messagestring-
parameterLocationstring-
The element can hold these values
  • HEADER
  • PATH
  • PAYLOAD_BODY
  • QUERY
pathstring-

Response body JSON models

{
"error": {
"code": 1,
"constraintViolations": [
{
"location": "string",
"message": "string",
"parameterLocation": "HEADER",
"path": "string"
}
],
"message": "string"
}
}

Example

In this example, the request deletes the custom:firewall.connections.dropped custom metric.

The API token is passed in the Authorization header.

Curl

curl -X DELETE \
https://mySampleEnv.live.dynatrace.com/api/v1/timeseries/custom:firewall.connections.dropped \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dynatrace.com/api/v1/timeseries/custom:firewall.connections.dropped

Response code

204