Envoy Proxy Sidecar for ECS Applications
This guide explains adding an Envoy proxy sidecar to ECS-based applications to help monitor and control traffic. The Envoy sidecar sits between the AWS Application Load Balancer (ALB) and your application container, enabling features like TLS encryption, protocol support (HTTP/1.1, HTTP/2, gRPC), and deep request inspection without changing your application code.
Before You Begin
Before you proceed with the instrumentation steps, ensure the following prerequisites are met:
You have access to the Envoy proxy container image, and permissions to pull it from the appropriate container registry. Contact Traceable support if you need help accessing the image.
You are familiar with ECS task definitions and how to edit them.
You have access to modify the AWS Application Load Balancer (ALB) and its target groups.
The application deployed in ECS is reachable on a defined port.
You know whether your application’s port is configurable or not.
You have the Traceable Platform Agent (TPA) installed and accessible, and you know its hostname or IP address.
You have permission to create or modify secrets in AWS Secrets Manager if you plan to use TLS verification with trusted CAs.
Minimum Required Configuration
To get started quickly, the following minimum set of environment variables must be configured in your ECS task definition to enable basic routing and observability. For a complete list of supported variables and advanced options, see the Configuration Reference section below:
TA_APP_PORT
443
Port your application listens on
TA_ENVOY_LISTENER_PORT
8443
Port Envoy listens on for incoming traffic
TA_APP_HOST
localhost
Hostname or IP address of the application
TA_REPORTING_HOST
<TPA_DOMAIN>
Hostname or IP of the Traceable Platform Agent
TA_REPORTING_PORT
5443
Port used to report data to TPA
TA_OBSERVABILITY_MODE
true
Enables traffic observability to TPA
TA_SERVICE_NAME
ext_proc
Logical name used for traffic categorization
Instrumentation Steps
Step 1 — Configure Listener Ports
A listening port is the network port on which an application or service waits to receive incoming traffic. It acts as the entry point for communication between clients and the server.
Depending on whether the application’s listening port is configurable:
Configurable Application Port: The application allows its listening port to be modified through configuration.
Change the application’s port and specify it using the
TA_APP_PORTenvironment variable in the Envoy sidecar.Set
TA_ENVOY_LISTENER_PORTas the ALB target group port. This ensures that incoming traffic from the ALB is directed to the Envoy proxy sidecar instead of the application container.
No ALB port changes are needed.
Non-Configurable Application Port: The application has a fixed listening port that cannot be changed.
Modify or create the ALB target group to point to
TA_ENVOY_LISTENER_PORT.Set
TA_APP_PORTto the application’s existing port in the Envoy sidecar configuration.
Step 2 — Update ECS Task Definition
In the containerDefinitions section of your ECS task definition, add the Envoy sidecar configuration as shown below. You can get the sidecar image from Docker Hub at: traceableai/ecs-envoy-proxy:1.0.0:
Step 3 — Configure Additional Environment Variables
Refer to the Configuration Reference section below to understand and customize the available options. To view the complete list of supported environment variables, go to the Configuration Reference section.
Step 4 — Deploy the ECS Service
Use the modified task definition to create or update your ECS service. When the service is deployed, ECS will launch both the application container and the Envoy proxy container as part of the same task. The Envoy sidecar will automatically intercept and forward incoming traffic to the application, enabling observability and control without requiring any changes to the application code.
Configuration Reference
TA_ENVOY_ADMIN_PORT
9001
Envoy admin interface for debugging
TA_ENVOY_LISTENER_PORT
443
Port on which the Envoy proxy listens
TA_SERVICE_TIMEOUT
0.2s
Timeout for ext_proc filter request
TA_ENVIRONMENT
—
Overrides TPA environment (optional)
TA_SERVICE_NAME
ext_proc
Agent service name
TA_FAILURE_MODE_ALLOW
true
Allows fallback if connection fails. Allowed values: true, false
TA_MESSAGE_TIMEOUT
0.2s
Timeout per message in sync mode
TA_HTTP_REQUEST_HEADER_PROCESSING_MODE
SEND
Controls if request headers are sent. Allowed values: SEND, SKIP
TA_HTTP_REQUEST_BODY_PROCESSING_MODE
STREAMED
Request body streaming options. Allowed values: STREAMED, BUFFERED, BUFFERED_PARTIAL, NONE
TA_HTTP_REQUEST_TRAILER_PROCESSING_MODE
SKIP
Controls if request trailers are sent. Allowed values: SEND, SKIP
TA_HTTP_RESPONSE_HEADER_PROCESSING_MODE
SEND
Controls if response headers are sent. Allowed values: SEND, SKIP
TA_HTTP_RESPONSE_BODY_PROCESSING_MODE
STREAMED
Controls if response body is streamed. Allowed values: STREAMED, BUFFERED, BUFFERED_PARTIAL, NONE
TA_HTTP_RESPONSE_TRAILER_PROCESSING_MODE
SKIP
Controls if response trailers are sent. Allowed values: SEND, SKIP
TA_ALLOW_MODE_OVERRIDE
false
Allows TME to override filter modes. Allowed values: true, false
TA_OBSERVABILITY_MODE
true
Enables real-time streaming to TPA. Allowed values: true, false
TA_UPSTREAM_CLUSTER_CONNECT_TIMEOUT
2s
Timeout for upstream connections
TA_APP_HOST
127.0.0.1
Backend application host
TA_APP_PORT
8443
Backend application port
TA_UPSTREAM_USE_TLS
true
Enables TLS to upstream
TA_USE_DOWNSTREAM_PROTOCOL_CONFIG
false
Preserves client protocol for upstream
TA_ALPN_PROTOCOLS
h2,http/1.1
Supported protocols (can be customized)
TA_REPORTING_HOST
127.0.0.1
TPA endpoint
TA_REPORTING_PORT
5443
Port used to report to TPA
TA_TPA_CLUSTER_CONNECT_TIMEOUT
2s
TPA connection timeout
TA_ENVOY_DEBUG_LEVEL
info
Logging verbosity for Envoy
TA_TPA_CERT_TRUST_CHAIN_VERIFICATION
VERIFY_TRUST_CHAIN
Certificate verification for TPA. Allowed values: VERIFY_TRUST_CHAIN, ACCEPT_UNTRUSTED
TA_TPA_TRUSTED_CA
—
Trusted CA for TPA (base64-encoded secret)
TA_UPSTREAM_CERT_TRUST_CHAIN_VERIFICATION
VERIFY_TRUST_CHAIN
Certificate verification for upstream. Allowed values: VERIFY_TRUST_CHAIN, ACCEPT_UNTRUSTED
TA_UPSTREAM_TRUSTED_CA
—
Trusted CA for upstream (base64-encoded secret)
Configuring Trusted CAs via AWS Secrets Manager
This step is optional and only needed if you want to enforce TLS certificate verification for secure communication. By default, the Envoy proxy does not validate certificates. To improve security—especially in production environments—you can configure trusted Certificate Authorities (CAs) for both upstream services and the Traceable Platform Agent (TPA) using AWS Secrets Manager.
To enable SSL peer certificate verification:
Generate the CA certificates.
Navigate to AWS Secrets Manager.
Create a new secret and encode the certificates as base64.
Store the encoded value under a defined secret key.
Reference the key from your ECS task definition using
TA_UPSTREAM_TRUSTED_CAandTA_TPA_TRUSTED_CA.
Performance Considerations
Each Envoy proxy sidecar is optimized for up to 200 requests per second.
If load exceeds this limit, spans may be dropped.
For high-throughput workloads on a single container, set
TA_OBSERVABILITY_MODE=falseto reduce overhead.It is recommended to horizontally scale Envoy containers rather than increasing load on a single instance.
Last updated
Was this helpful?