aws-observability/aws-otel-helm-charts

Need of CloudWatch Agent section in values.yaml file ??

sunnygoel87 opened this issue · 4 comments

Hi,

As per my understanding, this Helm chart takes care of deploying the following Agent/Collector on k8s cluster.

1.) FluentBit agent - It will get deployed as DaemonSet on k8s cluster and be responsible for gathering and offloading Application, Host, and DataPlane logs into CloudWatch.

2.) OTEL collector - It will also get deployed as DaemonSet on k8s cluster and be responsible for gathering and offloading metrics data into CloudWatch.

So I'm wondering what's the role of CloudWatch agent in this setup. I do see the following section in Values.yaml file and also these fields are being referenced in INPUT section in configmap.yaml file.

cloudwatchAgent:
path: "/var/log/containers/cloudwatch-agent*"
dockerModeParser: "cwagent_firstline"
db: "/var/fluent-bit/state/flb_cwagent.db"
memBufLimit: "5MB"

@ruthvik17 @alolita , Any update on this ??

Hi @sunnygoel87 , The CloudWatch Agent is being used to configure Fluent Bit to be able to send logs to CloudWatch Logs. Please see the configuration here: https://github.com/aws-observability/aws-otel-helm-charts/blob/master/charts/adot-exporter-for-eks-on-ec2/templates/aws-for-fluent-bit/configmap.yaml#L59-L70

@ruthvik17 , FluentBit and CloudWatch are 2 separate agents. Even if you don't leverage the following section in the Fluent-Bit agent config file, FluentBit agent will still be able to offload Application, dataplane and host logs into CloudWatch. This section doesn't play any role in configuring the FluentBit agent.

Also, if you see carefully, it is just using the tail INPUT plugin to read the CloudWatch agent related logs from the file given at the following path - /var/log/containers/cloudwatch-agent*. In the current setup, even CloudWatch agent logs will get offloaded into the application specific LogGroup - /aws/containerinsights/{{ .Values.clusterName }}/application if a customer deployed CloudWatch agent as a standalone utility on EKS cluster to offload and render the Cluster performance data into CloudWatch.

I'll suggest you to test once after removing the CloudWatch agent specific entries from values.yaml and FluentBit agent configmap.yaml file.

[INPUT]
Name tail
Tag application.*
Path /var/log/containers/cloudwatch-agent*
Docker_Mode On
Docker_Mode_Flush 5
Docker_Mode_Parser cwagent_firstline
Parser docker
DB /var/fluent-bit/state/flb_cwagent.db
Mem_Buf_Limit 5MB
Skip_Long_Lines On
Refresh_Interval 10
Read_from_Head ${READ_FROM_HEAD}

Since we have removed the CloudWatch section, so I'm closing this issue now..