ptraceotlp

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 73

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegisterServer = RegisterGRPCServer

Deprecated: [v0.62.0] Use RegisterGRPCServer instead

Functions

func RegisterGRPCServer added in v0.62.0

func RegisterGRPCServer(s *grpc.Server, srv GRPCServer)

RegisterGRPCServer registers the GRPCServer to the grpc.Server.

Types

type GRPCClient added in v0.61.0

type GRPCClient interface {
	// Export ptrace.Traces 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 Traces 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 TracesService 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 ptrace.Traces data.

func NewRequest

func NewRequest() Request

NewRequest returns an empty Request.

func NewRequestFromTraces added in v0.50.0

func NewRequestFromTraces(td ptrace.Traces) Request

NewRequestFromTraces returns a Request from ptrace.Traces. Because Request is a wrapper for ptrace.Traces, any changes to the provided Traces struct will be reflected in the Request and vice versa.

func (Request) MarshalJSON

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

MarshalJSON marshals Request into JSON bytes.

func (Request) MarshalProto

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

MarshalProto marshals Request into proto bytes.

func (Request) Traces

func (tr Request) Traces() ptrace.Traces

func (Request) UnmarshalJSON

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

UnmarshalJSON unmarshalls Request from JSON bytes.

func (Request) UnmarshalProto

func (tr 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 (tr Response) MarshalJSON() ([]byte, error)

MarshalJSON marshals Response into JSON bytes.

func (Response) MarshalProto

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

MarshalProto marshals Response into proto bytes.

func (Response) UnmarshalJSON

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

UnmarshalJSON unmarshalls Response from JSON bytes.

func (Response) UnmarshalProto

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

UnmarshalProto unmarshalls Response from proto bytes.

Jump to

Keyboard shortcuts

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