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

Add default/fallback behavior for json.dumps #47

Merged
merged 10 commits into from
Jul 1, 2021

Conversation

basepi
Copy link
Contributor

@basepi basepi commented Jun 29, 2021

Fixes #41

@apmmachine
Copy link
Contributor

apmmachine commented Jun 29, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #47 updated

  • Start Time: 2021-07-01T16:37:01.960+0000

  • Duration: 9 min 19 sec

  • Commit: 8cfd4b3

Test stats 🧪

Test Results
Failed 0
Passed 238
Skipped 11
Total 249

Trends 🧪

Image of Build Times

Image of Tests

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

I'm still kinda "eh" about whether we should simply smooth over errors where the user isn't giving us something JSON serializable? Isn't an error better in this case instead of polluting their logs cluster with object reprs?

ecs_logging/_utils.py Outdated Show resolved Hide resolved
@basepi
Copy link
Contributor Author

basepi commented Jun 29, 2021

@sethmlarson Obviously at least one person has run into this, and expects us to not fail but rather deal with the object. Doing it this way allows a user to add the __structlog__() method to give it a good log representation. The __repr__() backup will make it pretty obvious what's going on as well IMO.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@beniwohli beniwohli left a comment

Choose a reason for hiding this comment

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

LGTM!

@basepi
Copy link
Contributor Author

basepi commented Jun 30, 2021

Just waiting on #46 which will turn these tests green.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

functools.partial change looks good to me!

@basepi basepi merged commit bb4647f into elastic:master Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

structlog integration - TypeError when passing object
4 participants