List the tag indexing rules that apply to a given metric, sorted by rule_order.
Matching is performed server-side using each rule’s metric_name_matches glob patterns.
This endpoint requires the metrics_read permission.
OAuth apps require the metrics_read authorization scope to access this endpoint.
When true, the rule excludes the listed tags and indexes all others. When false (default), the rule includes only the listed tags.
ignored_metric_name_matches
[string]
Metric name prefixes excluded from the rule's scope.
metric_name_matches
[string]
Metric name prefixes (glob patterns) this rule applies to.
modified_at
date-time
Timestamp when the rule was last modified.
modified_by_handle
string
Handle of the user who last modified the rule.
name
string
Human-readable name for the rule.
options
object
Versioned configuration options for a tag indexing rule.
data
object
Data payload for tag indexing rule options.
dynamic_tags
object
Options for dynamic tag indexing applied per metric, such as tags filtered by query usage.
Before a tag key is dropped by this rule, two grace period conditions must be met:
The metric must be submitted for at least as long as the selected window.
A tag key must have been submitted for at least 15 days.
Any metric or tag key that does not meet these conditions are excluded from this
indexing rule. The exclude_not_* fields require exclude_tags_mode to be set to true.
exclude_not_queried_window_seconds
int64
Tags that have not been queried within this window are excluded from indexing. Maximum of 7776000 (90 days).
exclude_not_used_in_assets
boolean
Tags not used in any dashboards, monitors, notebooks, or SLOs are excluded from indexing.
manage_preexisting_metrics
boolean
When true, the rule applies to metrics that were ingested before the rule was created.
metric_match
object
Criteria for matching metrics based on query state.
is_queried
boolean
Match metrics that are being queried.
not_queried
boolean
Match metrics that are not being queried.
not_used_in_assets
boolean
Match metrics not used in any dashboards or monitors.
queried_window_seconds
int64
Window in seconds for evaluating query state.
used_in_assets
boolean
Match metrics used in dashboards or monitors.
override_previous_rules
boolean
When true, this rule's tag list overrides tags configured by earlier rules for the same metric. When false (default), tags from all matching rules are combined.
version
int64
Options schema version. Only 1 is supported.
rule_order
int64
Evaluation order within the org. Lower values are evaluated first. Assigned server-side on create (max+1); pass on update to change the rule's position.
tags
[string]
Tag keys managed by this rule.
id
string
The unique identifier (UUID) of the tag indexing rule.
type
enum
The tag indexing rule resource type.
Allowed enum values: tag_indexing_rules
default: tag_indexing_rules
links
object
Pagination links. Only present if pagination query parameters were provided.
first
string
Link to the first page.
last
string
Link to the last page.
next
string
Link to the next page.
prev
string
Link to previous page.
self
string
Link to current page.
meta
object
Pagination metadata for a list of tag indexing rules.
# Path parameters exportmetric_name="dist.http.endpoint.request" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
List tag indexing rules for a metric returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.metrics_apiimportMetricsApiconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]configuration.unstable_operations["list_tag_indexing_rules_for_metric"]=TruewithApiClient(configuration)asapi_client:api_instance=MetricsApi(api_client)response=api_instance.list_tag_indexing_rules_for_metric(metric_name="ExampleMetric",)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# List tag indexing rules for a metric returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]config.unstable_operations["v2.list_tag_indexing_rules_for_metric".to_sym]=trueendapi_instance=DatadogAPIClient::V2::MetricsAPI.newpapi_instance.list_tag_indexing_rules_for_metric("ExampleMetric")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// List tag indexing rules for a metric returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListTagIndexingRulesForMetric",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewMetricsApi(apiClient)resp,r,err:=api.ListTagIndexingRulesForMetric(ctx,"ExampleMetric")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `MetricsApi.ListTagIndexingRulesForMetric`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `MetricsApi.ListTagIndexingRulesForMetric`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// List tag indexing rules for a metric returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.MetricsApi;importcom.datadog.api.client.v2.model.TagIndexingRulesResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));defaultClient.setUnstableOperationEnabled("v2.listTagIndexingRulesForMetric",true);MetricsApiapiInstance=newMetricsApi(defaultClient);try{TagIndexingRulesResponseresult=apiInstance.listTagIndexingRulesForMetric("ExampleMetric");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling MetricsApi#listTagIndexingRulesForMetric");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// List tag indexing rules for a metric returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_metrics::MetricsAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListTagIndexingRulesForMetric",true);letapi=MetricsAPI::with_config(configuration);letresp=api.list_tag_indexing_rules_for_metric("ExampleMetric".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List tag indexing rules for a metric returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});configuration.unstableOperations["v2.listTagIndexingRulesForMetric"]=true;constapiInstance=newv2.MetricsApi(configuration);constparams: v2.MetricsApiListTagIndexingRulesForMetricRequest={metricName:"ExampleMetric",};apiInstance.listTagIndexingRulesForMetric(params).then((data: v2.TagIndexingRulesResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
パーソナライズされたデモをリクエスト
Datadog を始める
Ask AI
AI-generated responses may be inaccurate. Verify important info.