Skip to main content

historical_metrics_configurations

Creates, updates, deletes, gets or lists a historical_metrics_configurations resource.

Overview

Namehistorical_metrics_configurations
TypeResource
Iddatadog.metrics.historical_metrics_configurations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe metric name, used as the resource ID. (example: dd.test.metric)
attributesobjectAttributes of a historical metrics configuration.
typestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_historical_metrics_configurationselectmetric_nameGet 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_configurationinsertdataEnable 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_configurationdeletemetric_nameDisable 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.

NameDatatypeDescription
metric_namestringThe name of the metric. (example: dist.http.endpoint.request)
sitestringThe 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 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

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
;

DELETE examples

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
;