receiverhelper

package
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 64

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObsReport

type ObsReport struct {
	// contains filtered or unexported fields
}

ObsReport is a helper to add observability to a receiver.

func NewObsReport

func NewObsReport(cfg ObsReportSettings) (*ObsReport, error)

NewObsReport creates a new ObsReport.

func (*ObsReport) EndLogsOp

func (rec *ObsReport) EndLogsOp(
	receiverCtx context.Context,
	format string,
	numReceivedLogRecords int,
	err error,
)

EndLogsOp completes the receive operation that was started with StartLogsOp.

func (*ObsReport) EndMetricsOp

func (rec *ObsReport) EndMetricsOp(
	receiverCtx context.Context,
	format string,
	numReceivedPoints int,
	err error,
)

EndMetricsOp completes the receive operation that was started with StartMetricsOp.

func (*ObsReport) EndTracesOp

func (rec *ObsReport) EndTracesOp(
	receiverCtx context.Context,
	format string,
	numReceivedSpans int,
	err error,
)

EndTracesOp completes the receive operation that was started with StartTracesOp.

func (*ObsReport) StartLogsOp

func (rec *ObsReport) StartLogsOp(operationCtx context.Context) context.Context

StartLogsOp is called when a request is received from a client. The returned context should be used in other calls to the obsreport functions dealing with the same receive operation.

func (*ObsReport) StartMetricsOp

func (rec *ObsReport) StartMetricsOp(operationCtx context.Context) context.Context

StartMetricsOp is called when a request is received from a client. The returned context should be used in other calls to the obsreport functions dealing with the same receive operation.

func (*ObsReport) StartTracesOp

func (rec *ObsReport) StartTracesOp(operationCtx context.Context) context.Context

StartTracesOp is called when a request is received from a client. The returned context should be used in other calls to the obsreport functions dealing with the same receive operation.

type ObsReportSettings

type ObsReportSettings struct {
	ReceiverID component.ID
	Transport  string
	// LongLivedCtx when true indicates that the context passed in the call
	// outlives the individual receive operation.
	// Typically the long lived context is associated to a connection,
	// eg.: a gRPC stream, for which many batches of data are received in individual
	// operations without a corresponding new context per operation.
	LongLivedCtx           bool
	ReceiverCreateSettings receiver.CreateSettings
}

ObsReportSettings are settings for creating an ObsReport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL