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

Don't block requests on log calls #4

Open
deviantintegral opened this issue Feb 26, 2020 · 1 comment
Open

Don't block requests on log calls #4

deviantintegral opened this issue Feb 26, 2020 · 1 comment

Comments

@deviantintegral
Copy link

https://github.com/nohponex/monolog-datadog-handler/blob/master/src/DataDogHandler.php#L79 calls event(), which is documented as a blocking call:

https://github.com/DataDog/php-datadogstatsd/blob/master/src/DogStatsd.php#L383-L393

While there's code in event() to send over UDP, since we set an API key it's back to TCP: https://github.com/DataDog/php-datadogstatsd/blob/master/src/DogStatsd.php#L88-L90

A few options I see:

  • Document that this handler should be wrapped in another handler that batches events and sends them on shutdown / destruct.
  • Use BatchedDogStatsd instead of DogStatsd.
  • Use the DogStatsd class, but see if we can send over UDP?
@deviantintegral
Copy link
Author

I missed that this library creates events and not logs in DataDog. While the above would be a good enhancement, I'll be using a different handler instead and won't be working on this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant