Skip to content

Commit

Permalink
Fix spans/logs custom metrics delete operation responses (#1751)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Apr 18, 2023
1 parent 3f21647 commit cf464bd
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-17 18:07:40.383745",
"spec_repo_commit": "25a92e6d"
"regenerated": "2023-04-18 17:35:07.748467",
"spec_repo_commit": "0c4beb36"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-17 18:07:40.396130",
"spec_repo_commit": "25a92e6d"
"regenerated": "2023-04-18 17:35:07.761090",
"spec_repo_commit": "0c4beb36"
}
}
}
4 changes: 2 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14564,7 +14564,7 @@ paths:
parameters:
- $ref: '#/components/parameters/SpansMetricIDParameter'
responses:
'200':
'204':
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
Expand Down Expand Up @@ -18090,7 +18090,7 @@ paths:
parameters:
- $ref: '#/components/parameters/MetricID'
responses:
'200':
'204':
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ public class ProxyExample {
### Using alternative artifacts

Outside of the regular JAR file we also release 2 artifacts that can be useful for development, namely:
- `jar-with-dependencies`, which contains all the dependencies of the client in a single JAR
- `shaded-jar`, which includes and renames the core dependencies of the client, allowing you to use different versions of those
libraries in your project.

- `jar-with-dependencies`, which contains all the dependencies of the client in a single JAR
- `shaded-jar`, which includes and renames the core dependencies of the client, allowing you to use different versions of those
libraries in your project.

To use them in Maven, just add the `classifier` keyword in the dependency definition. For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public CompletableFuture<Void> deleteLogsMetricAsync(String metricId) {
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 204 </td><td> OK </td><td> - </td></tr>
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public CompletableFuture<Void> deleteSpansMetricAsync(String metricId) {
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 204 </td><td> OK </td><td> - </td></tr>
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-05-12T09:52:23.762Z
2023-04-18T17:27:11.097Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"count\"},\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1652349143\"}},\"id\":\"Test-Delete_a_log_based_metric_returns_OK_response-1652349143\",\"type\":\"logs_metrics\"}}"
"json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"count\"},\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1681838831\"}},\"id\":\"Test-Delete_a_log_based_metric_returns_OK_response-1681838831\",\"type\":\"logs_metrics\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1652349143\"},\"group_by\":[],\"compute\":{\"aggregation_type\":\"count\"}},\"type\":\"logs_metrics\",\"id\":\"Test_Delete_a_log_based_metric_returns_OK_response_1652349143\"}}",
"body": "{\"data\":{\"id\":\"Test_Delete_a_log_based_metric_returns_OK_response_1681838831\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1681838831\"},\"group_by\":[],\"compute\":{\"aggregation_type\":\"count\"}},\"type\":\"logs_metrics\"}}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,44 +27,43 @@
"timeToLive": {
"unlimited": true
},
"id": "b9e06018-0894-969b-2f3c-d8898f7bf343"
"id": "756a0b40-9fbb-0365-1b2a-a8966134a09f"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1652349143",
"path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1681838831",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{}",
"headers": {
"Content-Type": [
"application/json"
"text/html; charset=utf-8"
]
},
"statusCode": 200,
"reasonPhrase": "OK"
"statusCode": 204,
"reasonPhrase": "No Content"
},
"times": {
"remainingTimes": 1
},
"timeToLive": {
"unlimited": true
},
"id": "64a7bae1-1f24-ed7c-a900-8e4705725a6b"
"id": "a668a5d7-ac44-f86e-1310-1356ffc7ba38"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1652349143",
"path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1681838831",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_log_based_metric_returns_OK_response_1652349143' not found)\"]}",
"body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_log_based_metric_returns_OK_response_1681838831' not found)\"]}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -79,6 +78,6 @@
"timeToLive": {
"unlimited": true
},
"id": "64a7bae1-1f24-ed7c-a900-8e4705725a6c"
"id": "a668a5d7-ac44-f86e-1310-1356ffc7ba39"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-03-28T14:55:25.279Z
2023-04-18T17:28:08.946Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":false,\"path\":\"@duration\"},\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1680015325\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}]},\"id\":\"Test-Delete_a_span_based_metric_returns_OK_response-1680015325\",\"type\":\"spans_metrics\"}}"
"json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":false,\"path\":\"@duration\"},\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1681838888\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}]},\"id\":\"Test-Delete_a_span_based_metric_returns_OK_response-1681838888\",\"type\":\"spans_metrics\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"Test_Delete_a_span_based_metric_returns_OK_response_1680015325\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1680015325\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}],\"compute\":{\"aggregation_type\":\"distribution\",\"path\":\"@duration\",\"include_percentiles\":false}},\"type\":\"spans_metrics\"}}\n",
"body": "{\"data\":{\"id\":\"Test_Delete_a_span_based_metric_returns_OK_response_1681838888\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1681838888\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}],\"compute\":{\"aggregation_type\":\"distribution\",\"path\":\"@duration\",\"include_percentiles\":false}},\"type\":\"spans_metrics\"}}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,44 +27,43 @@
"timeToLive": {
"unlimited": true
},
"id": "3cbb3815-f6e0-7de4-b0ae-7bfa2b3acbbe"
"id": "a0db5bd1-6c23-5f55-945b-7e2ecec0ec45"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1680015325",
"path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1681838888",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{}\n",
"headers": {
"Content-Type": [
"application/json"
"text/html; charset=utf-8"
]
},
"statusCode": 200,
"reasonPhrase": "OK"
"statusCode": 204,
"reasonPhrase": "No Content"
},
"times": {
"remainingTimes": 1
},
"timeToLive": {
"unlimited": true
},
"id": "42dcd81b-5868-9091-5d89-cbab9977880d"
"id": "688ed938-a130-04c6-9b17-4871ce9ddaa8"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1680015325",
"path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1681838888",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_span_based_metric_returns_OK_response_1680015325' not found)\"]}\n",
"body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_span_based_metric_returns_OK_response_1681838888' not found)\"]}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -79,6 +78,6 @@
"timeToLive": {
"unlimited": true
},
"id": "42dcd81b-5868-9091-5d89-cbab9977880e"
"id": "688ed938-a130-04c6-9b17-4871ce9ddaa9"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: Logs Metrics
And new "DeleteLogsMetric" request
And request contains "metric_id" parameter from "logs_metric.data.id"
When the request is sent
Then the response status is 200 OK
Then the response status is 204 OK

@generated @skip @team:DataDog/logs-backend
Scenario: Get a log-based metric returns "Not Found" response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: Spans Metrics
And new "DeleteSpansMetric" request
And request contains "metric_id" parameter from "spans_metric.data.id"
When the request is sent
Then the response status is 200 OK
Then the response status is 204 OK

@generated @skip @team:DataDog/apm
Scenario: Get a span-based metric returns "Not Found" response
Expand Down

0 comments on commit cf464bd

Please sign in to comment.