Open yumemi-mabe opened 2 weeks ago
I think this issue is from CloudWatch Agent, the log line is here
func (emf *emfExporter) pushMetricsData(_ context.Context, md pmetric.Metrics) error {
rms := md.ResourceMetrics()
labels := map[string]string{}
for i := 0; i < rms.Len(); i++ {
rm := rms.At(i)
am := rm.Resource().Attributes()
if am.Len() > 0 {
am.Range(func(k string, v pcommon.Value) bool {
labels[k] = v.Str()
return true
})
}
}
emf.config.logger.Info("Start processing resource metrics", zap.Any("labels", labels))
emf.processResourceLabels(labels)
I am not sure if this need to be info level logging.
TBH I am not sure which repo is the right place to create issue (cwagent, otel contrib), you can check with @bjrara
I agree with this comment, the log should not be created at info level.
In v1.32.5, we introduced runtime metrics (which will be released on 11/20) that emit JVM metrics every minute. I believe the so called "duplicated" logs come from different batches of metrics, one from runtime, one from RED (latency, error, fault) metrics generated from incoming/outgoing calls.
It shouldn't cause any impacting problems but I do agree such logs are misleading and noisy. We should downgrade the log level to avoid confusion.
Actually, the log level has been downgraded in OTEL collector: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/29337.
Seems to be a missing patch at CloudWatch agent side.
Describe the bug
Using
public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v1.32.5
, the CloudWatch Agent is sending duplicate log entries with the same content, like this:Note: I masked Sensitive information.
This issue occurs in v1.32.5 but did not occur in v1.32.4.
Steps to reproduce
According to the Application Signals - Deploy using the Sidecar Strategy documentation, I configured my task definition as follows:
containerDefinitions in taskdef.json
``` "containerDefinitions": [ { "name": "my-app", "logConfiguration": { "logDriver": "awslogs", "secretOptions": null, "options": { "awslogs-group": "${AWS_LOGS_GROUP}", "awslogs-region": "${AWS_REGION}", "awslogs-stream-prefix": "my-app", "awslogs-datetime-format": "%Y-%m-%d %H:%M:%S" } }, "entryPoint": [], "portMappings": [ { "hostPort": 8080, "protocol": "tcp", "containerPort": 8080 } ], "environment": [ { "name": "OTEL_RESOURCE_ATTRIBUTES", "value": "aws.log.group.names=${AWS_LOGS_GROUP},aws.hostedin.environment=$HOST_ENV,service.name=my-app" }, { "name": "OTEL_LOGS_EXPORTER", "value": "none" }, { "name": "OTEL_METRICS_EXPORTER", "value": "none" }, { "name": "OTEL_EXPORTER_OTLP_PROTOCOL", "value": "http/protobuf" }, { "name": "OTEL_AWS_APPLICATION_SIGNALS_ENABLED", "value": "true" }, { "name": "JAVA_TOOL_OPTIONS", "value": " -javaagent:/otel-auto-instrumentation/javaagent.jar" }, { "name": "OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT", "value": "http://localhost:4316/v1/metrics" }, { "name": "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", "value": "http://localhost:4316/v1/traces" }, { "name": "OTEL_TRACES_SAMPLER", "value": "xray" }, { "name": "OTEL_PROPAGATORS", "value": "tracecontext,baggage,b3,xray" } ], "mountPoints": [ { "sourceVolume": "opentelemetry-auto-instrumentation", "containerPath": "/otel-auto-instrumentation", "readOnly": false } ], "image": "What did you expect to see?
The CloudWatch Agent doesn't send duplicate log entries.
What did you see instead?
CloudWatch Agent is sending duplicate log entries with the same content.
Additional context