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

[AWS log forwarder] Generate new objects per each received event record in AWS logs handler #888

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

ge0Aja
Copy link
Contributor

@ge0Aja ge0Aja commented Jan 22, 2025

What does this PR do?

AWS Logs forwarder shares the same AWS log handler for multiple event types i.e. Kinesis and Cloudwatch logs. For Kinesis event types, there's a chance of receiving log records from several log group sources as the order is not guaranteed. Therefore, setting unified attributes such as log_group or log_source per event leads to a random behavior when setting the host, service, source and other metadata parameters. To prevent this random behavior, regenerate a new metadata and attributes object per each received event record in the logs handler.

Motivation

Support ask

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

…WS logs handler

The logs forwarder shares the same AWS log handler for multiple event types i.e. Kinesis and Cloudwatch logs.
For Kinesis event types, there's a chance of receiving log records from  several log group sources as the order is not guaranteed.
Therefore, setting unified attributes such as log_group or log_source per event leads to a random behavior when setting the host, service, source and other metadata parameters.
To prevent this random behavior, regenerate a new metadata and attributes object per each received event record in the logs handler.
@github-actions github-actions bot added the aws label Jan 22, 2025
@ge0Aja ge0Aja changed the title [AWS log forwarder] Generate new objects per each received event in A… [AWS log forwarder] Generate new objects per each received event record in AWS logs handler Jan 22, 2025
@ge0Aja ge0Aja marked this pull request as ready for review January 22, 2025 13:41
@ge0Aja ge0Aja merged commit 82f183b into master Jan 22, 2025
12 checks passed
@ge0Aja ge0Aja deleted the georgi/kinesis-events branch January 22, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants