plogotlp

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 62

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterServer

func RegisterServer(s *grpc.Server, srv Server)

RegisterServer registers the Server to the grpc.Server.

Types

type Client

type Client interface {
	// Export plog.Logs 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)
}

Client is the client API for OTLP-GRPC Logs 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) Client

NewClient returns a new Client connected using the given connection.

type Request

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

Request represents the request for gRPC/HTTP client/server. It's a wrapper for plog.Logs data.

func NewRequest

func NewRequest() Request

NewRequest returns an empty Request.

func NewRequestFromLogs added in v0.50.0

func NewRequestFromLogs(l plog.Logs) Request

NewRequestFromLogs returns a Request from plog.Logs. Because Request is a wrapper for plog.Logs, any changes to the provided Logs struct will be reflected in the Request and vice versa.

func (Request) Logs

func (lr Request) Logs() plog.Logs

func (Request) MarshalJSON

func (lr Request) MarshalJSON() ([]byte, error)

MarshalJSON marshals Request into JSON bytes.

func (Request) MarshalProto

func (lr Request) MarshalProto() ([]byte, error)

MarshalProto marshals Request into proto bytes.

func (Request) UnmarshalJSON

func (lr Request) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls Request from JSON bytes.

func (Request) UnmarshalProto

func (lr Request) UnmarshalProto(data []byte) error

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 NewResponse

func NewResponse() Response

NewResponse returns an empty Response.

func (Response) MarshalJSON

func (lr Response) MarshalJSON() ([]byte, error)

MarshalJSON marshals Response into JSON bytes.

func (Response) MarshalProto

func (lr Response) MarshalProto() ([]byte, error)

MarshalProto marshals Response into proto bytes.

func (Response) UnmarshalJSON

func (lr Response) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshalls Response from JSON bytes.

func (Response) UnmarshalProto

func (lr Response) UnmarshalProto(data []byte) error

UnmarshalProto unmarshalls Response from proto bytes.

type Server

type Server 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)
}

Server is the server API for OTLP gRPC LogsService service.

Jump to

Keyboard shortcuts

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