historical_metrics_configurations
Creates, updates, deletes, gets or lists a historical_metrics_configurations resource.
Overview
| Name | historical_metrics_configurations |
| Type | Resource |
| Id | datadog.metrics.historical_metrics_configurations |
Fields
The following fields are returned by SELECT queries:
- get_historical_metrics_configuration
| Name | Datatype | Description |
|---|---|---|
id | string | The metric name, used as the resource ID. (example: dd.test.metric) |
attributes | object | Attributes of a historical metrics configuration. |
type | string | The historical metrics configuration resource type. (historical_metrics_configurations) (default: historical_metrics_configurations, example: historical_metrics_configurations) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_historical_metrics_configuration | select | metric_name | Get the historical metrics ingestion configuration for a metric. Existence of the<br />resource means historical metrics ingestion is enabled; returns 404 when it is not<br />enabled for the metric. | |
create_historical_metrics_configuration | insert | data | Enable historical metrics ingestion (late data ingestion) for a metric. Idempotent:<br />enabling an already-enabled metric returns 200 instead of 201. Not supported for<br />distribution metrics, metrics with an existing tag configuration, or most standard<br />(non-custom) metrics. | |
delete_historical_metrics_configuration | delete | metric_name | Disable historical metrics ingestion for a metric. Idempotent: always returns 204,<br />whether or not the configuration existed or the metric itself still exists, so that<br />Terraform destroy succeeds for a metric removed out-of-band. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
metric_name | string | The name of the metric. (example: dist.http.endpoint.request) |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
SELECT examples
- get_historical_metrics_configuration
Get the historical metrics ingestion configuration for a metric. Existence of the<br />resource means historical metrics ingestion is enabled; returns 404 when it is not<br />enabled for the metric.
SELECT
id,
attributes,
type
FROM datadog.metrics.historical_metrics_configurations
WHERE metric_name = '{{ metric_name }}' -- required
;
INSERT examples
- create_historical_metrics_configuration
- Manifest
Enable historical metrics ingestion (late data ingestion) for a metric. Idempotent:<br />enabling an already-enabled metric returns 200 instead of 201. Not supported for<br />distribution metrics, metrics with an existing tag configuration, or most standard<br />(non-custom) metrics.
INSERT INTO datadog.metrics.historical_metrics_configurations (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: historical_metrics_configurations
props:
- name: data
description: |
Data object for enabling historical metrics ingestion for a metric.
value:
id: "{{ id }}"
type: "{{ type }}"
DELETE examples
- delete_historical_metrics_configuration
Disable historical metrics ingestion for a metric. Idempotent: always returns 204,<br />whether or not the configuration existed or the metric itself still exists, so that<br />Terraform destroy succeeds for a metric removed out-of-band.
DELETE FROM datadog.metrics.historical_metrics_configurations
WHERE metric_name = '{{ metric_name }}' --required
;