netstats

package
v0.0.0-...-cafc5b9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExporterKey is an attribute name that identifies an
	// exporter component that produces internal metrics, logs,
	// and traces.
	ExporterKey = "exporter"

	// ReceiverKey is an attribute name that identifies an
	// receiver component that produces internal metrics, logs,
	// and traces.
	ReceiverKey = "receiver"

	// SentBytes is used to track bytes sent by exporters and receivers.
	SentBytes = "sent"

	// SentWireBytes is used to track bytes sent on the wire
	// (includes compression) by exporters and receivers.
	SentWireBytes = "sent_wire"

	// RecvBytes is used to track bytes received by exporters and receivers.
	RecvBytes = "recv"

	// RecvWireBytes is used to track bytes received on the wire
	// (includes compression) by exporters and receivers.
	RecvWireBytes = "recv_wire"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkReporter

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

NetworkReporter is a helper to add network-level observability to an exporter or receiver.

func NewExporterNetworkReporter

func NewExporterNetworkReporter(settings exporter.CreateSettings) (*NetworkReporter, error)

NewExporterNetworkReporter creates a new NetworkReporter configured for an exporter.

func NewReceiverNetworkReporter

func NewReceiverNetworkReporter(settings receiver.CreateSettings) (*NetworkReporter, error)

NewReceiverNetworkReporter creates a new NetworkReporter configured for an exporter.

func (*NetworkReporter) CountReceive

func (rep *NetworkReporter) CountReceive(ctx context.Context, ss SizesStruct)

CountReceive is used to report a message received by the component. For exporters, SizesStruct indicates the size of a response. For receivers, SizesStruct indicates the size of a request.

func (*NetworkReporter) CountSend

func (rep *NetworkReporter) CountSend(ctx context.Context, ss SizesStruct)

CountSend is used to report a message sent by the component. For exporters, SizesStruct indicates the size of a request. For receivers, SizesStruct indicates the size of a response.

func (*NetworkReporter) HandleConn

func (rep *NetworkReporter) HandleConn(_ context.Context, _ stats.ConnStats)

HandleConn implements grpc/stats.Handler

func (*NetworkReporter) HandleRPC

func (rep *NetworkReporter) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements grpc/stats.Handler

func (*NetworkReporter) TagConn

TagConn implements grpc/stats.Handler

func (*NetworkReporter) TagRPC

TagRPC implements grpc/stats.Handler

type SizesStruct

type SizesStruct struct {
	Method     string
	Length     int64
	WireLength int64
}

SizesStruct is used to pass uncompressed on-wire message lengths to the CountSend() and CountReceive() methods.

Jump to

Keyboard shortcuts

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