Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2",
"regenerated": "2022-07-22 18:54:46.374559",
"spec_repo_commit": "692b2bd1"
"regenerated": "2022-07-26 12:50:54.718724",
"spec_repo_commit": "8b6d3567"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-07-22 18:54:46.534488",
"spec_repo_commit": "692b2bd1"
"regenerated": "2022-07-26 12:50:54.730560",
"spec_repo_commit": "8b6d3567"
}
}
}
12 changes: 9 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4251,6 +4251,9 @@ components:
points:
- timestamp: 1475317847
value: 0.7
resources:
- name: dummyhost
type: host
items:
$ref: '#/components/schemas/MetricSeries'
type: array
Expand Down Expand Up @@ -4278,12 +4281,15 @@ components:
type: object
MetricResource:
description: Metric resource.
example:
name: dummyhost
type: host
properties:
name:
description: The name of the metric.
description: The name of the resource.
type: string
type:
description: The type of metric.
description: The type of the resource.
type: string
type: object
MetricSeries:
Expand Down Expand Up @@ -12545,7 +12551,7 @@ paths:
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric
names\n- 50 bytes for the timeseries\n- The full payload is approximately
100 bytes."
100 bytes.\n\nHost name is one of the resources in the Resources field."
operationId: SubmitMetrics
parameters:
- description: HTTP header used to compress the media-type.
Expand Down
6 changes: 5 additions & 1 deletion examples/v2/metrics/SubmitMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datadog.api.client.v2.model.MetricIntakeType;
import com.datadog.api.client.v2.model.MetricPayload;
import com.datadog.api.client.v2.model.MetricPoint;
import com.datadog.api.client.v2.model.MetricResource;
import com.datadog.api.client.v2.model.MetricSeries;
import java.time.OffsetDateTime;
import java.util.Collections;
Expand All @@ -26,7 +27,10 @@ public static void main(String[] args) {
Collections.singletonList(
new MetricPoint()
.timestamp(OffsetDateTime.now().toInstant().getEpochSecond())
.value(0.7)))));
.value(0.7)))
.resources(
Collections.singletonList(
new MetricResource().name("dummyhost").type("host")))));

try {
IntakePayloadAccepted result = apiInstance.submitMetrics(body);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,8 @@ public CompletableFuture<IntakePayloadAccepted> submitMetricsAsync(
* <li>The full payload is approximately 100 bytes.
* </ul>
*
* <p>Host name is one of the resources in the Resources field.
*
* @param body (required)
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;IntakePayloadAccepted&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public MetricResource name(String name) {
}

/**
* The name of the metric.
* The name of the resource.
*
* @return name
*/
Expand All @@ -51,7 +51,7 @@ public MetricResource type(String type) {
}

/**
* The type of metric.
* The type of the resource.
*
* @return type
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-05-18T18:24:32.611Z
2022-07-12T21:45:36.018Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"series\": [{\"metric\": \"system.load.1\", \"points\": [{\"timestamp\": 1652898272, \"value\": 0.7}], \"type\": 0}]}"
"json": "{\"series\": [{\"metric\": \"system.load.1\", \"points\": [{\"timestamp\": 1657662336, \"value\": 0.7}], \"resources\": [{\"name\": \"dummyhost\", \"type\": \"host\"}], \"type\": 0}]}"
},
"headers": {},
"method": "POST",
Expand All @@ -27,6 +27,6 @@
"timeToLive": {
"unlimited": true
},
"id": "c969dbe4-3c23-6eee-0918-5fc9321d83ec"
"id": "b85f9909-a76a-06e5-fa3f-6a9601244087"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -191,28 +191,28 @@ Feature: Metrics
@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
Scenario: Submit metrics returns "Bad Request" response
Given new "SubmitMetrics" request
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/metrics-intake @team:DataDog/metrics-query
Scenario: Submit metrics returns "Payload accepted" response
Given new "SubmitMetrics" request
And body with value {"series": [{"metric": "system.load.1", "type": 0, "points": [{"timestamp": {{ timestamp('now') }}, "value": 0.7}]}]}
And body with value {"series": [{"metric": "system.load.1", "type": 0, "points": [{"timestamp": {{ timestamp('now') }}, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
When the request is sent
Then the response status is 202 Payload accepted

@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
Scenario: Submit metrics returns "Payload too large" response
Given new "SubmitMetrics" request
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
When the request is sent
Then the response status is 413 Payload too large

@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
Scenario: Submit metrics returns "Request timeout" response
Given new "SubmitMetrics" request
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
When the request is sent
Then the response status is 408 Request timeout

Expand Down