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.4",
"regenerated": "2022-08-29 15:23:50.079765",
"spec_repo_commit": "592474c8"
"regenerated": "2022-08-29 17:43:22.563285",
"spec_repo_commit": "0050c4a2"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-08-29 15:23:50.095711",
"spec_repo_commit": "592474c8"
"regenerated": "2022-08-29 17:43:22.580143",
"spec_repo_commit": "0050c4a2"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5515,12 +5515,16 @@ components:
x-enum-varnames:
- USER_AGENT_PARSER
MetricContentEncoding:
default: deflate
description: HTTP header used to compress the media-type.
enum:
- deflate
- gzip
example: deflate
type: string
x-enum-varnames:
- DEFLATE
- GZIP
MetricMetadata:
description: Object with all metric related metadata.
properties:
Expand Down
5 changes: 5 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4319,9 +4319,14 @@ components:
description: HTTP header used to compress the media-type.
enum:
- deflate
- zstd1
- gzip
example: deflate
type: string
x-enum-varnames:
- DEFLATE
- ZSTD1
- GZIP
MetricCustomAggregation:
description: A time and space aggregation combination for use in query.
example:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
repo: datadog-api-spec
status: pending
context: integration
- name: Install system zstd
run: |
sudo apt-get -y install zstd
echo "ZSTANDARD_LIBRARY=$(find /usr/lib -iname libzstd.so.1)" >> $GITHUB_ENV
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
Expand Down
23 changes: 23 additions & 0 deletions examples/v2/metrics/SubmitMetrics_1762007427.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Submit metrics with compression returns "Payload accepted" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::MetricsAPI.new

body = DatadogAPIClient::V2::MetricPayload.new({
series: [
DatadogAPIClient::V2::MetricSeries.new({
metric: "system.load.1",
type: DatadogAPIClient::V2::MetricIntakeType::UNSPECIFIED,
points: [
DatadogAPIClient::V2::MetricPoint.new({
timestamp: Time.now.to_i,
value: 0.7,
}),
],
}),
],
})
opts = {
content_encoding: MetricContentEncoding::ZSTD1,
}
p api_instance.submit_metrics(body, opts)
8 changes: 8 additions & 0 deletions features/v2/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ Feature: Metrics
When the request is sent
Then the response status is 408 Request timeout

@integration-only @skip-terraform-config @skip-validation @team:DataDog/metrics-intake @team:DataDog/metrics-query
Scenario: Submit metrics with compression 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 request contains "Content-Encoding" parameter with value "zstd1"
When the request is sent
Then the response status is 202 Payload accepted

@generated @skip @team:DataDog/points-aggregation
Scenario: Tag Configuration Cardinality Estimator returns "API error response." response
Given a valid "appKeyAuth" key in the system
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v1/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def submit_metrics_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MetricsAPI.submit_metrics ...'
end
allowable_values = ['deflate']
allowable_values = ['deflate', 'gzip']
if @api_client.config.client_side_validation && opts[:'content_encoding'] && !allowable_values.include?(opts[:'content_encoding'])
fail ArgumentError, "invalid value for \"content_encoding\", must be one of #{allowable_values}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ class MetricContentEncoding
include BaseEnumModel

DEFLATE = "deflate".freeze
GZIP = "gzip".freeze
end
end
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def submit_metrics_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MetricsAPI.submit_metrics ...'
end
allowable_values = ['deflate']
allowable_values = ['deflate', 'zstd1', 'gzip']
if @api_client.config.client_side_validation && opts[:'content_encoding'] && !allowable_values.include?(opts[:'content_encoding'])
fail ArgumentError, "invalid value for \"content_encoding\", must be one of #{allowable_values}"
end
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/v2/models/metric_content_encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ class MetricContentEncoding
include BaseEnumModel

DEFLATE = "deflate".freeze
ZSTD1 = "zstd1".freeze
GZIP = "gzip".freeze
end
end