Skip to main content

Attribute Sensor for AWS Fargate

This document outlines the necessary information and configuration to install the Attribute sensor within an AWS Fargate task definition.

Background

Attribute is a FinOps platform that uncovers a new layer of application-level runtime data and connects it directly to cloud and SaaS platform costs. We've developed a unique, first-of-its-kind AWS Fargate sensor that lets you analyze task-level costs and attribute them to resources such as S3, RDS, ElastiCache, and others.

Please review the instructions below, and reach out to our team with any questions.

Step 1: Update containerDefinitions

In your task definition, modify the relevant containerDefinition as follows.

Add environment variables to the environment section:

"environment": [
{
"name": "CONFIG_ZPROBE_BEARER_TOKEN",
"value": "<token>"
},
{
"name": "CONFIG_ZPROBE_OTEL_ADDR",
"value": "otel-endpoint.app.attrb.io:443"
}
]

Add a dependency to the dependsOn section:

"dependsOn": [
{
"containerName": "attribute-sensor-loader",
"condition": "COMPLETE"
}
]

Add a mount to the mountPoints section:

"mountPoints": [
{
"sourceVolume": "attribute-shared",
"containerPath": "/opt/attrb"
}
]

Change the entryPoint and command of the container:

"entryPoint": [
"/opt/attrb/launch/ecs-fargate"
],
"command": [
"<original entrypoint + command>",
"-javaagent:/opt/attrb/jagent.jar"
]
Note

The -javaagent:/opt/attrb/jagent.jar line only applies to Java/Scala applications. Omit it for other runtimes.

Add another container definition to containerDefinitions:

{
"name": "attribute-sensor-loader",
"image": "quay.io/attribute/sensor:<tag>",
"essential": false,
"entryPoint": [
"load_attribute"
],
"mountPoints": [
{
"sourceVolume": "attribute-shared",
"containerPath": "/opt/attrb"
}
]
}

Step 2: Update volumes

Add the shared volume to the volumes section:

"volumes": [
{
"name": "attribute-shared"
}
]

Notes

  • It is recommended to create a new revision of your task definition when making these changes, then update your ECS service accordingly.
  • Performance and availability:
    • The sensor runs as an embedded process within the container. We recommend increasing the CPU allocation by 1 vCPU to ensure minimal performance impact.
    • If the sensor fails, application functionality should not be affected.
    • Terraform automation for installation is supported.

Appendix A: Example of a Complete Task Definition

{
"family": "<family>",
"containerDefinitions": [
{
"name": "<image-name>",
"image": "<image>",
"environment": [
{
"name": "CONFIG_ZPROBE_BEARER_TOKEN",
"value": "<token>"
},
{
"name": "CONFIG_ZPROBE_OTEL_ADDR",
"value": "otel-endpoint.app.attrb.io:443"
}
],
"workingDirectory": "/app",
"cpu": 0,
"essential": true,
"dependsOn": [
{
"containerName": "attribute-sensor-loader",
"condition": "COMPLETE"
}
],
"entryPoint": [
"/opt/attrb/launch/ecs-fargate"
],
"command": [
"/app/bin/mongo-scala",
"-javaagent:/opt/attrb/jagent.jar"
],
"mountPoints": [
{
"sourceVolume": "attribute-shared",
"containerPath": "/opt/attrb"
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/go-zprobe-fargate",
"mode": "non-blocking",
"awslogs-create-group": "true",
"max-buffer-size": "25m",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
}
},
{
"name": "attribute-sensor-loader",
"image": "quay.io/attribute/sensor:<tag>",
"essential": false,
"entryPoint": [
"load_attribute"
],
"mountPoints": [
{
"sourceVolume": "attribute-shared",
"containerPath": "/opt/attrb"
}
]
}
],
"volumes": [
{
"name": "attribute-shared"
}
],
"executionRoleArn": "<role>",
"networkMode": "awsvpc",
"placementConstraints": [],
"requiresCompatibilities": ["FARGATE"],
"cpu": "4096",
"memory": "8192",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
},
"enableFaultInjection": false
}

Trademarks: AWS is a trademark of Amazon.com, Inc. or its affiliates. All other trademarks are the property of their respective owners.