Skip to content

magnetikonline/terraform-aws-datadog-metric-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform AWS -> Datadog metric stream

A boilerplate Terraform configuration for AWS infrastructure to support CloudWatch Metric Streams for the delivery of metrics into Datadog.

This offers significantly faster delivery of CloudWatch metrics into Datadog, via a CloudWatch metric stream for batching/pushing into Datadog every 2-3 minutes vs. the traditional approach of Datadog polling CloudWatch APIs for metrics approximately every 10 minutes.

Implementation

Resources created and their interplay:

  • CloudWatch metric stream takes selected CloudWatch metric AWS namespaces and feeds into a connected Kinesis Firehose delivery stream.
  • Kinesis Data Firehose delivery stream buffers received stream metrics and periodically pushes to a nominated HTTP target endpoint - in this instance the Datadog metrics intake API.
  • An S3 bucket, which is required by the Kinesis Data Firehose delivery stream to store either: all data received, or data which failed delivery to the Datadog metrics intake API. The Terraform configuration presented here uses the latter mode of operation (delivery failures only).

Terraform variables

See example.tfvars for usage of these variables.

Variable Description
datadog_api_key Datadog API key, sent along with HTTP push requests made by the Kinesis Data Firehose delivery stream.
datadog_firehose_endpoint HTTPS endpoint for delivery of metrics payloads into Datadog. Will differ based on the location of your Datadog account (US/EU).
datadog_metric_stream_namespace_list List of CloudWatch metric namespaces for streamed delivery. Note: Metrics which are not delivered to Datadog via the stream will continue to pulled using the classic CloudWatch API polling method.
datadog_buffering_interval_seconds How often Kinesis Data Firehose metric buffer is flushed to the HTTP endpoint. Smaller values result in metrics appearing faster, at the cost of a greater number of Datadog HTTP API calls.

Related

About

Boilerplate Terraform configuration for AWS infrastructure to support CloudWatch Metric Streams for delivery of metrics into Datadog.

Topics

Resources

License

Stars

Watchers

Forks

Languages