Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterServer ¶
func RegisterServer(s *grpc.Server, srv GRPCServer)
RegisterServer registers the GRPCServer to the grpc.Server.
Types ¶
type Client
deprecated
type Client = GRPCClient
Deprecated: [0.61.0] Use GRPCClient instead
type GRPCClient ¶ added in v0.61.0
type GRPCClient interface { // Export pmetric.Metrics to the server. // // For performance reasons, it is recommended to keep this RPC // alive for the entire life of the application. Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error) }
GRPCClient is the client API for OTLP-GRPC Metrics service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewClient ¶
func NewClient(cc *grpc.ClientConn) GRPCClient
NewClient returns a new Client connected using the given connection.
type GRPCServer ¶ added in v0.61.0
type GRPCServer interface { // Export is called every time a new request is received. // // For performance reasons, it is recommended to keep this RPC // alive for the entire life of the application. Export(context.Context, Request) (Response, error) }
GRPCServer is the server API for OTLP gRPC MetricsService service.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents the request for gRPC/HTTP client/server. It's a wrapper for pmetric.Metrics data.
func NewRequestFromMetrics ¶ added in v0.50.0
NewRequestFromMetrics returns a Request from pmetric.Metrics. Because Request is a wrapper for pmetric.Metrics, any changes to the provided Metrics struct will be reflected in the Request and vice versa.
func (Request) MarshalJSON ¶
MarshalJSON marshals Request into JSON bytes.
func (Request) MarshalProto ¶
MarshalProto marshals Request into proto bytes.
func (Request) UnmarshalJSON ¶
UnmarshalJSON unmarshalls Request from JSON bytes.
func (Request) UnmarshalProto ¶
UnmarshalProto unmarshalls Request from proto bytes.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response represents the response for gRPC/HTTP client/server.
func (Response) MarshalJSON ¶
MarshalJSON marshals Response into JSON bytes.
func (Response) MarshalProto ¶
MarshalProto marshals Response into proto bytes.
func (Response) UnmarshalJSON ¶
UnmarshalJSON unmarshalls Response from JSON bytes.
func (Response) UnmarshalProto ¶
UnmarshalProto unmarshalls Response from proto bytes.
type Server
deprecated
type Server = GRPCServer
Deprecated: [0.61.0] Use GRPCServer instead