Skip to content

Conversation

@ge0Aja
Copy link
Contributor

@ge0Aja ge0Aja commented Mar 25, 2024

What does this PR do?

  • refactor forwarder calls in lambda function
  • extract logs related classes into separate files
  • remove unwanted code

Motivation

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)

@github-actions github-actions bot added the aws label Mar 25, 2024
@ge0Aja ge0Aja force-pushed the georgi/refactor_forwarder branch from dcaf298 to 4a3a5ac Compare March 25, 2024 12:11
@ge0Aja ge0Aja changed the title Refactor forwarding and logs classes Refactor forwarding and logs classes in lambda forwarder Mar 25, 2024
@ge0Aja ge0Aja force-pushed the georgi/refactor_forwarder branch from 4a3a5ac to 32218b2 Compare March 25, 2024 12:16
if len(trace_payloads) > 0:
forward_traces(trace_payloads)

forward(logs, metrics, trace_payloads)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: What's the benefit of making this wrapper function? Something about it feels weird to me, partly because all these args are lists and it would be easy to mix up the order 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm actually refactoring this part because I'm working on adding a retry mechanism to be called if we fail to forward events in the case of failures on the intake side.
Therefore, I'm putting everything under a single function to be called from the retrier side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also there's a benefit from encapsulating the inner calls inside the module and expose less details outside.

@ge0Aja ge0Aja marked this pull request as ready for review March 27, 2024 09:47
@ge0Aja ge0Aja requested a review from a team as a code owner March 27, 2024 09:47
@ge0Aja ge0Aja merged commit ed54aa9 into master Mar 27, 2024
@ge0Aja ge0Aja deleted the georgi/refactor_forwarder branch March 27, 2024 09:52
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.

4 participants