This example will introduce how to use AWS-OTel-Collector to send application traces and metrics on AWS EKS. This instruction provided the data emitter image that will generate OTLP format of metrics and traces data to AWS CloudWatch and X-Ray consoles. Please follow the steps below to try AWS OTel Collector Beta.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:PutLogEvents",
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogStreams",
"logs:DescribeLogGroups",
"xray:PutTraceSegments",
"xray:PutTelemetryRecords",
"xray:GetSamplingRules",
"xray:GetSamplingTargets",
"xray:GetSamplingStatisticSummaries",
"ssm:GetParameters"
],
"Resource": "*"
}
]
}
EKS-AWSOTel
for the Name and choose Create policy.EKS-AWSOTel
. If necessary, use the search box to find this policy.The easiest way to deploy AWSOTelCollector on Amazon EKS is to run it as a sidecar, defining it in the same task definition as your application.
kubectl create namespace aws-otel-eks
export CLUSTER_NAME=<eks-cluster-name>
export AWS_REGION=<aws-region>
us-west-2
).cat otel-cloudwatch-sidecar.yaml |
sed "s//$AWS_REGION/g" |
sed "s//$CLUSTER_NAME/g" |
kubectl apply -f -
aws-otel-eks
namespace.kubectl get all -n aws-otel-eks
kubectl -n aws-otel-eks describe deployment aws-otel-eks-sidecar
The example template provided runs the AWS-OTel-Collector as sidecar to send application metrics and traces on Amazon EKS. We run two applications: the customer’s application (aws-otel-emitter
) and the AWSOTelCollector aws-otel-collector
. Running the AWSOTelCollector in the same application as the main application allows the AWSOTelCollector to collect the metric/trace data for the customer’s application. We also call running the AWSOTelCollector in this way a "Sidecar".
View Your Metrics
You should now be able to view your metrics in your CloudWatch console. In the navigation bar, click on Metrics. The collected AWSOTelCollector metrics can be found in the AWSObservability/CloudWatchOTService namespace. Ensure that your region is set to the region set for your cluster.