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 .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "f2ae7eb",
"generated": "2025-07-17 19:53:16.203"
"spec_repo_commit": "dc49df4",
"generated": "2025-07-18 13:57:23.914"
}
110 changes: 108 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13911,14 +13911,21 @@ components:
type: string
type: object
EntityV3APIVersion:
description: The schema version of entity type. The field is known as schema-version
in the previous version.
description: The version of the schema data that was used to populate this entity's
data. This could be via the API, Terraform, or YAML file in a repository.
The field is known as schema-version in the previous version.
enum:
- v3
- v2.2
- v2.1
- v2
example: v3
type: string
x-enum-varnames:
- V3
- V2_2
- V2_1
- V2
EntityV3DatadogCodeLocationItem:
additionalProperties: false
description: Code location item.
Expand Down Expand Up @@ -23182,6 +23189,61 @@ components:
type: string
type: array
type: object
MetricTagCardinalitiesData:
description: A list of tag cardinalities associated with the given metric.
items:
$ref: '#/components/schemas/MetricTagCardinality'
type: array
MetricTagCardinalitiesMeta:
description: Response metadata object.
properties:
metric_name:
description: 'The name of metric for which the tag cardinalities are returned.

This matches the metric name provided in the request.

'
type: string
type: object
MetricTagCardinalitiesResponse:
description: 'Response object that includes an array of objects representing
the cardinality details of a metric''s tags.

'
properties:
data:
$ref: '#/components/schemas/MetricTagCardinalitiesData'
meta:
$ref: '#/components/schemas/MetricTagCardinalitiesMeta'
readOnly: true
type: object
MetricTagCardinality:
description: Object containing metadata and attributes related to a specific
tag key associated with the metric.
example:
attributes:
cardinality_delta: 25
id: http.request.latency
type: tag_cardinality
properties:
attributes:
$ref: '#/components/schemas/MetricTagCardinalityAttributes'
id:
description: The name of the tag key.
type: string
type:
default: tag_cardinality
description: This describes the endpoint action.
type: string
type: object
MetricTagCardinalityAttributes:
description: An object containing properties related to the tag key
properties:
cardinality_delta:
description: This describes the recent change in the tag keys cardinality
format: int64
type: integer
type: object
MetricTagConfiguration:
description: Object for a single metric tag configuration.
example:
Expand Down Expand Up @@ -53603,6 +53665,50 @@ paths:
x-permission:
operator: OPEN
permissions: []
/api/v2/metrics/{metric_name}/tag-cardinalities:
get:
description: Returns the cardinality details of tags for a specific metric.
operationId: GetMetricTagCardinalityDetails
parameters:
- $ref: '#/components/parameters/MetricName'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/MetricTagCardinalitiesResponse'
description: Success
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Found
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too Many Requests
summary: Get tag key cardinality details
tags:
- Metrics
x-permission:
operator: OR
permissions:
- metrics_read
/api/v2/metrics/{metric_name}/tags:
delete:
description: 'Deletes a metric''s tag configuration. Can only be used with application
Expand Down
5 changes: 5 additions & 0 deletions examples/v2/metrics/GetMetricTagCardinalityDetails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get tag key cardinality details returns "Success" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::MetricsAPI.new
p api_instance.get_metric_tag_cardinality_details("metric_name")
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,9 @@
"filter_pct" => "Boolean",
"filter_timespan_h" => "Integer",
},
"v2.GetMetricTagCardinalityDetails" => {
"metric_name" => "String",
},
"v2.DeleteTagConfiguration" => {
"metric_name" => "String",
},
Expand Down
24 changes: 24 additions & 0 deletions features/v2/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,30 @@ Feature: Metrics
Then the response status is 200 Success
And the response "data[0].type" is equal to "manage_tags"

@generated @skip @team:DataDog/metrics-experience
Scenario: Get tag key cardinality details returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "GetMetricTagCardinalityDetails" request
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/metrics-experience
Scenario: Get tag key cardinality details returns "Not Found" response
Given a valid "appKeyAuth" key in the system
And new "GetMetricTagCardinalityDetails" request
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/metrics-experience
Scenario: Get tag key cardinality details returns "Success" response
Given a valid "appKeyAuth" key in the system
And new "GetMetricTagCardinalityDetails" request
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 Success

@generated @skip @team:DataDog/metrics-experience
Scenario: List active tags and aggregations returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,12 @@
"type": "safe"
}
},
"GetMetricTagCardinalityDetails": {
"tag": "Metrics",
"undo": {
"type": "safe"
}
},
"DeleteTagConfiguration": {
"tag": "Metrics",
"undo": {
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,10 @@ def overrides
"v2.metric_suggested_tags_and_aggregations" => "MetricSuggestedTagsAndAggregations",
"v2.metric_suggested_tags_and_aggregations_response" => "MetricSuggestedTagsAndAggregationsResponse",
"v2.metric_suggested_tags_attributes" => "MetricSuggestedTagsAttributes",
"v2.metric_tag_cardinalities_meta" => "MetricTagCardinalitiesMeta",
"v2.metric_tag_cardinalities_response" => "MetricTagCardinalitiesResponse",
"v2.metric_tag_cardinality" => "MetricTagCardinality",
"v2.metric_tag_cardinality_attributes" => "MetricTagCardinalityAttributes",
"v2.metric_tag_configuration" => "MetricTagConfiguration",
"v2.metric_tag_configuration_attributes" => "MetricTagConfigurationAttributes",
"v2.metric_tag_configuration_create_attributes" => "MetricTagConfigurationCreateAttributes",
Expand Down
65 changes: 65 additions & 0 deletions lib/datadog_api_client/v2/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,71 @@ def estimate_metrics_output_series_with_http_info(metric_name, opts = {})
return data, status_code, headers
end

# Get tag key cardinality details.
#
# @see #get_metric_tag_cardinality_details_with_http_info
def get_metric_tag_cardinality_details(metric_name, opts = {})
data, _status_code, _headers = get_metric_tag_cardinality_details_with_http_info(metric_name, opts)
data
end

# Get tag key cardinality details.
#
# Returns the cardinality details of tags for a specific metric.
#
# @param metric_name [String] The name of the metric.
# @param opts [Hash] the optional parameters
# @return [Array<(MetricTagCardinalitiesResponse, Integer, Hash)>] MetricTagCardinalitiesResponse data, response status code and response headers
def get_metric_tag_cardinality_details_with_http_info(metric_name, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MetricsAPI.get_metric_tag_cardinality_details ...'
end
# verify the required parameter 'metric_name' is set
if @api_client.config.client_side_validation && metric_name.nil?
fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.get_metric_tag_cardinality_details"
end
# resource path
local_var_path = '/api/v2/metrics/{metric_name}/tag-cardinalities'.sub('{metric_name}', CGI.escape(metric_name.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'MetricTagCardinalitiesResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :get_metric_tag_cardinality_details,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: MetricsAPI#get_metric_tag_cardinality_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# List active tags and aggregations.
#
# @see #list_active_metric_configurations_with_http_info
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/models/entity_v3_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class EntityV3API
include BaseGenericModel

# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
attr_reader :api_version

# Datadog product integrations for the API entity.
Expand Down
5 changes: 4 additions & 1 deletion lib/datadog_api_client/v2/models/entity_v3_api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
require 'time'

module DatadogAPIClient::V2
# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
class EntityV3APIVersion
include BaseEnumModel

V3 = "v3".freeze
V2_2 = "v2.2".freeze
V2_1 = "v2.1".freeze
V2 = "v2".freeze
end
end
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/models/entity_v3_datastore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class EntityV3Datastore
include BaseGenericModel

# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
attr_reader :api_version

# Datadog product integrations for the datastore entity.
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/models/entity_v3_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class EntityV3Queue
include BaseGenericModel

# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
attr_reader :api_version

# Datadog product integrations for the datastore entity.
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/models/entity_v3_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class EntityV3Service
include BaseGenericModel

# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
attr_reader :api_version

# Datadog product integrations for the service entity.
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/models/entity_v3_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class EntityV3System
include BaseGenericModel

# The schema version of entity type. The field is known as schema-version in the previous version.
# The version of the schema data that was used to populate this entity's data. This could be via the API, Terraform, or YAML file in a repository. The field is known as schema-version in the previous version.
attr_reader :api_version

# Datadog product integrations for the service entity.
Expand Down
Loading
Loading