-
Notifications
You must be signed in to change notification settings - Fork 395
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
Cast span_id and trace_id as string when adding to the record. #1547
Conversation
@arthurio This fix makes good sense and we can certainly use strings for the record attributes. Do you mind sharing an example log entry where this rounding happened? I'm wondering if its a case of an int being truncated rather than rounded. |
@majorgreys Thanks for getting back to me, this is the screenshot I took when reporting the bug: FYI we use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @arthurio! It won't let me merge in master so let us know once it's back up to date and we can get it in 😄
It'd be great to have a test so we don't break it in the future. |
If you are using a json logger the record value will be interpreted as a number which will result in values being rounded in the log pipeline.
Co-authored-by: Tahir H. Butt <tahir@tahirbutt.com>
2f454a3
to
81e1b5a
Compare
2fe0521
to
f135166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test and quick response @arthurio!! 😄
@Kyle-Verhoog No problem, thanks for your help. And are those assertions enough testing? |
Yeah I think it'd be overkill to do anything further. Future people can reference this PR for the justification. |
Awh :/ looks like Python 2 doesn't like the filter approach: https://app.circleci.com/pipelines/github/DataDog/dd-trace-py/2409/workflows/b68ce846-7572-42a1-8b2c-126a6f2745cb/jobs/322063 |
f135166
to
b6389e7
Compare
@Kyle-Verhoog Ok, I switched to a filter class to accommodate for both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
…record. (#1547) If you are using a json logger the record value will be interpreted as a number which will result in values being rounded in the log pipeline. * Cast span_id and trace_id as string when adding to the record. * Test that span_id and trace_id are strings in the log record.
If you are using a json logger the record value will be interpreted as a number which will result in values being rounded in the log pipeline.