Skip to main content

Set up Traces Collection for AWS Environments

To collect traces in non-Kubernetes AWS environments like EC2 or ECS (including Fargate), you can install the Sumo Logic Distribution for OpenTelemetry. Collecting telemetry data and sending it to Sumo Logic, the official partner and contributor to the project, has never been easier.

Prerequisites

Account TypeAccount Level
CreditsEnterprise Operations and Enterprise Suite
Essentials get up to 5 GB a day

Telemetry data collection

AWS provides a few alternative scenarios for setting up the Collector. Documentation related to the configuration and installation of the Sumo Logic Distribution for OpenTelemetry Collector for specific AWS Services can be found below.

Sumo Logic Distribution for OpenTelemetry Collector configuration scenarios

Amazon Elastic Container Service (ECS)

In the case of ECS, there are two possible deployment configurations. Sumo Logic Distro can be installed on the cluster of EC2 instances (Scenario 1 below) or ran on AWS Fargate (Scenario 2 below).

The installation and configuration are just a few steps, described below.

Prerequisites

You'll need an ECS Cluster where the Sumo Logic Distribution for OpenTelemetry Collector will be deployed. The guide can be found here.

Scenario 1: Sumo Logic Distribution for OpenTelemetry Collector installation on ECS EC2

  1. Download the CloudFormation template file which will be used later to install the Collector:

    curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/examples/aws/ecs-ec2-deployment.yaml
  2. Download the Sumo Logic Distribution for OpenTelemetry Collector configuration file:

    curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/examples/aws/config.yaml
  3. Set up the following environment variables that are needed to perform the Collector deployment.

    • CLUSTER_NAME. Your ECS Cluster name previously set up.
    • AWS_REGION. Your ECS Cluster deployment region.
    • TEMPLATE_PATH. Path to the template file from the first step.
    • CONFIG_FILE_PATH. Path to the config file from the second step.
    • SUMO_OTLP_HTTP_ENDPOINT_URL. Mandatory OTLP/HTTP source from prerequisites section.
  4. It is necessary to provide the configuration to the Collector. This can be done by creating the parameter in the AWS Parameter Store by running the following command:

    aws ssm put-parameter --name "sumologic-otel-col-config" --type "String" --data-type "text" --value "$(cat ${CONFIG_FILE_PATH} | awk -v url=$SUMO_OTLP_HTTP_ENDPOINT_URL '{gsub(/SUMO_OTLP_HTTP_ENDPOINT_URL/,url)}1')"
  5. Execute the command below to create an AWS CloudFormation stack that deploys the Collector on your cluster:

    aws cloudformation create-stack --stack-name sumologic-aws-otel-col-ecs-ec2 --template-body file://${TEMPLATE_PATH} --parameters ParameterKey=ClusterName,ParameterValue=${CLUSTER_NAME} --capabilities=CAPABILITY_NAMED_IAM --region=${AWS_REGION}
  6. To check if everything was deployed go to the CloudFormation Stacks console and check if the sumologic-aws-otel-col-ecs-ec2 stack status is CREATE_COMPLETE.
    stack status.png

  7. The next step is to check if your deployment is properly running. Go to the ECS Console, select the proper region, and select the cluster you used to deploy the Collector. Navigate to the Tasks tab and check if the task is running.
    task status running.png

  8. Finally, select the task and click on the Networking tab. You'll find the information on where to send telemetry data.
    If you plan to send data to the ECS Collector service from a container running in the bridge network mode using the same host, you can use Docker Gateway IP - 172.17.0.1 on EC2 Linux in the application environment variables. For example:

OTEL_EXPORTER_OTLP_ENDPOINT=http://172.17.0.1:4318
OTEL_TRACES_EXPORTER=otlp

However, with this configuration, the collector service task must be running in each of the used EC2 instances.

Scenario 2: Sumo Logic Distribution for OpenTelemetry Collector installation on ECS Fargate

  1. Download the CloudFormation template file which will be used later to install the Collector:

    curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/examples/aws/ecs-fargate-deployment.yaml
  2. Download the configuration file.

    curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/examples/aws/config.yaml
  3. Set up the following environment variables that are needed to perform the Collector deployment:

    • CLUSTER_NAME. Your ECS Cluster name setup from prerequisite
    • AWS_REGION. Your ECS Cluster deployment region
    • TEMPLATE_PATH. Path to the template file from the first step
    • CONFIG_FILE_PATH. Path to the config file from the second step
    • SUMO_OTLP_HTTP_ENDPOINT_URL. Mandatory OTLP/HTTP source
    • SECURITY_GROUPS. It is mandatory for AWS Fargate deployment to provide a Security Group ID. They can be found in the AWS Console. Find the one configured for the cluster. In the case of multiple Security Groups use comma as separator, such as sg-xyz,sg-xyz.
    note

    The Sumo Logic Distribution for OpenTelemetry Collector can receive data from various receivers - these ports should be configured in the Security Group:

    • OTLP - ports: 4317/tcp, 4318/tcp
    • SUBNETS - same as Security Groups, Subnets have to be configured for AWS Fargate. To find Subnets used on the cluster, use the VPC ID from Security Group and search for it on the list here. In the case of multiple Subnets use a comma as a separator, such as, subnet-xyz,subnet-xyz.
  4. It is necessary to provide the configuration to the Collector. This can be done by creating the parameter in the AWS Parameter Store by running the following command:

    aws ssm put-parameter --name "sumologic-otel-col-config" --type "String" --data-type "text" --value "$(cat ${CONFIG_FILE_PATH} | awk -v url=$SUMO_OTLP_HTTP_ENDPOINT_URL '{gsub(/SUMO_OTLP_HTTP_ENDPOINT_URL/,url)}1')"
  5. Execute the command below to create an AWS CloudFormation stack that deploys the Sumo Logic Distro on your cluster:

    aws cloudformation create-stack --stack-name sumologic-aws-otel-col-ecs-fargate --template-body file://${TEMPLATE_PATH} --parameters ParameterKey=ClusterName,ParameterValue=${CLUSTER_NAME} ParameterKey=SecurityGroups,ParameterValue=\"${SECURITY_GROUPS}\" ParameterKey=Subnets,ParameterValue=\"${SUBNETS}\" --capabilities=CAPABILITY_NAMED_IAM --region=${AWS_REGION}
  6. To check if everything was deployed, go to the CloudFormation Stacks console and check if the sumologic-aws-otel-col-ecs-fargate stack status is CREATE_COMPLETE.
    ecs ec2 stack status.png

  7. The next step is to check if your deployment is properly running. Go to the ECS Console, select the proper region, and select the cluster you used to deploy the AWS OpenTelemetry Collector. Navigate to the Tasks tab and check if the task is running.
    task status es2 ecs.png

  8. Finally, click on the task and expand the Containers list. In the Network > Private IP or Public IP sections, you will find the information on where to send telemetry data.
    network ips.png

Amazon Elastic Computing (EC2)

  1. Download the CloudFormation template file which will be used later to install the Collector on your EC2 instance.

    curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/examples/aws/ec2-deployment.yaml
  2. Set up the following environment variables that are needed to perform a deployment.

    • AWS_REGION. Your ECS Cluster deployment region
    • TEMPLATE_PATH. Path to the template file from the first step
    • SUMO_OTLP_HTTP_ENDPOINT_URL. Mandatory OTLP/HTTP source.
    • SSH_KEY_NAME. Amazon EC2 key pair needed to ssh to the EC2 instance
    • AMI_ID. an Amazon image ID, depends on the region. To obtain it go to EC2 Launch Instances and get AMI ID for Amazon Linux 2 AMI image, such as, ami-0a6dc7529cd559185. Note that the AMI ID depends on the region.
  3. Execute the command below to create the AWS CloudFormation stack that will create an EC2 instance and install collector on it:

    aws cloudformation create-stack --stack-name sumologic-otel-ec2 --template-body file://${TEMPLATE_PATH} --parameters ParameterKey=SumoOtlpHttpEndpointURL,ParameterValue=${SUMO_OTLP_HTTP_ENDPOINT_URL} ParameterKey=SSHKeyName,ParameterValue=${SSH_KEY_NAME} ParameterKey=InstanceAMI,ParameterValue=${AMI_ID} --capabilities=CAPABILITY_NAMED_IAM --region=${AWS_REGION}
  4. To check if everything was deployed, go to CloudFormation Stacks console and check if sumologic-otel-ec2 stack status is CREATE_COMPLETE. Deploying and configuring an EC2 instance can take even a few minutes.
    stack check.png

  5. Go to EC2 Instances, select the proper region and check if the EC2 instance is running. Use public or private IP addresses as exporters endpoints.
    instance ips.png

Sumo Logic Distribution for OpenTelemetry installation on EKS

In the case of the Amazon EKS service, we highly recommend using our native Sumo Logic Kubernetes Collection solution, as it provides unique and comprehensive metadata tagging for all data streams.

Sumo Logic Distribution for OpenTelemetry Collector default configuration

For each deployment scenario, the Sumo Logic Distribution for OpenTelemetry uses the same default configuration. In this configuration, the Collector is receiving telemetry data for:

  • OTLP gRPC protocol - port 4317
  • OTLP HTTP protocol - port 4318

By default telemetry data is exported by OTLP HTTP directly to a Sumo Logic OTLP/HTTP Source. You can adjust the configuration below to your needs.

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch/traces:
timeout: 5s
send_batch_size: 256
batch/metrics:
timeout: 60s
exporters:
otlphttp:
endpoint: SUMO_OTLP_HTTP_ENDPOINT_URL
service:
extensions: [health_check]
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [otlphttp]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [otlphttp]
Status
Legal
Privacy Statement
Terms of Use

Copyright © 2024 by Sumo Logic, Inc.