Documentation ¶
Overview ¶
Package trace_proxy is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTraceProxyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTraceProxyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TraceProxyServiceClient) error
- func RegisterTraceProxyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTraceProxyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TraceProxyServiceServer) error
- func RegisterTraceProxyServiceServer(s grpc.ServiceRegistrar, srv TraceProxyServiceServer)
- type AnyValue
- func (*AnyValue) Descriptor() ([]byte, []int)deprecated
- func (x *AnyValue) GetArrayValue() *ArrayValue
- func (x *AnyValue) GetBoolValue() bool
- func (x *AnyValue) GetBytesValue() []byte
- func (x *AnyValue) GetDoubleValue() float64
- func (x *AnyValue) GetIntValue() int64
- func (x *AnyValue) GetKvlistValue() *KeyValueList
- func (x *AnyValue) GetStringValue() string
- func (m *AnyValue) GetValue() isAnyValue_Value
- func (*AnyValue) ProtoMessage()
- func (x *AnyValue) ProtoReflect() protoreflect.Message
- func (x *AnyValue) Reset()
- func (x *AnyValue) String() string
- type AnyValue_ArrayValue
- type AnyValue_BoolValue
- type AnyValue_BytesValue
- type AnyValue_DoubleValue
- type AnyValue_IntValue
- type AnyValue_KvlistValue
- type AnyValue_StringValue
- type ArrayValue
- type Data
- func (*Data) Descriptor() ([]byte, []int)deprecated
- func (x *Data) GetDurationMs() float64
- func (x *Data) GetEndTime() int64
- func (x *Data) GetError() bool
- func (x *Data) GetEventAttributes() []*KeyValue
- func (x *Data) GetFromProxy() bool
- func (x *Data) GetMetaType() string
- func (x *Data) GetParentName() string
- func (x *Data) GetResourceAttributes() []*KeyValue
- func (x *Data) GetSpanAttributes() []*KeyValue
- func (x *Data) GetSpanKind() string
- func (x *Data) GetSpanName() string
- func (x *Data) GetSpanNumEvents() int64
- func (x *Data) GetSpanNumLinks() int64
- func (x *Data) GetStartTime() int64
- func (x *Data) GetStatusCode() int64
- func (x *Data) GetStatusMessage() string
- func (x *Data) GetTime() int64
- func (x *Data) GetTraceLinkSpanID() string
- func (x *Data) GetTraceLinkTraceID() string
- func (x *Data) GetTraceParentID() string
- func (x *Data) GetTraceSpanID() string
- func (x *Data) GetTraceTraceID() string
- func (x *Data) GetType() string
- func (*Data) ProtoMessage()
- func (x *Data) ProtoReflect() protoreflect.Message
- func (x *Data) Reset()
- func (x *Data) String() string
- type ExportTraceProxyServiceRequest
- func (*ExportTraceProxyServiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExportTraceProxyServiceRequest) GetItems() []*ProxySpan
- func (x *ExportTraceProxyServiceRequest) GetTenantId() string
- func (*ExportTraceProxyServiceRequest) ProtoMessage()
- func (x *ExportTraceProxyServiceRequest) ProtoReflect() protoreflect.Message
- func (x *ExportTraceProxyServiceRequest) Reset()
- func (x *ExportTraceProxyServiceRequest) String() string
- type ExportTraceProxyServiceResponse
- func (*ExportTraceProxyServiceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExportTraceProxyServiceResponse) GetMessage() string
- func (x *ExportTraceProxyServiceResponse) GetStatus() string
- func (*ExportTraceProxyServiceResponse) ProtoMessage()
- func (x *ExportTraceProxyServiceResponse) ProtoReflect() protoreflect.Message
- func (x *ExportTraceProxyServiceResponse) Reset()
- func (x *ExportTraceProxyServiceResponse) String() string
- type KeyValue
- type KeyValueList
- type ProxySpan
- type TraceProxyServiceClient
- type TraceProxyServiceServer
- type UnimplementedTraceProxyServiceServer
- type UnsafeTraceProxyServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_trace_proxy_proxyspan_proto protoreflect.FileDescriptor
var TraceProxyService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.TraceProxyService", HandlerType: (*TraceProxyServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ExportTraceProxy", Handler: _TraceProxyService_ExportTraceProxy_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "trace-proxy/proxyspan.proto", }
TraceProxyService_ServiceDesc is the grpc.ServiceDesc for TraceProxyService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTraceProxyServiceHandler ¶
func RegisterTraceProxyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTraceProxyServiceHandler registers the http handlers for service TraceProxyService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTraceProxyServiceHandlerClient ¶
func RegisterTraceProxyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TraceProxyServiceClient) error
RegisterTraceProxyServiceHandlerClient registers the http handlers for service TraceProxyService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TraceProxyServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TraceProxyServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TraceProxyServiceClient" to call the correct interceptors.
func RegisterTraceProxyServiceHandlerFromEndpoint ¶
func RegisterTraceProxyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTraceProxyServiceHandlerFromEndpoint is same as RegisterTraceProxyServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTraceProxyServiceHandlerServer ¶
func RegisterTraceProxyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TraceProxyServiceServer) error
RegisterTraceProxyServiceHandlerServer registers the http handlers for service TraceProxyService to "mux". UnaryRPC :call TraceProxyServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTraceProxyServiceHandlerFromEndpoint instead.
func RegisterTraceProxyServiceServer ¶
func RegisterTraceProxyServiceServer(s grpc.ServiceRegistrar, srv TraceProxyServiceServer)
Types ¶
type AnyValue ¶
type AnyValue struct { // The value is one of the listed fields. It is valid for all values to be unspecified // in which case this AnyValue is considered to be "empty". // // Types that are assignable to Value: // *AnyValue_StringValue // *AnyValue_BoolValue // *AnyValue_IntValue // *AnyValue_DoubleValue // *AnyValue_ArrayValue // *AnyValue_KvlistValue // *AnyValue_BytesValue Value isAnyValue_Value `protobuf_oneof:"value"` // contains filtered or unexported fields }
AnyValue is used to represent any type of attribute value. AnyValue may contain a primitive value such as a string or integer or it may contain an arbitrary nested object containing arrays, key-value lists and primitives.
func (*AnyValue) Descriptor
deprecated
func (*AnyValue) GetArrayValue ¶
func (x *AnyValue) GetArrayValue() *ArrayValue
func (*AnyValue) GetBoolValue ¶
func (*AnyValue) GetBytesValue ¶
func (*AnyValue) GetDoubleValue ¶
func (*AnyValue) GetIntValue ¶
func (*AnyValue) GetKvlistValue ¶
func (x *AnyValue) GetKvlistValue() *KeyValueList
func (*AnyValue) GetStringValue ¶
func (*AnyValue) ProtoMessage ¶
func (*AnyValue) ProtoMessage()
func (*AnyValue) ProtoReflect ¶
func (x *AnyValue) ProtoReflect() protoreflect.Message
type AnyValue_ArrayValue ¶
type AnyValue_ArrayValue struct {
ArrayValue *ArrayValue `protobuf:"bytes,5,opt,name=array_value,json=arrayValue,proto3,oneof"`
}
type AnyValue_BoolValue ¶
type AnyValue_BoolValue struct {
BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
}
type AnyValue_BytesValue ¶
type AnyValue_BytesValue struct {
BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"`
}
type AnyValue_DoubleValue ¶
type AnyValue_DoubleValue struct {
DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"`
}
type AnyValue_IntValue ¶
type AnyValue_IntValue struct {
IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"`
}
type AnyValue_KvlistValue ¶
type AnyValue_KvlistValue struct {
KvlistValue *KeyValueList `protobuf:"bytes,6,opt,name=kvlist_value,json=kvlistValue,proto3,oneof"`
}
type AnyValue_StringValue ¶
type AnyValue_StringValue struct {
StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"`
}
type ArrayValue ¶
type ArrayValue struct { // Array of values. The array may be empty (contain 0 elements). Values []*AnyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
ArrayValue is a list of AnyValue messages. We need ArrayValue as a message since oneof in AnyValue does not allow repeated fields.
func (*ArrayValue) Descriptor
deprecated
func (*ArrayValue) Descriptor() ([]byte, []int)
Deprecated: Use ArrayValue.ProtoReflect.Descriptor instead.
func (*ArrayValue) GetValues ¶
func (x *ArrayValue) GetValues() []*AnyValue
func (*ArrayValue) ProtoMessage ¶
func (*ArrayValue) ProtoMessage()
func (*ArrayValue) ProtoReflect ¶
func (x *ArrayValue) ProtoReflect() protoreflect.Message
func (*ArrayValue) Reset ¶
func (x *ArrayValue) Reset()
func (*ArrayValue) String ¶
func (x *ArrayValue) String() string
type Data ¶
type Data struct { DurationMs float64 `protobuf:"fixed64,1,opt,name=durationMs,proto3" json:"durationMs,omitempty"` Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` SpanName string `protobuf:"bytes,5,opt,name=spanName,proto3" json:"spanName,omitempty"` ParentName string `protobuf:"bytes,6,opt,name=parentName,proto3" json:"parentName,omitempty"` SpanKind string `protobuf:"bytes,8,opt,name=spanKind,proto3" json:"spanKind,omitempty"` SpanNumEvents int64 `protobuf:"varint,9,opt,name=spanNumEvents,proto3" json:"spanNumEvents,omitempty"` SpanNumLinks int64 `protobuf:"varint,10,opt,name=spanNumLinks,proto3" json:"spanNumLinks,omitempty"` StatusCode int64 `protobuf:"varint,11,opt,name=statusCode,proto3" json:"statusCode,omitempty"` FromProxy bool `protobuf:"varint,12,opt,name=fromProxy,proto3" json:"fromProxy,omitempty"` TraceParentID string `protobuf:"bytes,13,opt,name=traceParentID,proto3" json:"traceParentID,omitempty"` TraceSpanID string `protobuf:"bytes,14,opt,name=traceSpanID,proto3" json:"traceSpanID,omitempty"` TraceTraceID string `protobuf:"bytes,15,opt,name=traceTraceID,proto3" json:"traceTraceID,omitempty"` TraceLinkSpanID string `protobuf:"bytes,16,opt,name=traceLinkSpanID,proto3" json:"traceLinkSpanID,omitempty"` TraceLinkTraceID string `protobuf:"bytes,17,opt,name=traceLinkTraceID,proto3" json:"traceLinkTraceID,omitempty"` Error bool `protobuf:"varint,18,opt,name=error,proto3" json:"error,omitempty"` StatusMessage string `protobuf:"bytes,19,opt,name=statusMessage,proto3" json:"statusMessage,omitempty"` Time int64 `protobuf:"varint,20,opt,name=time,proto3" json:"time,omitempty"` MetaType string `protobuf:"bytes,21,opt,name=metaType,proto3" json:"metaType,omitempty"` // The OpenTelemetry API specification further restricts the allowed value types: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). ResourceAttributes []*KeyValue `protobuf:"bytes,22,rep,name=resourceAttributes,proto3" json:"resourceAttributes,omitempty"` SpanAttributes []*KeyValue `protobuf:"bytes,23,rep,name=spanAttributes,proto3" json:"spanAttributes,omitempty"` EventAttributes []*KeyValue `protobuf:"bytes,24,rep,name=eventAttributes,proto3" json:"eventAttributes,omitempty"` StartTime int64 `protobuf:"varint,25,opt,name=startTime,proto3" json:"startTime,omitempty"` EndTime int64 `protobuf:"varint,26,opt,name=endTime,proto3" json:"endTime,omitempty"` // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) GetDurationMs ¶
func (*Data) GetEndTime ¶
func (*Data) GetEventAttributes ¶
func (*Data) GetFromProxy ¶
func (*Data) GetMetaType ¶
func (*Data) GetParentName ¶
func (*Data) GetResourceAttributes ¶
func (*Data) GetSpanAttributes ¶
func (*Data) GetSpanKind ¶
func (*Data) GetSpanName ¶
func (*Data) GetSpanNumEvents ¶
func (*Data) GetSpanNumLinks ¶
func (*Data) GetStartTime ¶
func (*Data) GetStatusCode ¶
func (*Data) GetStatusMessage ¶
func (*Data) GetTraceLinkSpanID ¶
func (*Data) GetTraceLinkTraceID ¶
func (*Data) GetTraceParentID ¶
func (*Data) GetTraceSpanID ¶
func (*Data) GetTraceTraceID ¶
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type ExportTraceProxyServiceRequest ¶
type ExportTraceProxyServiceRequest struct { Items []*ProxySpan `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` TenantId string `protobuf:"bytes,2,opt,name=tenantId,proto3" json:"tenantId,omitempty"` // contains filtered or unexported fields }
func (*ExportTraceProxyServiceRequest) Descriptor
deprecated
func (*ExportTraceProxyServiceRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExportTraceProxyServiceRequest.ProtoReflect.Descriptor instead.
func (*ExportTraceProxyServiceRequest) GetItems ¶
func (x *ExportTraceProxyServiceRequest) GetItems() []*ProxySpan
func (*ExportTraceProxyServiceRequest) GetTenantId ¶
func (x *ExportTraceProxyServiceRequest) GetTenantId() string
func (*ExportTraceProxyServiceRequest) ProtoMessage ¶
func (*ExportTraceProxyServiceRequest) ProtoMessage()
func (*ExportTraceProxyServiceRequest) ProtoReflect ¶
func (x *ExportTraceProxyServiceRequest) ProtoReflect() protoreflect.Message
func (*ExportTraceProxyServiceRequest) Reset ¶
func (x *ExportTraceProxyServiceRequest) Reset()
func (*ExportTraceProxyServiceRequest) String ¶
func (x *ExportTraceProxyServiceRequest) String() string
type ExportTraceProxyServiceResponse ¶
type ExportTraceProxyServiceResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
The response message
func (*ExportTraceProxyServiceResponse) Descriptor
deprecated
func (*ExportTraceProxyServiceResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExportTraceProxyServiceResponse.ProtoReflect.Descriptor instead.
func (*ExportTraceProxyServiceResponse) GetMessage ¶
func (x *ExportTraceProxyServiceResponse) GetMessage() string
func (*ExportTraceProxyServiceResponse) GetStatus ¶
func (x *ExportTraceProxyServiceResponse) GetStatus() string
func (*ExportTraceProxyServiceResponse) ProtoMessage ¶
func (*ExportTraceProxyServiceResponse) ProtoMessage()
func (*ExportTraceProxyServiceResponse) ProtoReflect ¶
func (x *ExportTraceProxyServiceResponse) ProtoReflect() protoreflect.Message
func (*ExportTraceProxyServiceResponse) Reset ¶
func (x *ExportTraceProxyServiceResponse) Reset()
func (*ExportTraceProxyServiceResponse) String ¶
func (x *ExportTraceProxyServiceResponse) String() string
type KeyValue ¶
type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value *AnyValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
KeyValue is a key-value pair that is used to store Span attributes, Link attributes, etc.
func (*KeyValue) Descriptor
deprecated
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
func (*KeyValue) ProtoReflect ¶
func (x *KeyValue) ProtoReflect() protoreflect.Message
type KeyValueList ¶
type KeyValueList struct { // A collection of key/value pairs of key-value pairs. The list may be empty (may // contain 0 elements). // The keys MUST be unique (it is not allowed to have more than one // value with the same key). Values []*KeyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
KeyValueList is a list of KeyValue messages. We need KeyValueList as a message since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches are semantically equivalent.
func (*KeyValueList) Descriptor
deprecated
func (*KeyValueList) Descriptor() ([]byte, []int)
Deprecated: Use KeyValueList.ProtoReflect.Descriptor instead.
func (*KeyValueList) GetValues ¶
func (x *KeyValueList) GetValues() []*KeyValue
func (*KeyValueList) ProtoMessage ¶
func (*KeyValueList) ProtoMessage()
func (*KeyValueList) ProtoReflect ¶
func (x *KeyValueList) ProtoReflect() protoreflect.Message
func (*KeyValueList) Reset ¶
func (x *KeyValueList) Reset()
func (*KeyValueList) String ¶
func (x *KeyValueList) String() string
type ProxySpan ¶
type ProxySpan struct { Data *Data `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*ProxySpan) Descriptor
deprecated
func (*ProxySpan) GetTimestamp ¶
func (*ProxySpan) ProtoMessage ¶
func (*ProxySpan) ProtoMessage()
func (*ProxySpan) ProtoReflect ¶
func (x *ProxySpan) ProtoReflect() protoreflect.Message
type TraceProxyServiceClient ¶
type TraceProxyServiceClient interface { // For performance reasons, it is recommended to keep this RPC // alive for the entire life of the application. ExportTraceProxy(ctx context.Context, in *ExportTraceProxyServiceRequest, opts ...grpc.CallOption) (*ExportTraceProxyServiceResponse, error) }
TraceProxyServiceClient is the client API for TraceProxyService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewTraceProxyServiceClient ¶
func NewTraceProxyServiceClient(cc grpc.ClientConnInterface) TraceProxyServiceClient
type TraceProxyServiceServer ¶
type TraceProxyServiceServer interface { // For performance reasons, it is recommended to keep this RPC // alive for the entire life of the application. ExportTraceProxy(context.Context, *ExportTraceProxyServiceRequest) (*ExportTraceProxyServiceResponse, error) // contains filtered or unexported methods }
TraceProxyServiceServer is the server API for TraceProxyService service. All implementations must embed UnimplementedTraceProxyServiceServer for forward compatibility
type UnimplementedTraceProxyServiceServer ¶
type UnimplementedTraceProxyServiceServer struct { }
UnimplementedTraceProxyServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTraceProxyServiceServer) ExportTraceProxy ¶
func (UnimplementedTraceProxyServiceServer) ExportTraceProxy(context.Context, *ExportTraceProxyServiceRequest) (*ExportTraceProxyServiceResponse, error)
type UnsafeTraceProxyServiceServer ¶
type UnsafeTraceProxyServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTraceProxyServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TraceProxyServiceServer will result in compilation errors.