Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.
https://nebo15.github.io/logger_json/
MIT License
242 stars 94 forks source link

fix(elastic): encode duration_μs inserted by LoggerJSON.Plug as event.duration #129

Closed bvobart closed 2 months ago

bvobart commented 3 months ago

Hi. While trying out LoggerJSON.Plug I noticed that it adds duration_μs as metadata, but this is not a valid field in the Elastic Common Schema, so here's a quick fix to remap that to event.duration as is also recommended on the Elastic forum

Note that similar changes might be necessary for the Google Cloud and Datadog formatters too.

coveralls commented 3 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling c9d41dbf33fa84478b8daefc82e6af768eb84dd3 on bvobart:master into 2e72e28185c17e842f4653daa0d556ea92479810 on Nebo15:master.

bvobart commented 3 months ago

@AndrewDryga This basically fixes the Elastic equivalent of https://github.com/Nebo15/logger_json/issues/124 Would you mind reviewing? 😊

AndrewDryga commented 2 months ago

Please see https://github.com/Nebo15/logger_json/issues/124#issuecomment-2310974994