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.
| DELETE | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/timeseries/{timeseriesIdentifier} |
| Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/v1/timeseries/{timeseriesIdentifier} |
To execute this request, you need an access token with DataExport scope.
To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| timeseriesIdentifier | string | The ID of the metric to delete. | path | Required |
| Code | Type | Description |
|---|---|---|
| 204 | - | Success. The custom metric has been deleted. |
| 4XX | Error | Client side error. |
| 5XX | Error | Server side error. |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code |
| constraintViolations | Constraint | A list of constraint violations |
| message | string | The error message |
ConstraintViolation objectA list of constraint violations
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}
In this example, the request deletes the custom:firewall.connections.dropped custom metric.
The API token is passed in the Authorization header.
curl -X DELETE \https://mySampleEnv.live.dynatrace.com/api/v1/timeseries/custom:firewall.connections.dropped \-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
https://mySampleEnv.live.dynatrace.com/api/v1/timeseries/custom:firewall.connections.dropped
204