Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v2 intake endpoint #640

Merged
merged 1 commit into from
Nov 4, 2021
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.5.1.dev2",
"regenerated": "2021-11-04 13:24:24.429630",
"spec_repo_commit": "5f61238"
"regenerated": "2021-11-04 14:27:15.472643",
"spec_repo_commit": "4b9e0f1"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-11-04 13:24:25.064837",
"spec_repo_commit": "5f61238"
"regenerated": "2021-11-04 14:27:16.134443",
"spec_repo_commit": "4b9e0f1"
}
}
}
1 change: 1 addition & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25003,6 +25003,7 @@ paths:
type: safe
/v1/input:
post:
deprecated: true
description: 'Send your logs to your Datadog platform over HTTP. Limits per
HTTP request are:

Expand Down
299 changes: 299 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,15 @@ components:
type: string
x-enum-varnames:
- APPLICATION_KEYS
ContentEncoding:
description: HTTP header used to compress the media-type.
enum:
- gzip
- deflate
type: string
x-enum-varnames:
- GZIP
- DEFLATE
Creator:
description: Creator of the object.
properties:
Expand Down Expand Up @@ -846,6 +855,80 @@ components:
example: Application Key for submitting metrics
type: string
type: object
HTTPLog:
description: Structured log message.
items:
$ref: '#/components/schemas/HTTPLogItem'
type: array
HTTPLogError:
description: List of errors.
properties:
detail:
description: Error message.
example: Malformed payload
type: string
status:
description: Error code.
example: 400
type: string
title:
description: Error title.
example: Bad Request
type: string
type: object
HTTPLogErrors:
description: Invalid query performed.
properties:
errors:
description: Structured errors.
items:
$ref: '#/components/schemas/HTTPLogError'
type: array
type: object
HTTPLogItem:
description: Logs that are sent over HTTP.
properties:
ddsource:
description: 'The integration name associated with your log: the technology
from which the log originated.

When it matches an integration name, Datadog automatically installs the
corresponding parsers and facets.

See [reserved attributes](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes).'
example: nginx
type: string
ddtags:
description: Tags associated with your logs.
example: env:staging,version:5.1
type: string
hostname:
description: The name of the originating host of the log.
example: i-012345678
type: string
message:
description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes)

of your log. By default, Datadog ingests the value of the message attribute
as the body of the log entry.

That value is then highlighted and displayed in the Logstream, where it
is indexed for full text search.'
example: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World
type: string
service:
description: 'The name of the application or service generating the log
events.

It is used to switch from Logs to APM, so make sure you define the same
value when you use both products.

See [reserved attributes](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes).'
example: payment
type: string
required:
- name
type: object
IncidentCreateAttributes:
description: The incident's attributes for a create request.
properties:
Expand Down Expand Up @@ -6182,6 +6265,222 @@ paths:
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/logs:
post:
description: 'Send your logs to your Datadog platform over HTTP. Limits per
HTTP request are:


- 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


Any log exceeding 1MB is accepted and truncated by Datadog:

- 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'
operationId: SubmitLog
parameters:
- description: HTTP header used to compress the media-type.
in: header
name: Content-Encoding
required: false
schema:
$ref: '#/components/schemas/ContentEncoding'
- description: Log tags can be passed as query parameters with `text/plain`
content type.
example: env:prod,user:my-user
in: query
name: ddtags
required: false
schema:
type: string
requestBody:
content:
application/json:
examples:
multi-json-messages:
description: Pass multiple log objects at once.
summary: Multi JSON Messages
value:
- message: hello
- message: world
simple-json-message:
description: Log attributes can be passed as `key:value` pairs in
valid JSON messages.
summary: Simple JSON Message
value:
ddsource: agent
ddtags: env:prod,user:joe.doe
hostname: fa1e1e739d95
message: hello world
schema:
$ref: '#/components/schemas/HTTPLog'
application/logplex-1:
examples:
multi-raw-message:
description: Submit log messages.
summary: Multi Logplex Messages
value: 'hello

world'
simple-logplex-message:
description: Submit log string.
summary: Simple Logplex Message
value: hello world
schema:
type: string
text/plain:
examples:
multi-raw-message:
description: Submit log string.
summary: Multi Raw Messages
value: 'hello

world

'
simple-raw-message:
description: 'Submit log string. Log attributes can be passed as query
parameters in the URL. This enables the addition of tags or the
source by using the `ddtags` and `ddsource` parameters: `?host=my-hostname&service=my-service&ddsource=my-source&ddtags=env:prod,user:my-user`.'
summary: Simple Raw Message
value: hello world
schema:
type: string
description: Log to send (JSON format).
required: true
responses:
'202':
content:
application/json:
schema:
type: object
description: Request accepted for processing (always 202 empty JSON).
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Forbidden
'408':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Request Timeout
'413':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Payload Too Large
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Too Many Requests
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Internal Server Error
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Service Unavailable
security:
- apiKeyAuth: []
servers:
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: The regional site for customers.
enum:
- datadoghq.com
- us3.datadoghq.com
- us5.datadoghq.com
- datadoghq.eu
- ddog-gov.com
subdomain:
default: http-intake.logs
description: The subdomain where the API is deployed.
- url: '{protocol}://{name}'
variables:
name:
default: http-intake.logs.datadoghq.com
description: Full site DNS name.
protocol:
default: https
description: The protocol for accessing the API.
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: Any Datadog deployment.
subdomain:
default: http-intake.logs
description: The subdomain where the API is deployed.
summary: Send logs
tags:
- Logs
x-codegen-request-body-name: body
x-menu-order: 1
x-undo:
type: safe
/api/v2/logs/analytics/aggregate:
post:
description: The API endpoint to aggregate events into buckets and compute metrics
Expand Down
12 changes: 12 additions & 0 deletions docs/v2/ContentEncoding.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docs/v2/HTTPLog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions docs/v2/HTTPLogError.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading