Returns why a metric is excluded from tag indexing rules.
Returns 200 with kind=exemption when an explicit exemption exists, 200 with
kind=legacy_tag_configuration when the metric has a legacy tag configuration acting as an
implicit exclusion, or 404 when neither applies.
This endpoint requires the metrics_read permission.
OAuth apps require the metrics_read authorization scope to access this endpoint.
Response containing a tag indexing rule exemption.
Expand All
Field
Type
Description
data
object
A tag indexing rule exemption resource object.
attributes
object
Attributes of a tag indexing rule exemption.
created_at
date-time
Timestamp when the exemption was created.
created_by_handle
string
Handle of the user who created the exemption.
kind
string
Discriminates between an explicit exemption (exemption) and a pre-existing legacy tag configuration acting as an implicit exclusion (legacy_tag_configuration).
reason
string
The reason the metric is exempt from tag indexing rules.
id
string
The metric name, used as the resource ID.
type
enum
The tag indexing rule exemption resource type.
Allowed enum values: tag_indexing_rule_exemptions
default: tag_indexing_rule_exemptions
{"data":{"attributes":{"created_at":"2024-01-15T12:00:00.000Z","created_by_handle":"user@datadoghq.com","kind":"exemption","reason":"This metric has a pre-existing tag configuration."},"id":"dd.test.metric","type":"tag_indexing_rule_exemptions"}}
"""
Get a tag indexing rule exemption returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.metrics_apiimportMetricsApiconfiguration=Configuration()configuration.unstable_operations["get_tag_indexing_rule_exemption"]=TruewithApiClient(configuration)asapi_client:api_instance=MetricsApi(api_client)response=api_instance.get_tag_indexing_rule_exemption(metric_name="metric_name",)print(response)
# Get a tag indexing rule exemption returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_tag_indexing_rule_exemption".to_sym]=trueendapi_instance=DatadogAPIClient::V2::MetricsAPI.newpapi_instance.get_tag_indexing_rule_exemption("metric_name")
// Get a tag indexing rule exemption 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())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetTagIndexingRuleExemption",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewMetricsApi(apiClient)resp,r,err:=api.GetTagIndexingRuleExemption(ctx,"metric_name")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `MetricsApi.GetTagIndexingRuleExemption`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `MetricsApi.GetTagIndexingRuleExemption`:\n%s\n",responseContent)}
// Get a tag indexing rule exemption 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.TagIndexingRuleExemptionResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getTagIndexingRuleExemption",true);MetricsApiapiInstance=newMetricsApi(defaultClient);try{TagIndexingRuleExemptionResponseresult=apiInstance.getTagIndexingRuleExemption("dist.http.endpoint.request");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling MetricsApi#getTagIndexingRuleExemption");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a tag indexing rule exemption 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.GetTagIndexingRuleExemption",true);letapi=MetricsAPI::with_config(configuration);letresp=api.get_tag_indexing_rule_exemption("metric_name".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
/**
* Get a tag indexing rule exemption returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getTagIndexingRuleExemption"]=true;constapiInstance=newv2.MetricsApi(configuration);constparams: v2.MetricsApiGetTagIndexingRuleExemptionRequest={metricName:"metric_name",};apiInstance.getTagIndexingRuleExemption(params).then((data: v2.TagIndexingRuleExemptionResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));