MCPcopy
hub / github.com/grafana/tempo / New

Function New

pkg/livetraces/livetraces.go:55–66  ·  view source on GitHub ↗
(sizeFunc func(T) uint64, maxIdleTime, maxLiveTime time.Duration, tenantID string)

Source from the content-addressed store, hash-verified

53)
54
55func New[T LiveTraceBatchT](sizeFunc func(T) uint64, maxIdleTime, maxLiveTime time.Duration, tenantID string) *LiveTraces[T] {
56 logger := kitlog.With(log.Logger, "tenant", tenantID)
57
58 return &LiveTraces[T]{
59 hash: fnv.New64(),
60 Traces: make(map[uint64]*LiveTrace[T]),
61 szFunc: sizeFunc,
62 maxIdleTime: maxIdleTime,
63 maxLiveTime: maxLiveTime,
64 maxTraceErrorLogger: log.NewRateLimitedLogger(maxTraceLogLinesPerSecond, level.Error(logger)),
65 }
66}
67
68func (l *LiveTraces[T]) token(traceID []byte) uint64 {
69 l.hash.Reset()

Calls 2

NewRateLimitedLoggerFunction · 0.92
ErrorMethod · 0.65