Skip to content

Observablility

Observability is a very important tool in production environments because these allow us to listen some events on the infrastructure like errors and resources. AWS allow us to install some services like Open Telemetry that is used to recibe all those events and sent these to AWS cloud watch. For more information follow the next
.

Container insights metrics (with AWS Distro for Open Telemetry ADOT)

As is described
we need to configure k8s to send events about usage metrics of different pods and services. To do that, we need to create a service that sends this information to cloudwatch container insights and then we can use this information on cloudwatch dashboards and create alarms.
This service most to assume an IAM rol that allows it to collect the data, so we have created a bash setup that is used to config this service account (). Then it's very important to create a fargate profile than allows us to create pods on fargate-container-insights namespace (we used to create this profile
on AWS console).
Then, we have to apply to create the services that collects the metrics on then cluster.

Xray with ADOT

Xray is a AWS service that allow us to collect data from our services using instrumentation libraries. In our infrastructure, we need to monitor the traffic between our services to detect errors and deploy fixes in a short period of time. For that reason, we implement the OTel (open telemetry) instrumentation library en every backend project to collect traffic data and sent it to the OTel collector installed in our cluster. Next, we have to compile and send this traces to AWS Xray.
OTel SDK for javascript have several tools to collect data but we use only http-collector described in this npm library @opentelemetry/instrumentation-http. For example, our moapi service implement this technology in the next instrumentation file . It was very important to specify the name of the service because every traces will have to identify the source of the info and the url of the collector.
Also, we have to configure our collector to process all the traces send from the services. To do that, we modify the configuration adding the next information
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
...
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
...
exporters:
awsxray:
region: us-east-1
...
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch/traces]
exporters: [awsxray]
Also, we have to configure the IAM roll that is used by the collector to send traces to xray.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.