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.
Click to show internal directories.
Click to hide internal directories.