spandex-project / spandex

A platform agnostic tracing library
MIT License
335 stars 53 forks source link

BUG: Spandex should encode trace_id/span_ids as strings in Logger metadata #126

Closed aselder closed 3 years ago

aselder commented 3 years ago

If you look at DataDog documentation for other languages (e.g. Ruby https://docs.datadoghq.com/tracing/connect_logs_and_traces/ruby/), they recommend transmitting the trace_id and span_id as strings in JSON log messages.

DataDog's JSON ingestion is treating those fields at JS Numbers, which are float64s. These do not have enough precision to store all the digits of trace and span ids. The result is logs that don't correlate to APM traces.

See attached pictures.

Screen Shot 2020-11-30 at 9 54 25 AM Screen Shot 2020-11-30 at 9 54 17 AM

I'll have a PR up in the next couple days.