Skip to content

feat(collectionagent): add ecs ec2 collection agent - #192

Open
Nageshbansal wants to merge 2 commits into
feat/runnerfrom
feat/ca/ecsec2
Open

feat(collectionagent): add ecs ec2 collection agent#192
Nageshbansal wants to merge 2 commits into
feat/runnerfrom
feat/ca/ecsec2

Conversation

@Nageshbansal

@Nageshbansal Nageshbansal commented Sep 2, 2026

Copy link
Copy Markdown
Member

Features

  • Adds the ecs/ec2/terraform CollectionAgent casting: a DAEMON service running one stock contrib collector per container instance on host networking, with OTLP, hostmetrics, docker_stats and filelog.
  • Delivers the collector config through AWS AppConfig: a hosted configuration version, an agent sidecar that writes it into the task, and a config digest on the task definition so a changed config replaces the task rather than being rewritten under a running collector.
  • Gives container logs their identity from the four ECS labels docker's json-file driver copies into each line, and carves container.id out of the file path. A task definition without the labels option still produces records, carrying container.id alone.
  • Detects env and ec2 only. On a DAEMON the ecs and docker detectors answer for the collector's own task and would stamp every container's telemetry with the agent's identity.
  • Collects the instance's own logs (/var/log/messages, /var/log/secure, /var/log/ecs/*.log) as service.name=ecs-host.
  • Runs the agent's own two containers on the none log driver, so the collector does not tail itself through the docker-containers mount.
  • Creates the task and execution roles, or references the ARNs stated on the casting and creates neither.
  • Reads four annotations: foundry.signoz.io/ecs-region, ecs-cluster-arn, ecs-task-role-arn, ecs-task-execution-role-arn.
  • Ships an example whose README covers the labels block every task definition needs for its logs to carry a service name, the patch that swaps the agent's own log driver for awslogs, and that awslogs containers are out of scope.

Tests

  • Template tests across both role branches: AppConfig delivery, the DAEMON service settings, resource names, the detector list, and that the label lifts tolerate a task definition that carries no labels.

Related: https://github.com/SigNoz/platform-pod/issues/1973

@Nageshbansal
Nageshbansal force-pushed the feat/runner branch 2 times, most recently from 9e86648 to 52024fb Compare September 3, 2026 15:57
On a DAEMON the ecs and docker detectors answer for the collector's own
task, so every container's logs carried the agent's identity. The agent
detects env and ec2 only, and lifts the four ECS labels that docker's
json-file driver copies into each line onto the log's resource, carving
container.id out of the file path. A task definition without the labels
option still produces records, carrying container.id alone.

Adds filelog/host over the instance's own logs, which the /hostfs mount
the task already carries reaches.

Both containers log to the none driver. ECS otherwise falls back to
json-file and the agent tails itself through the docker-containers
mount.

Renames the cloud resources onto the <scope>-<type>[-<qualifier>]
grammar: the IAM roles gain their type, and the AppConfig application
and its deployment strategy stop sharing a name with the workload.

The example README gains the labels requirement, the patch that swaps
the agent's own log driver for awslogs, and the name-length caveat.
@Nageshbansal
Nageshbansal marked this pull request as ready for review September 4, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant