ObserveNow
...
Cloud Providers
Amazon Web Services (AWS)

Elastic Container Service (ECS)

Telemetry from Elastic Container Service (ECS) clusters of types Fargate, EC2 or External can be brought into OpsVerse ObserveNow using an OpenTelemetry sidecar deployment. The sidecar is a lightweight container that runs in each application container of your ECS cluster and collects observability data and forwards it to ObserveNow.

Collecting Logs from ECS

Logs from ECS services are collected using AWS firelens log driver and AWS for fluentbit logs forwarder. The log forwarder is run as an additional container within the same service (aka sidecar container).

Step 1: Add the Log Forwarder Task

Add the following block to your task definition under the containerDefinitions section and redeploy your services. Update the value of awslogs-region to the right region.

Task Definition For The Log Router


Step 2: Forward App Logs to the Log Forwarder Sidecar

Change the app container's LogConfiguration section to the following:

App's LogConfoguration


The Opsverse logs endpoint and logs password are available on the OpsVerse admin console.

Step 3: View Logs in ObserveNow

Logs collected from ECS can be viewed under the Explore section of the Grafana that is part of ObserveNow. All logs have the label job=fluenbit added to them. This label can be used to easily search for the ECS logs.

ECS logs


Collecting Metrics and Traces From ECS

Container metrics and distributed traces can be collected using the Open Telemetry collector deployed as a sidecar container.

Step 1: Create The OTel Collector Config

The oterl-collector sidecar configuration is managed using a parameter in AWS Parameter Store. Create a new parameter named /ecs/opsverse/otelcol.yaml with the following configuration:

OTel Collector Config


Step 2: Update the ecsTaskExecution IAM Role

The sidecar container needs to have access to the AWS Parameter Store and Cloudwatch logs, add the following policies to the ecsTaskExecution role

  • AmazonSSMReadOnlyAccess
  • CloudWatchLogsFullAccess

Step 3: Add the OTel Collector SideCar Container

Update the task definition to run a sidecar container to run the OpenTelemetry image ( otel/opentelemetry-collector-contrib:0.105.0) with the config created above and redeploy the task definition to start seeing data from your ECS cluster in ObserveNow.

Add the following to the ContainerDefinitions section of the task definition:

JSON


Edit awslogs-region as required and redeploy the ECS service.

Step 4: View the metrics in ObserveNow

Metrics collected from ECS can be viewed under the Explore section of the Grafana that is part of ObserveNow.

Document image


Instrumenting Apps to Send Traces

The above steps install a otel collector that can receive distributed traces from task deployed in ECS. Follow the steps mentioned in the Application section of the documentation to instrument apps using OpenTelemetry. Here are some language specific doc pages:

Following env variables need to be added to the app's container def:



ECS TaskDefinition


For more detailed info about insturmenting using Open Telemetry, please refer to the official Open Telemtry this documentation.