For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/metrics/update-a-tag-indexing-rule.md. A documentation index is available at /llms.txt.
Language
Datadog site

태그 인덱싱 규칙 업데이트

경고Note: The Tag Indexing Rules feature is currently in Preview. If you have any feedback, contact Datadog support.
PUThttps://api.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us3.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us5.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.datadoghq.eu/api/v2/metrics/tag-indexing-rules/{id}https://api.ap1.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.ap2.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.uk1.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.ddog-gov.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us2.ddog-gov.com/api/v2/metrics/tag-indexing-rules/{id}

개요

태그 인덱싱 규칙을 부분적으로 업데이트합니다. 요청 본문에서 생략된 필드는 변경되지 않은 상태로 유지됩니다. rule_order를 다른 규칙에서 이미 사용 중인 값으로 설정하면 409가 반환됩니다. 원자적 재정렬에 재정렬 엔드포인트를 사용합니다. Manage Tags for Metrics 권한이 필요합니다.

This endpoint requires the metric_tags_write permission.

OAuth apps require the metric_tags_write authorization scope to access this endpoint.

인수

경로 파라미터

이름
유형
설명
id [required]
string

ID of the tag indexing rule.

요청

Body Data (required)

항목
유형
설명
data [required]
object

태그 인덱싱 규칙 업데이트를 위한 요청 본문입니다.

응답

OK

Response containing a single tag indexing rule.

항목
유형
설명
data
object

A tag indexing rule resource object.

코드 예시

Update a tag indexing rule returns "OK" response
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {},
          "manage_preexisting_metrics": true,
          "metric_match": {
            "queried_window_seconds": 3600
          },
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
Update a tag indexing rule with exclude-mode tag usage fields returns "OK" response
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "exclude_tags_mode": true,
      "ignored_metric_name_matches": [],
      "metric_name_matches": [
        "dd.test.*"
      ],
      "name": "my-indexing-rule",
      "options": {
        "data": {
          "dynamic_tags": {
            "exclude_not_queried_window_seconds": 7200,
            "exclude_not_used_in_assets": true
          },
          "manage_preexisting_metrics": true,
          "override_previous_rules": false
        },
        "version": 1
      },
      "tags": [
        "env",
        "service"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF