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

fix: properly parse parent id for logs #230

Merged
merged 2 commits into from
Jan 3, 2024
Merged

fix: properly parse parent id for logs #230

merged 2 commits into from
Jan 3, 2024

Conversation

kentquirk
Copy link
Contributor

Which problem is this PR solving?

  • In fix: Proposed fix for JSON ingestion issue #179 we added some code to deal with the fact that OTLP/JSON processing can't differentiate between arrays of bytes that are encoded as hex and those that are encoded as base64. When JS sends us browser-side telemetry, it encodes IDs as hex, but when we receive it it's decoded as base64. This PR also applies that to logs.

Short description of the changes

  • Adjust log's parentID so that it properly parses
  • Add a new test case
  • Move some code to common since it now applies across signals
  • Move some tests to common
  • Clarify some comments

@kentquirk kentquirk requested a review from a team as a code owner January 2, 2024 21:03
Copy link

@fchikwekwe fchikwekwe left a comment

Choose a reason for hiding this comment

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

I think this looks good to me.

return string(encoded)
}

func shouldTrimTraceId(traceID []byte) bool {

Choose a reason for hiding this comment

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

Nice. I didn't even think about this case.

@kentquirk kentquirk merged commit cc059ef into main Jan 3, 2024
5 checks passed
@kentquirk kentquirk deleted the kent.fix_js_logs branch January 3, 2024 00:15
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

Successfully merging this pull request may close these issues.

2 participants