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 endpoint for submitting series #911

Merged
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-05-17 12:13:30.981727",
"spec_repo_commit": "8e5ea991"
"regenerated": "2022-05-17 14:59:00.575916",
"spec_repo_commit": "6f5f750c"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-05-17 12:13:30.997064",
"spec_repo_commit": "8e5ea991"
"regenerated": "2022-05-17 14:59:00.587584",
"spec_repo_commit": "6f5f750c"
}
}
}
7 changes: 4 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9354,8 +9354,9 @@ components:
type: string
type: array
type:
default: gauge
description: The type of the metric either `count`, `gauge`, or `rate`.
default: ''
description: The type of the metric. Valid types are "",`count`, `gauge`,
and `rate`.
example: rate
type: string
required:
Expand Down Expand Up @@ -23137,7 +23138,7 @@ paths:
3.2 megabytes (3200000 bytes). Compressed payloads must have a decompressed
size of less than 62 megabytes (62914560 bytes).\n\nIf you\u2019re submitting
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
64 bits for the timestamp\n- 32 bits for the value\n- 40 bytes for the metric
64 bits for the timestamp\n- 64 bits for the value\n- 40 bytes for the metric
names\n- 50 bytes for the timeseries\n- The full payload is approximately
100 bytes. However, with the DogStatsD API,\ncompression is applied, which
reduces the payload size."
Expand Down
231 changes: 231 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2599,6 +2599,14 @@ components:
required:
- data
type: object
IntakePayloadAccepted:
description: The payload accepted for intake.
properties:
status:
description: The status of the intake payload.
example: ok
type: string
type: object
ListApplicationKeysResponse:
description: Response for a list of application keys.
properties:
Expand Down Expand Up @@ -3877,6 +3885,14 @@ components:
pattern: ^[A-Za-z][A-Za-z0-9\.\-\_:\/]*$
type: string
type: array
MetricContentEncoding:
default: deflate
description: HTTP header used to compress the media-type.
enum:
- deflate
type: string
x-enum-varnames:
- DEFLATE
MetricCustomAggregation:
description: A time and space aggregation combination for use in query.
example:
Expand Down Expand Up @@ -4081,10 +4097,151 @@ components:
type: string
x-enum-varnames:
- METRIC_VOLUMES
MetricIntakeType:
description: The type of metric.
enum:
- 0
- 1
- 2
- 3
- 15
format: int32
type: integer
x-enum-varnames:
- UNSPECIFIED
- COUNT
- RATE
- GAUGE
- UNSPECIFIED_LEGACY
MetricMetadata:
description: Metadata for the metric.
properties:
origin:
$ref: '#/components/schemas/MetricOrigin'
type: object
MetricName:
description: The metric name for this resource.
example: test.metric.latency
type: string
MetricOrigin:
description: Metric origin information.
properties:
metric_type:
default: 0
description: The origin metric type code
format: int32
maximum: 1000
type: integer
product:
default: 0
description: The origin product code
format: int32
maximum: 1000
type: integer
service:
default: 0
description: The origin service code
format: int32
maximum: 1000
type: integer
type: object
MetricPayload:
description: The metrics' payload.
properties:
series:
description: A list of time series to submit to Datadog.
example:
- metric: system.load.1
points:
- timestamp: 1475317847
value: 0.7
items:
$ref: '#/components/schemas/MetricSeries'
type: array
required:
- series
type: object
MetricPoint:
description: A point object is of the form `{POSIX_timestamp, numeric_value}`.
example:
timestamp: 1575317847
value: 0.5
properties:
timestamp:
description: 'The timestamp should be in seconds and current.

Current is defined as not more than 10 minutes in the future or more than
1 hour in the past.'
format: int64
type: integer
value:
description: The numeric value format should be a 64bit float gauge-type
value.
format: double
type: number
type: object
MetricResource:
description: Metric resource.
properties:
name:
description: The name of the metric.
type: string
type:
description: The type of metric.
type: string
type: object
MetricSeries:
description: 'A metric to submit to Datadog.

See [Datadog metrics](https://docs.datadoghq.com/developers/metrics/#custom-metrics-properties).'
properties:
interval:
description: If the type of the metric is rate or count, define the corresponding
interval.
example: 20
format: int64
type: integer
metadata:
$ref: '#/components/schemas/MetricMetadata'
metric:
description: The name of the timeseries.
example: system.load.1
type: string
points:
description: Points relating to a metric. All points must be objects with
timestamp and a scalar value (cannot be a string). Timestamps should be
in POSIX time in seconds, and cannot be more than ten minutes in the future
or more than one hour in the past.
items:
$ref: '#/components/schemas/MetricPoint'
type: array
resources:
description: A list of resources to associate with this metric.
items:
$ref: '#/components/schemas/MetricResource'
type: array
source_type_name:
description: The source type name.
example: datadog
type: string
tags:
description: A list of tags associated with the metric.
example:
- environment:test
items:
description: Individual tags.
type: string
type: array
type:
$ref: '#/components/schemas/MetricIntakeType'
unit:
description: The unit of point value.
example: second
type: string
required:
- metric
- points
type: object
MetricTagConfiguration:
description: Object for a single metric tag configuration.
example:
Expand Down Expand Up @@ -11595,6 +11752,80 @@ 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/series:
post:
description: "The metrics end-point allows you to post time-series data that
can be graphed on Datadog\u2019s dashboards.\nThe maximum payload size is
500 kilobytes (512000 bytes). Compressed payloads must have a decompressed
size of less than 5 megabytes (5242880 bytes).\n\nIf you\u2019re submitting
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."
operationId: SubmitMetrics
parameters:
- description: HTTP header used to compress the media-type.
in: header
name: Content-Encoding
required: false
schema:
$ref: '#/components/schemas/MetricContentEncoding'
requestBody:
content:
application/json:
examples:
dynamic-points:
description: "Post time-series data that can be graphed on Datadog\u2019s
dashboards."
externalValue: examples/metrics/dynamic-points.json.sh
summary: Dynamic Points
x-variables:
NOW: $(date +%s)
schema:
$ref: '#/components/schemas/MetricPayload'
required: true
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/IntakePayloadAccepted'
description: Payload accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Authentication error
'408':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Request timeout
'413':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Payload too large
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
summary: Submit metrics
tags:
- Metrics
x-codegen-request-body-name: body
x-menu-order: 1
x-undo:
type: safe
/api/v2/service_accounts:
post:
description: Create a service account for your organization.
Expand Down
72 changes: 72 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,14 @@ incidents\_response
:undoc-members:
:show-inheritance:

intake\_payload\_accepted
-------------------------

.. automodule:: datadog_api_client.v2.model.intake_payload_accepted
:members:
:undoc-members:
:show-inheritance:

list\_application\_keys\_response
---------------------------------

Expand Down Expand Up @@ -1937,6 +1945,14 @@ metric\_bulk\_tag\_config\_tag\_name\_list
:undoc-members:
:show-inheritance:

metric\_content\_encoding
-------------------------

.. automodule:: datadog_api_client.v2.model.metric_content_encoding
:members:
:undoc-members:
:show-inheritance:

metric\_custom\_aggregation
---------------------------

Expand Down Expand Up @@ -2057,6 +2073,62 @@ metric\_ingested\_indexed\_volume\_type
:undoc-members:
:show-inheritance:

metric\_intake\_type
--------------------

.. automodule:: datadog_api_client.v2.model.metric_intake_type
:members:
:undoc-members:
:show-inheritance:

metric\_metadata
----------------

.. automodule:: datadog_api_client.v2.model.metric_metadata
:members:
:undoc-members:
:show-inheritance:

metric\_origin
--------------

.. automodule:: datadog_api_client.v2.model.metric_origin
:members:
:undoc-members:
:show-inheritance:

metric\_payload
---------------

.. automodule:: datadog_api_client.v2.model.metric_payload
:members:
:undoc-members:
:show-inheritance:

metric\_point
-------------

.. automodule:: datadog_api_client.v2.model.metric_point
:members:
:undoc-members:
:show-inheritance:

metric\_resource
----------------

.. automodule:: datadog_api_client.v2.model.metric_resource
:members:
:undoc-members:
:show-inheritance:

metric\_series
--------------

.. automodule:: datadog_api_client.v2.model.metric_series
:members:
:undoc-members:
:show-inheritance:

metric\_tag\_configuration
--------------------------

Expand Down
Loading