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": "20279f4",
"generated": "2025-07-18 10:24:19.812"
"spec_repo_commit": "0f24b8e",
"generated": "2025-07-18 16:54:43.860"
}
198 changes: 198 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2016,11 +2016,13 @@ components:
description: The definition of `ActionConnectionIntegration` object.
oneOf:
- $ref: '#/components/schemas/AWSIntegration'
- $ref: '#/components/schemas/DatadogIntegration'
- $ref: '#/components/schemas/HTTPIntegration'
ActionConnectionIntegrationUpdate:
description: The definition of `ActionConnectionIntegrationUpdate` object.
oneOf:
- $ref: '#/components/schemas/AWSIntegrationUpdate'
- $ref: '#/components/schemas/DatadogIntegrationUpdate'
- $ref: '#/components/schemas/HTTPIntegrationUpdate'
ActionQuery:
description: An action query. This query type is used to trigger an action,
Expand Down Expand Up @@ -12378,6 +12380,103 @@ components:
required:
- databaseMonitoringTrigger
type: object
DatadogAPIKey:
description: The definition of the `DatadogAPIKey` object.
properties:
api_key:
description: The `DatadogAPIKey` `api_key`.
example: ''
type: string
app_key:
description: The `DatadogAPIKey` `app_key`.
example: ''
type: string
datacenter:
description: The `DatadogAPIKey` `datacenter`.
example: ''
type: string
subdomain:
description: Custom subdomain used for Datadog URLs generated with this
Connection. For example, if this org uses `https://acme.datadoghq.com`
to access Datadog, set this field to `acme`. If this field is omitted,
generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)).
type: string
type:
$ref: '#/components/schemas/DatadogAPIKeyType'
required:
- type
- datacenter
- api_key
- app_key
type: object
DatadogAPIKeyType:
description: The definition of the `DatadogAPIKey` object.
enum:
- DatadogAPIKey
example: DatadogAPIKey
type: string
x-enum-varnames:
- DATADOGAPIKEY
DatadogAPIKeyUpdate:
description: The definition of the `DatadogAPIKey` object.
properties:
api_key:
description: The `DatadogAPIKeyUpdate` `api_key`.
type: string
app_key:
description: The `DatadogAPIKeyUpdate` `app_key`.
type: string
datacenter:
description: The `DatadogAPIKeyUpdate` `datacenter`.
type: string
subdomain:
description: Custom subdomain used for Datadog URLs generated with this
Connection. For example, if this org uses `https://acme.datadoghq.com`
to access Datadog, set this field to `acme`. If this field is omitted,
generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)).
type: string
type:
$ref: '#/components/schemas/DatadogAPIKeyType'
required:
- type
type: object
DatadogCredentials:
description: The definition of the `DatadogCredentials` object.
oneOf:
- $ref: '#/components/schemas/DatadogAPIKey'
DatadogCredentialsUpdate:
description: The definition of the `DatadogCredentialsUpdate` object.
oneOf:
- $ref: '#/components/schemas/DatadogAPIKeyUpdate'
DatadogIntegration:
description: The definition of the `DatadogIntegration` object.
properties:
credentials:
$ref: '#/components/schemas/DatadogCredentials'
type:
$ref: '#/components/schemas/DatadogIntegrationType'
required:
- type
- credentials
type: object
DatadogIntegrationType:
description: The definition of the `DatadogIntegrationType` object.
enum:
- Datadog
example: Datadog
type: string
x-enum-varnames:
- DATADOG
DatadogIntegrationUpdate:
description: The definition of the `DatadogIntegrationUpdate` object.
properties:
credentials:
$ref: '#/components/schemas/DatadogCredentialsUpdate'
type:
$ref: '#/components/schemas/DatadogIntegrationType'
required:
- type
type: object
Dataset:
description: Dataset object.
properties:
Expand Down Expand Up @@ -23189,6 +23288,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 @@ -53610,6 +53764,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
78 changes: 78 additions & 0 deletions api/datadogV2/api_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,84 @@ func (a *MetricsApi) EstimateMetricsOutputSeries(ctx _context.Context, metricNam
return localVarReturnValue, localVarHTTPResponse, nil
}

// GetMetricTagCardinalityDetails Get tag key cardinality details.
// Returns the cardinality details of tags for a specific metric.
func (a *MetricsApi) GetMetricTagCardinalityDetails(ctx _context.Context, metricName string) (MetricTagCardinalitiesResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarReturnValue MetricTagCardinalitiesResponse
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MetricsApi.GetMetricTagCardinalityDetails")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/metrics/{metric_name}/tag-cardinalities"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{metric_name}", _neturl.PathEscape(datadog.ParameterToString(metricName, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "application/json"

if a.Client.Cfg.DelegatedTokenConfig != nil {
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
if err != nil {
return localVarReturnValue, nil, err
}
} else {
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
}
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// ListActiveMetricConfigurationsOptionalParameters holds optional parameters for ListActiveMetricConfigurations.
type ListActiveMetricConfigurationsOptionalParameters struct {
WindowSeconds *int64
Expand Down
1 change: 1 addition & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
// - [MetricsApi.DeleteBulkTagsMetricsConfiguration]
// - [MetricsApi.DeleteTagConfiguration]
// - [MetricsApi.EstimateMetricsOutputSeries]
// - [MetricsApi.GetMetricTagCardinalityDetails]
// - [MetricsApi.ListActiveMetricConfigurations]
// - [MetricsApi.ListMetricAssets]
// - [MetricsApi.ListTagConfigurationByName]
Expand Down
Loading
Loading