[receiver/awscloudwatch] Use LogGroupIdentifier for cross-account log groups#47746
Open
Vanshul97 wants to merge 1 commit intoopen-telemetry:mainfrom
Open
[receiver/awscloudwatch] Use LogGroupIdentifier for cross-account log groups#47746Vanshul97 wants to merge 1 commit intoopen-telemetry:mainfrom
Vanshul97 wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
… groups When log groups are discovered via AWS OAM cross-account autodiscovery, use LogGroupIdentifier (ARN) instead of LogGroupName in FilterLogEvents calls. AWS requires the full ARN to read logs from linked accounts; using just the name causes ResourceNotFoundException because it only searches the monitoring account's own log groups. The fix stores the log group ARN from DescribeLogGroups and uses LogGroupIdentifier when the ARN is available, falling back to LogGroupName for single-account scenarios. Fixes open-telemetry#46159
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix cross-account log group discovery via AWS OAM by using
LogGroupIdentifier(ARN) instead ofLogGroupNameinFilterLogEventscalls.Fixes #46159
Problem
When using the AWS CloudWatch receiver with
include_linked_accounts: trueandaccount_identifiersfor cross-account log collection via AWS OAM:DescribeLogGroupscorrectly discovers log groups from linked accountsFilterLogEventsusesLogGroupName(just the name), which only searches the monitoring account's own log groupsLogGroupIdentifierto read logs from linked accountsResourceNotFoundExceptionfor every cross-account log groupFix
groupIdentifierfield tostreamNamesandstreamPrefixstructs to store the log group ARNdiscoverGroups()to capturelg.Arnfrom theDescribeLogGroupsresponserequest()methods to useLogGroupIdentifierwhen an ARN is available, falling back toLogGroupNamefor single-account scenarios (backward compatible)Test Plan
LogGroupNamesince ARN won't be set for non-cross-account groups