Documentation
¶
Overview ¶
Package traceid provides lightweight unique ID generation for distributed tracing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateW3CSpanID ¶
func GenerateW3CSpanID() string
GenerateW3CSpanID returns a 16-character hex string (8 random bytes) compatible with the W3C Trace Context specification.
func GenerateW3CTraceID ¶
func GenerateW3CTraceID() string
GenerateW3CTraceID returns a 32-character hex string (16 random bytes) compatible with the W3C Trace Context specification.
func New ¶
func New() string
New generates a unique trace/span ID. It combines a timestamp component with a random component and an atomic counter for uniqueness. Uses math/rand (not crypto/rand) for performance — these IDs are used for log correlation and distributed tracing, not for security purposes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.