package idgenerator

import "github.com/openzipkin/zipkin-go/idgenerator"

Package idgenerator contains several Span and Trace ID generators which can be used by the Zipkin tracer. Additional third party generators can be plugged in if they adhere to the IDGenerator interface.

Index

Types

type IDGenerator

type IDGenerator interface {
	SpanID(traceID model.TraceID) model.ID // Generates a new Span ID
	TraceID() model.TraceID                // Generates a new Trace ID
}

IDGenerator interface can be used to provide the Zipkin Tracer with custom implementations to generate Span and Trace IDs.

func NewRandom128

func NewRandom128() IDGenerator

NewRandom128 returns an ID Generator which can generate 128 bit trace and 64 bit span id's

func NewRandom64

func NewRandom64() IDGenerator

NewRandom64 returns an ID Generator which can generate 64 bit trace and span id's

func NewRandomTimestamped

func NewRandomTimestamped() IDGenerator

NewRandomTimestamped generates 128 bit time sortable traceid's and 64 bit spanid's.

Source Files

idgenerator.go

Version
v0.4.3 (latest)
Published
Apr 29, 2024
Platform
linux/amd64
Imports
4 packages
Last checked
1 week ago

Tools for package owners.