Skip to content

Skip adding dimensions with empty dimension value into default dimension #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 6, 2022

Conversation

paggynie
Copy link
Contributor

@paggynie paggynie commented Oct 5, 2022

Issue #, if available:
#125

Description of changes:
Customer with ECS FireLens now has problem to flush metrics logger when using default dimension because we return "" for log group name but we throw InvalidDimensionException when setting the empty dimension. Example stack trace

software.amazon.cloudwatchlogs.emf.exception.InvalidDimensionException: Dimension value cannot be empty
at software.amazon.cloudwatchlogs.emf.util.Validator.validateDimensionSet(Validator.java:48)
at software.amazon.cloudwatchlogs.emf.model.DimensionSet.addDimension(DimensionSet.java:167)
at software.amazon.cloudwatchlogs.emf.logger.MetricsLogger.configureContextForEnvironment(MetricsLogger.java:268)
at software.amazon.cloudwatchlogs.emf.logger.MetricsLogger.flush(MetricsLogger.java:91)
at com.amazonaws.toledo.telemetry.common.util.MetricsPublisher.flush(MetricsPublisher.java:39)
at com.amazonaws.toledo.telemetry.streamprocessor.StreamProcessor.processRecords(StreamProcessor.java:147)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.ProcessTask.callProcessRecords(ProcessTask.java:221)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.ProcessTask.call(ProcessTask.java:176)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.MetricsCollectingTaskDecorator.call(MetricsCollectingTaskDecorator.java:49)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.MetricsCollectingTaskDecorator.call(MetricsCollectingTaskDecorator.java:24)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

This change is to skip adding dimension if dimension value is null or empty

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@paggynie paggynie self-assigned this Oct 5, 2022
@paggynie paggynie requested a review from markkuhn October 5, 2022 02:26
@markkuhn markkuhn requested a review from Himtanaya October 5, 2022 16:17
@markkuhn markkuhn added the bug Something isn't working label Oct 5, 2022
@markkuhn
Copy link
Contributor

markkuhn commented Oct 5, 2022

@paggynie Build is failing due to spotless. Please run ./gradlew :spotlessApply to fix it.

@markkuhn markkuhn linked an issue Oct 5, 2022 that may be closed by this pull request
@markkuhn markkuhn self-requested a review October 6, 2022 18:54
@markkuhn
Copy link
Contributor

markkuhn commented Oct 6, 2022

🚀

@markkuhn markkuhn merged commit e7de627 into master Oct 6, 2022
@markkuhn markkuhn deleted the paggy-fix-empty-loggroup branch October 6, 2022 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InvalidDimensionException when running on ECS Fargate with fluent-bit
3 participants