Trace and Span ID Formats

If you write code that interacts directly with Datadog tracing spans and traces, here’s what you need to know about how span IDs and trace IDs are generated and accepted by Datadog tracing libraries.

Generally, the libraries generate IDs that are 64-bit unsigned integers. Specifics and exceptions noted below:

LanguageGenerated IDsValid Accepted 64-bit int IDs
JavaScriptUnsigned [0, $2^63$]Signed or unsigned
JavaUnsigned [1, $2^63-1$]Unsigned
GoUnsigned [0, $2^63-1$]Signed or unsigned
PythonUnsigned [0, $2^63$]Unsigned
RubyUnsigned [0, $2^63$]Unsigned
.NETUnsigned [0, $2^63$]Unsigned
PHP[0, $2^63$]Signed
C++Unsigned [0, $2^63-1$]Unsigned