Skip to content

Don't block requests on log calls #4

Description

@deviantintegral

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions