Skip to content
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

[exporter/sumologic] Make the exporter to not mutate logs data #13923

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Sep 7, 2022

The exporter unnecessary mutates log data just to temporarily copy resource attributes into log attributes. This change removes that redundant step which make the exporter not mutating anymore.

The exporter unnecessary mutates log data just to temporarily copy resource attributes into log attributes. This change removes that redundant step which make the exporter not mutating anymore.
@dmitryax dmitryax added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 7, 2022
@dmitryax dmitryax requested a review from a team as a code owner September 7, 2022 00:54
})
return true
})
}
returnValue.Sort()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to sort?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done in a separate PR, owners should look into this.

Copy link
Member Author

@dmitryax dmitryax Sep 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sort seems redundant. didn't want to do unrelated refactoring in this PR

func (f *filter) filterIn(attributes pcommon.Map) fields {
// mergeAndFilterIn merges provided attribute maps and returns fields which match at least one of the filter regexes.
// Later attribute maps take precedence over former ones.
func (f *filter) mergeAndFilterIn(attrMaps ...pcommon.Map) fields {
returnValue := pcommon.NewMap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnsureCap?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this can be done in a separate PR.

@dmitryax
Copy link
Member Author

dmitryax commented Sep 7, 2022

@sumo-drosiek PTAL

Copy link
Member

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bogdandrutu bogdandrutu merged commit 90824f9 into open-telemetry:main Sep 7, 2022
@dmitryax dmitryax deleted the mutating-sumologic branch September 8, 2022 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/sumologic Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants