Files
terraform-aws-observability…/modules/ecs-monitoring/README.md
T
Ruchika Modi 70405b9732 Adding Module and Example for ECS cluster monitoring with ecs_observer (#211)
* Adding Module and Example for ECS cluster monitoring with ecs_observer

* Adding Module and Example for ECS cluster monitoring with ecs_observer

* Incorporating PR comments

* Restructuring Examples and modules folder for ECS, Added content in main Readme

* Fixing path as per PR comments

* Parameterzing the config files, incorporated PR review comments

* Adding condition for AMP WS and fixing AMP endpoint

* Adding Document for ECS Monitoring and parameterized some variables

* Added sample dashboard

* Adding Document for ECS Monitoring and parameterized some variables

* Fixing failures detected by pre-commit

* Fixing failures detected by pre-commit

* Fixing failures detected by pre-commit

* Pre-commit fixes

* Fixing failures detected by pre-commit

* Fixing failures detected by pre-commit

* Pre-commit

* Fixing HIGH security alerts detected by pre-commit

* Fixing HIGH security alerts detected by pre-commit

* Fixing HIGH security alerts detected by pre-commit, 31stOct

* Add links after merge

* 2ndNov - Added condiotnal creation for Grafana WS and module versions for AMG, AMP

---------

Co-authored-by: Rodrigue Koffi <bonclay7@users.noreply.github.com>
2023-11-02 12:53:32 +01:00

5.6 KiB

Observability Module for ECS Monitoring using ecs_observer

This module provides ECS cluster monitoring with the following resources:

  • AWS Distro For OpenTelemetry Operator and Collector for Metrics and Traces
  • Creates Grafana Dashboards on Amazon Managed Grafana.
  • Creates SSM Parameter to store and distribute the ADOT config file

Pre-requisites

  • ECS Cluster with EC2 using examples --> ecs-cluster-with-vpc
  • Create a Prometheus Workspace either using the Console or using the commented code under modules/ecs-monitoring/main.tf.
  • Update your exisitng App(workload) ECS Task Definition to add below label/environment variable
    • Set ECS_PROMETHEUS_EXPORTER_PORT to point to the containerPort where the Prometheus metrics are exposed
    • Set Java_EMF_Metrics to true. The CloudWatch agent uses this flag to generated the embedded metric format in the log event.

This module makes use of the below open source projects:

See examples using this Terraform modules in the Amazon ECS section of this documentation

Requirements

Name Version
terraform >= 1.0.0
aws >= 5.0.0

Providers

Name Version
aws >= 5.0.0

Modules

Name Source Version
managed_grafana_default terraform-aws-modules/managed-service-grafana/aws 2.1.0
managed_prometheus_default terraform-aws-modules/managed-service-prometheus/aws 2.2.2

Resources

Name Type
aws_ecs_service.adot_ecs_prometheus resource
aws_ecs_task_definition.adot_ecs_prometheus resource
aws_ssm_parameter.adot_config resource
aws_region.current data source

Inputs

Name Description Type Default Required
aws_ecs_cluster_name Name of your ECS cluster string n/a yes
container_name Container Name for Adot string "adot_new" no
create_managed_grafana_ws Creates a Workspace for Amazon Managed Grafana bool true no
create_managed_prometheus_ws Creates a Workspace for Amazon Managed Prometheus bool true no
ecs_adot_cpu CPU to be allocated for the ADOT ECS TASK string "256" no
ecs_adot_mem Memory to be allocated for the ADOT ECS TASK string "512" no
ecs_metrics_collection_interval Collection interval for ecs metrics string "15s" no
execution_role_arn ARN of the IAM Execution Role string n/a yes
otel_image_ver Otel Docker Image version string "v0.31.0" no
otlp_grpc_endpoint otlpGrpcEndpoint string "0.0.0.0:4317" no
otlp_http_endpoint otlpHttpEndpoint string "0.0.0.0:4318" no
refresh_interval Refresh interval for ecs_observer string "60s" no
task_role_arn ARN of the IAM Task Role string n/a yes

Outputs

Name Description
grafana_workspace_endpoint The endpoint of the Grafana workspace
grafana_workspace_id The ID of the Grafana workspace
prometheus_workspace_id Identifier of the workspace
prometheus_workspace_prometheus_endpoint Prometheus endpoint available for this workspace