DataDogClient.aggregateEvents
— MethodFunction Definition
function aggregateEvents(groupByMissing,
groupByTotal,
aggrigation::String,
interval::String = "",
metric::String = "",
type::String = "",
fromDateTime::String = "",
indexes::String = "",
query::String = "",
storageTier::String = "",
toDate::String = "",
facet::String,
intreval::Double,
histogramMin::Double,
histogramMax::Double,
groupByLimit::Number = -1,
sortAggrigation::String = "",
sortMetric::String = "",
sortOrder::String = "",
sortType::String = "",
timeOffset::Number = -1,
timeZone::String = "",
pageCursor::String = "")
Parameters
Parameter | Type | Required/Optional |
---|---|---|
groupByMissing | String/Float64 | [Required] |
groupByTotal | Boolean/String/Double | [Required] |
aggrigation | String | [Required] |
interval | String | [Optional] |
metric | String | [Optional] |
type | String | [Optional] |
fromDateTime | String | [Optional] |
indexes | String | [Optional] |
query | String | [Optional] |
storageTier | String | [Optional] |
toDate | String | [Optional] |
facet | String | [Optional] |
intreval | Float64 | [Optional] |
histogramMin | Float64 | [Optional] |
histogramMax | Float64 | [Optional] |
groupByLimit | Number | [Optional] |
sortAggrigation | String | [Optional] |
sortMetric | String | [Optional] |
sortOrder | String | [Optional] |
sortType | String | [Optional] |
timeOffset | Number | [Optional] |
timeZone | String | [Optional] |
pageCursor | String | [Optional] |
See https://docs.datadoghq.com/api/latest/logs/#aggregate-events for official Datadog API documentation
DataDogClient.getListOfLogs
— MethodFunction Definition
function getListOfLogs(indexFilter::String, fromDate::DateTime, toDate::DateTime, storageTier::Number, pageCursor::String, pageLimit::Number)
Parameters
- query::String [Optional]
- index::String [Optional]
- fromDate::String [Optional]
- toDate::String [Optional]
- storageTier::String [Optional]
- sort::String [Optional]
- cursor::String [Optional]
- pageLimit::Number [Optional]
API Call Format:
https://api.datadoghq.com/api/v2/logs/events?filter[query]=`<string>`&filter[index]=`<string>`&filter[from]=`<string>`&filter[to]=`<string>`&filter[storage_tier]=`<enum>`&sort=<enum>&page[cursor]=`<string>`&page[limit]=`<integer>`
Query Strings
| Name | Type | Description |
| :------------------- | :------ | :------------------------------------------------------------------------------------------------- |
| filter[query] | string | Search query following logs syntax. |
| filter[index] | string | For customers with multiple indexes, the indexes to search Defaults to ‘*’ which means all indexes |
| filter[from] | string | Minimum timestamp for requested logs. |
| filter[to] | string | Maximum timestamp for requested logs. |
| filter[storage_tier] | enum | Specifies the storage type to be used. Allowed enum values: `indexes`, `online-archives` |
| sort | enum | Order of logs in results. Allowed enum values: `timestamp`, `-timestamp` |
| page[cursor] | string | List following results with a cursor provided in the previous query. |
| page[limit] | integer | Maximum number of logs in the response. |
See https://docs.datadoghq.com/api/latest/logs/#get-a-list-of-logs for more information
DataDogClient.handleMessage
— Method# Function Definition:
handleMessage(message::String)
## Parameters:
- message::String [Required]
## Functionality:
Return a string if the "Message" recieved is not ::Vector{String}
DataDogClient.handleMessage
— Method# Function Definition:
function handleMessage(message::Vector{String})
## Parameters:
- message::Vector{String} [Required]
## Functionality:
Join messages in a string vector into a single string to be compatible with Datadog
DataDogClient.sendLogs
— FunctionFunction Definition:
function sendLogs()
Parameters:
- ddsource::String [Optional]
- ddtags::String [Optional]
- hostname::String [Optional]
- message::Union{String, Vector{String}} [Optional]
- service::String [Optional]
Though all parameters are optional according to the API documentation (see "Further Resources" for more information) ddsource
and ddtags
are required for Datadog to direct logs to the correct application
Functionality:
Send logs to Datadog.
Limits
HTTP request limits:
- Maximum content size per payload (uncompressed): 5MB
- Maximum size for a single log: 1MB
- Maximum array size if sending multiple logs in an array: 1000 entries
Logs exceeding 1MB will be accepted by Datadog but will be truncated
- For a single log request, the API truncates the log at 1MB and returns a 2xx.
- For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx.
- Datadog recommends sending your logs compressed. Add the Content-Encoding: gzip header to the request when sending compressed logs.
The status codes answered by the HTTP API are:
- 202: Accepted: the request has been accepted for processing
- 400: Bad request (likely an issue in the payload formatting)
- 401: Unauthorized (likely a missing API Key)
- 403: Permission issue (likely using an invalid API Key)
- 408: Request Timeout, request should be retried after some time
- 413: Payload too large (batch is above 5MB uncompressed)
- 429: Too Many Requests, request should be retried after some time
- 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time
- 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time
Query Strings:
Name | Type | Description |
---|---|---|
ddtags | string | Log tags can be passed as query parameters with text/plain content type. |
Header Parameters
Name | Type | Description |
---|---|---|
Content-Encoding | string | HTTP header used to compress the media-type. |
Body Data (JSON) [Required]
[
{
"ddsource": "nginx",
"ddtags": "env:staging,version:5.1",
"hostname": "i-012345678",
"message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World",
"service": "payment"
}
]
See https://docs.datadoghq.com/api/latest/logs/#search-logs for official Datadog API documentation