Skip to content

[DOCS-10330] Add Set up Worker in ECS Fargate #29356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/_default/menus/main.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5443,6 +5443,11 @@ menu:
identifier: install_the_worker_commands
parent: observability_pipelines_install_the_worker
weight: 201
- name: ECS Fargate
url: observability_pipelines/install_the_worker/set_up_the_worker_in_ecs_fargate/
identifier: install_the_worker_ecs_fargate
parent: observability_pipelines_install_the_worker
weight: 202
- name: Update Existing Pipelines
url: observability_pipelines/update_existing_pipelines/
parent: observability_pipelines
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: Set Up the Worker in ECS Fargate
disable_toc: false
---

## Overview

This document goes over one of the ways you can set up the Observability Pipelines Worker in ECS Fargate.

## Setup

The setup configuration for this example consists of a Fargate task, Fargate service, and a load balancer.

{{< img src="observability_pipelines/worker_fargate_architecture.png" alt="An architecture diagram with logs going to an application load balancer, a OP Worker task, and the Fargate service" style="width:100%;" >}}

## Configure the task definition

[Create a task definition][1]. The task definition describes which containers to run, the configuration (such as the environment variables and ports), and the CPU and memory resources allocated for the task.

Check notice on line 18 in content/en/observability_pipelines/install_the_worker/set_up_the_worker_in_ecs_fargate.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.

Set the `DD_OP_SOURCE_*` environment variable according to the configuration of the pipeline and port mappings. `DD_OP_API_ENABLED` and `DD_OP_API_ADDRESS` are used to allow the load balancer to do health checks on the routing targets. The CPU and memory resources should be increased for the production usage.

An example task definition:

```json
{
"family": "my-opw",
"containerDefinitions": [
{
"name": "my-opw",
"image": "datadog/observability-pipelines-worker",
"cpu": 0,
"portMappings": [
{
"name": "my-opw-80-tcp",
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"command": [
"run"
],
"environment": [
{
"name": "DD_OP_API_ENABLED",
"value": "true"
},
{
"name": "DD_API_KEY",
"value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
{
"name": "DD_SITE",
"value": "datadoghq.com"
},
{
"name": "DD_OP_API_ADDRESS",
"value": "0.0.0.0:8181"
},
{
"name": "DD_OP_SOURCE_HTTP_SERVER_ADDRESS",
"value": "0.0.0.0:80"
},
{
"name": "DD_OP_PIPELINE_ID",
"value": "e4454df2-f3a1-11ef-8654-test"
}
],
"mountPoints": [],
"volumesFrom": [],
"systemControls": []
}
],
"tags": [
{
"key": "PrincipalId",
"value": "AROAYYB64AB3JW3TEST"
},
{
"key": "User",
"value": "username@test.com"
}
],
"executionRoleArn": "arn:aws:iam::60142xxxxxx:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"volumes": [],
"placementConstraints": [],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "256",
"memory": "512"
}
```

## Configure the ECS service

Check warning on line 97 in content/en/observability_pipelines/install_the_worker/set_up_the_worker_in_ecs_fargate.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.headings

'Configure the ECS service' should use sentence-style capitalization.

[Create an ECS service][2]. The service configuration sets the number of Worker replicas to run and the scaling policy. In this example, the scaling policy is set to target an average CPU utilization of 70% with a minimum of two replicas and a maximum of five replicas.

Check notice on line 99 in content/en/observability_pipelines/install_the_worker/set_up_the_worker_in_ecs_fargate.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.

## Set up load balancing

[Configure an application load balancer][3] to target the group of Fargate tasks you defined earlier. Configure the health check against the Observability Pipelines' API port that was set in the task definition.

[1]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html
[2]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html
[3]: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading