Documentation ¶
Overview ¶
Package snapshot defines contract for collecting snapshots as well as helper structures
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer is a buffer for plog.Logs
func NewLogBuffer ¶
NewLogBuffer creates a logBuffer with the ideal size set
type MetricBuffer ¶
type MetricBuffer struct {
// contains filtered or unexported fields
}
MetricBuffer is a buffer for pmetric.Metrics
func NewMetricBuffer ¶
func NewMetricBuffer(idealSize int) *MetricBuffer
NewMetricBuffer creates a metricBuffer with the ideal size set
func (*MetricBuffer) Add ¶
func (l *MetricBuffer) Add(md pmetric.Metrics)
Add adds the new metric payload and adjust buffer to keep ideal size
func (*MetricBuffer) ConstructPayload ¶
func (l *MetricBuffer) ConstructPayload(searchQuery *string, minimumTimestamp *time.Time) ([]byte, error)
ConstructPayload condenses the buffer and serializes to protobuf
func (*MetricBuffer) Len ¶
func (l *MetricBuffer) Len() int
Len counts the number of data points in all Metric payloads in buffer
type Snapshotter ¶
type Snapshotter interface { // SaveLogs saves off logs in a snapshot SaveLogs(componentID string, ld plog.Logs) // SaveTraces saves off traces in a snapshot SaveTraces(componentID string, td ptrace.Traces) // SaveMetrics saves off metrics in a snapshot SaveMetrics(componentID string, md pmetric.Metrics) }
Snapshotter represents an interface to save logs, metrics, and traces for snapshots
//go:generate mockery --name Snapshotter --filename mock_snapshotter.go --structname MockSnapshotter No go generate for this as it requires internal otel structures that don't import correctly with mockery. Can uncomment above and run then modify by hand.
type TraceBuffer ¶
type TraceBuffer struct {
// contains filtered or unexported fields
}
TraceBuffer is a buffer for ptrace.Traces
func NewTraceBuffer ¶
func NewTraceBuffer(idealSize int) *TraceBuffer
NewTraceBuffer creates a traceBuffer with the ideal size set
func (*TraceBuffer) Add ¶
func (l *TraceBuffer) Add(td ptrace.Traces)
Add adds the new trace payload and adjust buffer to keep ideal size
func (*TraceBuffer) ConstructPayload ¶
func (l *TraceBuffer) ConstructPayload(searchQuery *string, minimumTimestamp *time.Time) ([]byte, error)
ConstructPayload condenses the buffer and serializes to protobuf
func (*TraceBuffer) Len ¶
func (l *TraceBuffer) Len() int
Len counts the number of spans in all Traces payloads in buffer