cloudmonitoring

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cloudmonitoring provides primitives for Cloud Monitoring integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartExporter

func StartExporter(
	ctx context.Context,
	exporterConfig ExporterConfig,
	resource *resource.Resource,
) (func(), error)

StartExporter starts the OpenTelemetry Cloud Monitoring exporter.

Types

type ExporterConfig

type ExporterConfig struct {
	Enabled                bool          `onGCE:"false"`
	Interval               time.Duration `default:"60s"`
	RuntimeInstrumentation bool          `onGCE:"true"`
	HostInstrumentation    bool          `onGCE:"true"`
}

ExporterConfig configures the metrics exporter.

type MetricMiddleware added in v0.19.0

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

func NewMetricMiddleware added in v0.19.0

func NewMetricMiddleware() (MetricMiddleware, error)

func (*MetricMiddleware) GRPCUnaryClientInterceptor added in v0.19.0

func (m *MetricMiddleware) GRPCUnaryClientInterceptor(
	ctx context.Context,
	fullMethod string,
	request interface{},
	response interface{},
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
) error

GRPCUnaryClientInterceptor provides request logging as a grpc.UnaryClientInterceptor.

func (*MetricMiddleware) GRPCUnaryServerInterceptor added in v0.19.0

func (m *MetricMiddleware) GRPCUnaryServerInterceptor(
	ctx context.Context,
	request interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (resp interface{}, err error)

GRPCUnaryServerInterceptor implements grpc.UnaryServerInterceptor and emits metrics for request count and request duration when a gRPC server receives requests.

Jump to

Keyboard shortcuts

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