Documentation ¶
Overview ¶
Package cloudmonitoring provides primitives for Cloud Monitoring integration.
Index ¶
- func StartExporter(ctx context.Context, exporterConfig ExporterConfig, ...) (func(), error)
- type ExporterConfigdeprecated
- type MetricMiddleware
- func (m *MetricMiddleware) GRPCStreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func (m *MetricMiddleware) GRPCUnaryClientInterceptor(ctx context.Context, fullMethod string, request interface{}, ...) error
- func (m *MetricMiddleware) GRPCUnaryServerInterceptor(ctx context.Context, request interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
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. Deprecated: use cloudotel.StartMetricExporter.
Types ¶
type ExporterConfig
deprecated
type ExporterConfig = cloudotel.MetricExporterConfig
Deprecated: use cloudotel.ExporterConfig.
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) GRPCStreamServerInterceptor ¶ added in v0.41.0
func (m *MetricMiddleware) GRPCStreamServerInterceptor( srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) (err error)
GRPCStreamServerInterceptor implements grpc.UnaryServerInterceptor and emits metrics for request count and request duration when a gRPC server receives streaming requests.
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.