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
4 changes: 2 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7896,7 +7896,7 @@ components:
type: integer
query:
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
sort:
$ref: "#/components/schemas/LogsSort"
Expand Down Expand Up @@ -35245,7 +35245,7 @@ paths:
value:
index: "retention-3,retention-15"
limit: 25
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
sort: desc
time:
from: "2020-02-02T02:02:02.202Z"
Expand Down
28 changes: 14 additions & 14 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76857,10 +76857,10 @@ components:
type: string
limit:
default: 10
description: Maximum number of logs in the response.
description: Requested maximum number of logs in the response.
example: 25
format: int32
maximum: 1000
maximum: 5000
type: integer
type: object
LogsListResponse:
Expand Down Expand Up @@ -76955,7 +76955,7 @@ components:
query:
default: "*"
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
type: object
LogsMetricGroupBy:
Expand Down Expand Up @@ -77028,7 +77028,7 @@ components:
properties:
query:
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
type: object
LogsMetricResponseGroupBy:
Expand Down Expand Up @@ -77117,7 +77117,7 @@ components:
query:
default: "*"
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
storage_tier:
$ref: "#/components/schemas/LogsStorageTier"
Expand Down Expand Up @@ -197058,7 +197058,7 @@ paths:
indexes:
- main
- web
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
storage_tier: indexes
to: now
group_by:
Expand Down Expand Up @@ -198151,7 +198151,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198189,7 +198189,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand All @@ -198213,7 +198213,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198279,7 +198279,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198319,7 +198319,7 @@ paths:
compute:
include_percentiles: true
filter:
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand All @@ -198342,7 +198342,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -199034,7 +199034,7 @@ paths:
schema:
default: 10
format: int32
maximum: 1000
maximum: 5000
type: integer
responses:
"200":
Expand Down Expand Up @@ -199101,7 +199101,7 @@ paths:
indexes:
- main
- web
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
storage_tier: indexes
to: now
options:
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/logs/ListLogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void main(String[] args) {
LogsListRequest body =
new LogsListRequest()
.index("retention-3,retention-15")
.query("service:web* AND @http.status_code:[200 TO 299]")
.query("service:web-api AND @http.status_code:[200 TO 299]")
.sort(LogsSort.TIME_ASCENDING)
.time(
new LogsListRequestTime()
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/logs-metrics/UpdateLogsMetric.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void main(String[] args) {
.filter(
new LogsMetricFilter()
.query(
"service:web* AND @http.status_code:[200 TO"
"service:web-api AND @http.status_code:[200 TO"
+ " 299]-updated"))));

try {
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/logs/ListLogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void main(String[] args) {
new LogsQueryFilter()
.from("now-15m")
.indexes(Arrays.asList("main", "web"))
.query("service:web* AND @http.status_code:[200 TO 299]")
.query("service:web-api AND @http.status_code:[200 TO 299]")
.storageTier(LogsStorageTier.INDEXES)
.to("now"))
.options(new LogsQueryOptions().timezone("GMT"))
Expand Down
35 changes: 35 additions & 0 deletions examples/v2/logs/ListLogsGet_3179484528.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Search logs (GET) with a page limit of 5000 returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsApi;
import com.datadog.api.client.v2.api.LogsApi.ListLogsGetOptionalParameters;
import com.datadog.api.client.v2.model.LogsListResponse;
import java.time.OffsetDateTime;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
LogsApi apiInstance = new LogsApi(defaultClient);

try {
LogsListResponse result =
apiInstance.listLogsGet(
new ListLogsGetOptionalParameters()
.filterQuery("datadog-agent")
.filterIndexes(Collections.singletonList("main"))
.filterFrom(OffsetDateTime.parse("2020-09-17T11:48:36+01:00"))
.filterTo(OffsetDateTime.parse("2020-09-17T12:48:36+01:00"))
.pageLimit(5000));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsApi#listLogsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
42 changes: 42 additions & 0 deletions examples/v2/logs/ListLogs_2789021011.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Search logs with a page limit above 1000 returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsApi;
import com.datadog.api.client.v2.api.LogsApi.ListLogsOptionalParameters;
import com.datadog.api.client.v2.model.LogsListRequest;
import com.datadog.api.client.v2.model.LogsListRequestPage;
import com.datadog.api.client.v2.model.LogsListResponse;
import com.datadog.api.client.v2.model.LogsQueryFilter;
import com.datadog.api.client.v2.model.LogsSort;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
LogsApi apiInstance = new LogsApi(defaultClient);

LogsListRequest body =
new LogsListRequest()
.filter(
new LogsQueryFilter()
.query("datadog-agent")
.indexes(Collections.singletonList("main"))
.from("2020-09-17T11:48:36+01:00")
.to("2020-09-17T12:48:36+01:00"))
.sort(LogsSort.TIMESTAMP_ASCENDING)
.page(new LogsListRequestPage().limit(5000));

try {
LogsListResponse result = apiInstance.listLogs(new ListLogsOptionalParameters().body(body));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LogsApi#listLogs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
2 changes: 1 addition & 1 deletion examples/v2/logs/ListLogs_534975433.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void main(String[] args) {
new LogsQueryFilter()
.from("now-15m")
.indexes(Arrays.asList("main", "web"))
.query("service:web* AND @http.status_code:[200 TO 299]")
.query("service:web-api AND @http.status_code:[200 TO 299]")
.storageTier(LogsStorageTier.INDEXES)
.to("now"))
.options(new LogsQueryOptions().timezone("GMT"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public LogsListRequestPage limit(Integer limit) {
}

/**
* Maximum number of logs in the response. maximum: 1000
* Requested maximum number of logs in the response. maximum: 5000
*
* @return limit
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Feature: Logs
Scenario: Search logs returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"index": "retention-3,retention-15", "query": "service:web* AND @http.status_code:[200 TO 299]", "sort": "asc", "time": {"from": "2020-02-02T02:02:02.202Z", "to": "2020-02-20T02:02:02.202Z"}}
And body with value {"index": "retention-3,retention-15", "query": "service:web-api AND @http.status_code:[200 TO 299]", "sort": "asc", "time": {"from": "2020-02-02T02:02:02.202Z", "to": "2020-02-20T02:02:02.202Z"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:ddoghq/logs-app
Scenario: Search logs returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"index": "retention-3,retention-15", "query": "service:web* AND @http.status_code:[200 TO 299]", "sort": "asc", "time": {"from": "2020-02-02T02:02:02.202Z", "to": "2020-02-20T02:02:02.202Z"}}
And body with value {"index": "retention-3,retention-15", "query": "service:web-api AND @http.status_code:[200 TO 299]", "sort": "asc", "time": {"from": "2020-02-02T02:02:02.202Z", "to": "2020-02-20T02:02:02.202Z"}}
When the request is sent
Then the response status is 200 OK

Expand Down
30 changes: 26 additions & 4 deletions src/test/resources/com/datadog/api/client/v2/api/logs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Logs
Scenario: Aggregate events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "AggregateLogs" request
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "group_by": [{"facet": "host", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="}}
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web-api AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "group_by": [{"facet": "host", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down Expand Up @@ -86,27 +86,40 @@ Feature: Logs
When the request with pagination is sent
Then the response status is 200 OK

@team:ddoghq/logs-app
Scenario: Search logs (GET) with a page limit of 5000 returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "ListLogsGet" request
And request contains "filter[query]" parameter with value "datadog-agent"
And request contains "filter[indexes]" parameter with value ["main"]
And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00"
And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00"
And request contains "page[limit]" parameter with value 5000
When the request is sent
Then the response status is 200 OK
And the response "data" has length 0

@generated @skip @team:ddoghq/logs-app
Scenario: Search logs (POST) returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web-api AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:ddoghq/logs-app
Scenario: Search logs (POST) returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web-api AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:ddoghq/logs-app @with-pagination
Scenario: Search logs (POST) returns "OK" response with pagination
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web-api AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK

Expand All @@ -128,6 +141,15 @@ Feature: Logs
Then the response status is 200 OK
And the response has 3 items

@team:ddoghq/logs-app
Scenario: Search logs with a page limit above 1000 returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"filter": {"query": "datadog-agent", "indexes": ["main"], "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5000}}
When the request is sent
Then the response status is 200 OK
And the response "data" has length 0

@integration-only @skip-terraform-config @skip-validation @team:ddoghq/event-platform-intake @team:ddoghq/logs-backend @team:ddoghq/logs-federated-search @team:ddoghq/logs-routing
Scenario: Send deflate logs returns "Request accepted for processing (always 202 empty JSON)." response
Given new "SubmitLog" request
Expand Down
Loading
Loading