Skip to content

Datadog - missing message field for errors #153

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

Closed
gorkunov opened this issue Apr 15, 2025 · 7 comments
Closed

Datadog - missing message field for errors #153

gorkunov opened this issue Apr 15, 2025 · 7 comments

Comments

@gorkunov
Copy link

We use logger_json for datadog integration.
When exception is logged using logger_json middlewares - it looks odd in datadog. Instead of readable message (e.g. exception message) - it shows raw json structure with the full payload. It seems that happens because for exceptions message key in payload not in the right place.
We tried a simple fix on a fork and it's working without issues.

prosapient@1307b95

@AndrewDryga
Copy link
Member

@gorkunov does it also work for you if you leave the top-level message empty? Is there any processing rules on your DataDog that might break it? Having message in there is what the spec requires: https://docs.datadoghq.com/standard-attributes/?search=error.message

@gorkunov
Copy link
Author

We didn't try empty message. But previously we used our own lib for logs with this formatter that was specially polished for exceptions: https://github.com/prosapient/statham_logger/blob/main/lib/datadog_formatter.ex.
As you can see we keep message on both levels + use field kind for errors.

@gorkunov
Copy link
Author

You can find more details about fields here: https://docs.datadoghq.com/error_tracking/backend/logs?tab=serilog

@gorkunov
Copy link
Author

Potentially problem with that formatting in datadog is missing field kind.

@Zanius
Copy link

Zanius commented Apr 22, 2025

We are also having this exact issue and have to rollback to a previous version.

@AndrewDryga
Copy link
Member

@gorkunov @Zanius I've added message and kind to error structs (use the master branch), please give it a try and LMK if that doesn't solve the issue for you.

@gorkunov
Copy link
Author

looks good now!

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

3 participants