Documentation ¶
Overview ¶
nolint:errcheck
nolint:errcheck
Index ¶
- func MetricViews() []*view.View
- type GroupByTraceProcessor
- func (sp *GroupByTraceProcessor) Capabilities() consumer.Capabilities
- func (sp *GroupByTraceProcessor) ConsumeTraces(_ context.Context, td ptrace.Traces) error
- func (sp *GroupByTraceProcessor) Shutdown(_ context.Context) error
- func (sp *GroupByTraceProcessor) Start(context.Context, component.Host) error
- type MemoryStorage
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetricViews ¶
MetricViews return the metrics views according to given telemetry level.
Types ¶
type GroupByTraceProcessor ¶
type GroupByTraceProcessor struct {
// contains filtered or unexported fields
}
GroupByTraceProcessor is a processor that keeps traces in memory for a given duration, with the expectation that the trace will be complete once this duration expires. After the duration, the trace is sent to the next consumer. This processor uses a buffered event machine, which converts operations into events for non-blocking processing, but keeping all operations serialized per worker scope. This ensures that we don't need locks but that the state is consistent across go routines. Initially, all incoming batches are split into different traces and distributed among workers by a hash of traceID in eventMachine.consume method. Afterwards, the trace is registered with a go routine, which will be called after the given duration and dispatched to the event machine for further processing. The typical data flow looks like this: ConsumeTraces -> eventMachine.consume(trace) -> event(traceReceived) -> onTraceReceived -> AfterFunc(duration, event(traceExpired)) -> onTraceExpired async markAsReleased -> event(traceReleased) -> onTraceReleased -> nextConsumer Each worker in the eventMachine also uses a ring buffer to hold the in-flight trace IDs, so that we don't hold more than the given maximum number of traces in memory/storage. Items that are evicted from the buffer are discarded without warning.
func NewGroupByTraceProcessor ¶
func NewGroupByTraceProcessor(logger *zap.Logger, st Storage, nextConsumer consumer.Traces, config common.Config) *GroupByTraceProcessor
newGroupByTraceProcessor returns a new processor.
func (*GroupByTraceProcessor) Capabilities ¶
func (sp *GroupByTraceProcessor) Capabilities() consumer.Capabilities
func (*GroupByTraceProcessor) ConsumeTraces ¶
type MemoryStorage ¶
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage