traceid

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL