Adds option to delete extracted tag attributes #78
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.
What does this PR do?
Currently this plugin duplicates docker and kubernetes attributes into tags. While useful, this means that the logs uploaded to datadog are now larger than they otherwise would be, leading to increased bytes ingested and therefore increased costs. This PR aims to provide a configuration option to delete kubernetes and docker attributes from the log after the relevant information has been extracted into tags.
This should address the issue #42 that has been open for 5 years at this point.
Motivation
Removing this duplicative data should reduce load and costs for people using the plugin. In a test from logs on my applications I was seeing a roughly 30% reduction in overall bytes ingested.
Additional Notes
This change intentionally removes all docker and kubernetes attributes from the logs after the relevant tags are extracted, not limited to just the ones that are specifically added as tags as part of the plugin. Many of the attributes are already included elsewhere as tags, and IMO the improvement from cleaning them all up is worth the trade off of potentially needing to map a couple custom kubernetes / docker attributes to a different spot in the record if someone does not want them removed.