AWS Open Distro for OpenTelemetry

Use custom OpenTelemetry configuration file from SSM Parameter

Use custom OpenTelemetry configuration file from SSM Parameter

Learn how to upload custom OpenTelemetry configuration file to SSM Parameter store and use it with AWS OpenTelemetry Collector.




The AWS Observability Collector can optionally be configured via an environment variable AOT_CONFIG_CONTENT. The value of this variable is expected to be a full Collector configuration file; it will override the config file used in the Collector entrypoint command. In ECS, the values of environment variables can be set from AWS Systems Manager Parameters.

1. Update Task Defintion

1.1. Select Task Defintion

Go to AWS Management Console and select Elastic Container Service. From the left side navigation, select Task definition. Select the TaskDefinition we created to run AWS OpenTelemetry Collector and click the Create new revision button on top.

1.2. Add Environment Variable

From the container definition section, click the AWS OTel Collector container (image: amazon/aws-otel-collector) and go to the Environment variables section. Add a new environment variable- AOT_CONFIG_CONTENT. Select ValueFrom which will tell ECS to get the value from SSM Parameter, and set otel-collector-config (SSM parameter name which we will create in the next section) as the value. Finish updating the task definition and create a new revision.

Diagram



2. Create SSM Parameter

2.1. Go to Parameter Store

Let’s go to System Manager service from AWS Management Console and select Parameter Store from the left side navigation panel.

Diagram

2.2. Create New Parameter

From the top-right corner, click the Create new parameter button. Create a new parameter with the following information. The parameter name should be the same as we used in the environment variable of our task-definition.

  • Name: otel-collector-config
  • Tier: Standard
  • Type: String
  • Data type: Text
  • Value: Copy and paste your custom OpenTelemetry configuration file.



3. Run Task

Run a task with this new Task Defintion and it will use your custom OpenTelemetry comfiguration file from SSM Parameter.