aws-otel-collector icon indicating copy to clipboard operation
aws-otel-collector copied to clipboard

Debugging OTEL agent on EC2 - logging exporter

Open georges-git opened this issue 3 years ago • 11 comments

Hello @mxiamxia - What parameters i need to add in my OTEL config.yaml running on EC2 to spit out more detailed logs information to debug send failures. currently i have not set any logging info.

Currently i have in the exporters: exporters: awsxray: awsemf:

Shall i add logging, so it shall be like the below: exporters: awsxray: awsemf: logging: loglevel: debug

  1. Is the above change correct?

  2. Do i need to also add logging exporter as shown below ? service: pipelines: traces: receivers: [otlp,awsxray] processors: [batch/traces] exporters: [awsxray, logging] metrics: receivers: [otlp] processors: [batch/metrics] exporters: [awsemf, logging]

  3. After my debugging is done, shall i remove this logging exporter from both the places? What is the penalty if i leave it?

georges-git avatar Jun 17 '21 22:06 georges-git

Hello , Can anyone respond to my above query?

georges-git avatar Jun 18 '21 18:06 georges-git

Hi George, to your questions,

  1. Yes
  2. Yes
  3. You should remove it for your production env, it prints lots of debugging logs could affect your service performance

mxiamxia avatar Jun 18 '21 21:06 mxiamxia

From the docs enable debugging log add a key value pair into /opt/aws/aws-otel-collector/etc/extracfg.txt and restart collector

echo "loggingLevel=DEBUG" | sudo tee -a /opt/aws/aws-otel-collector/etc/extracfg.txt sudo /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -a stop sudo /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -a start

sethAmazon avatar Jun 28 '21 13:06 sethAmazon

Attaching the logs with DEBUG level - aws-otel-collector.zip

georges-git avatar Jun 28 '21 16:06 georges-git

Hello

In my case, I want to debug the Otel collector using the implementation of Otel inside of the Cloudwacth agent running in one ec2 windows server 2016 instance.

I'm following these steps

& "C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1" -a fetch-config -o default -s  

Add-Content C:\ProgramData\Amazon\AmazonCloudWatchAgent\CWAgentOtelCollector\Configs\extracfg.txt "loggingLevel=DEBUG"

& "C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1" -a stop

& "C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1" -a start

but can't see any log in this folder:

C:\ProgramData\Amazon\AmazonCloudWatchAgent\CWAgentOtelCollector\Logs

The status of otel collector is ok

& "C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1" -a status

"cwoc_status": "running", "cwoc_starttime": "2021-09-08T15:21:04", "cwoc_configstatus": "configured", "version": "1.247349.0b251399"

Any idea how to achieve this?

Thanks

javierm2k9 avatar Sep 15 '21 08:09 javierm2k9

Did you see any log file in C:\\ProgramData\\Amazon\\AWSOTelCollector\\Logs\\ directory? Just in case that CW/OTel Composite Agent didn't override the log file path successfully.

mxiamxia avatar Sep 15 '21 17:09 mxiamxia

Hi @mxiamxia

I didn't see any logs and in fact, that path doesn't exist in my ec2 instance. Maybe that path is related to OTEL agent when you are not using Cloudwatch agent for open telemetry collector.

I'm using this approach https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-open-telemetry.html

Thanks

javierm2k9 avatar Sep 17 '21 09:09 javierm2k9

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jan 02 '22 20:01 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Mar 06 '22 20:03 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jun 12 '22 20:06 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 18 '22 20:09 github-actions[bot]

This issue was closed because it has been marked as stale for 30 days with no activity.

github-actions[bot] avatar Oct 23 '22 20:10 github-actions[bot]