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 UnmarshalJSON method for TraceID #3682

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RitaGlushkova
Copy link

I had to manually pass TraceID from my Kafka Producer to Consumer for one of my projects and realised that the UnmarshalJSON method for TraceID wasn't there.

So I had to manually convert my TraceID into a string before sending it to Kafka.
So, adding this method to the source would be helpful to avoid this extra manual work.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 6, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: RitaGlushkova / name: Margarita Glushkova (bbeec46)

@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.7%. Comparing base (0446207) to head (a18edd6).
Report is 1333 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #3682     +/-   ##
=======================================
- Coverage   79.7%   79.7%   -0.1%     
=======================================
  Files        171     171             
  Lines      12673   12684     +11     
=======================================
+ Hits       10105   10112      +7     
- Misses      2355    2359      +4     
  Partials     213     213             
Files with missing lines Coverage Δ
trace/trace.go 98.3% <100.0%> (+0.1%) ⬆️

... and 1 file with indirect coverage changes

@dmathieu
Copy link
Member

dmathieu commented Feb 6, 2023

See related discussion: #1819

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 10, 2025
@pellared
Copy link
Member

Given SpanID and TraceID are simple value objects and they already contain MarshalJSON, I think it makes sense to provide UnmarshalJSON as well.

@open-telemetry/go-maintainers WDYT?

@pellared pellared removed the Stale label Feb 10, 2025
@dashpole
Copy link
Contributor

No concerns from me

@dmathieu
Copy link
Member

No concerns from me, but there were valid concerns raised in the issue mentioned above.

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.

4 participants