Documentation
¶
Overview ¶
Package otelcolclient contains client code for communicating with an OTel Collector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type GRPCWriter ¶
type GRPCWriter struct {
// contains filtered or unexported fields
}
func NewGRPCWriter ¶
NewGRPCWriter dials the provided gRPC address and returns a *GRPCWriter.
func (GRPCWriter) Close ¶
func (w GRPCWriter) Close() error
func (GRPCWriter) WriteLogs ¶
func (w GRPCWriter) WriteLogs(batch []*logspb.ResourceLogs)
func (GRPCWriter) WriteMetrics ¶
func (w GRPCWriter) WriteMetrics(batch []*metricspb.Metric)
func (GRPCWriter) WriteTrace ¶
func (w GRPCWriter) WriteTrace(batch []*tracepb.ResourceSpans)
type SignalBatcher ¶
type SignalBatcher struct {
// contains filtered or unexported fields
}
SignalBatcher batches OpenTelemetry signals.
func NewSignalBatcher ¶
func NewSignalBatcher(size int, interval time.Duration, writer Writer) *SignalBatcher
NewSignalBatcher creates a new OpenTelemetry Metric Batcher.
func (*SignalBatcher) Flush ¶
func (b *SignalBatcher) Flush()
Flush will write a partial batch if there is data and the interval has lapsed. Otherwise it is a NOP. This method should be called frequently to make sure batches do not stick around for long periods of time. As a result it would be a bad idea to call Flush after an operation that might block for an un-specified amount of time.
func (*SignalBatcher) WriteLog ¶
func (b *SignalBatcher) WriteLog(data *logspb.ResourceLogs)
WriteLogs stores data to the log batch. It will not submit the batch to the writer until either the batch has been filled, or the interval has lapsed.
func (*SignalBatcher) WriteMetric ¶
func (b *SignalBatcher) WriteMetric(data *metricspb.Metric)
WriteMetric stores data to the metric batch. It will not submit the batch to the writer until either the batch has been filled, or the interval has lapsed.
func (*SignalBatcher) WriteTrace ¶
func (b *SignalBatcher) WriteTrace(data *tracepb.ResourceSpans)
WriteTrace stores data to the trace batch. It will not submit the batch to the writer until either the batch has been filled, or the interval has lapsed.
type Writer ¶
type Writer interface {
// WriteMetrics submits the batch.
WriteMetrics(batch []*metricspb.Metric)
// WriteTrace submits the batch.
WriteTrace(batch []*tracepb.ResourceSpans)
// WriteLogs submits the batch.
WriteLogs(batch []*logspb.ResourceLogs)
Close() error
}
Writer is used to submit the completed batches of OpenTelemetry signals. The batch may not be full if the interval lapsed instead of filling the batch.