Documentation ¶
Overview ¶
Package operation is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterOperationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterOperationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OperationServiceClient) error
- func RegisterOperationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterOperationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OperationServiceServer) error
- func RegisterOperationServiceServer(s grpc.ServiceRegistrar, srv OperationServiceServer)
- type Alert
- func (*Alert) Descriptor() ([]byte, []int)deprecated
- func (x *Alert) GetFor() string
- func (x *Alert) GetInterval() string
- func (x *Alert) GetItems() []*Item
- func (x *Alert) GetNamespace() string
- func (*Alert) ProtoMessage()
- func (x *Alert) ProtoReflect() protoreflect.Message
- func (x *Alert) Reset()
- func (x *Alert) String() string
- type Cloud
- type Code
- func (*Code) Descriptor() ([]byte, []int)deprecated
- func (x *Code) GetCode() int32
- func (x *Code) GetDescription() string
- func (x *Code) GetMethod() string
- func (x *Code) GetService() string
- func (x *Code) GetType() string
- func (*Code) ProtoMessage()
- func (x *Code) ProtoReflect() protoreflect.Message
- func (x *Code) Reset()
- func (x *Code) String() string
- type GetOperationRequest
- func (*GetOperationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetOperationRequest) GetApp() string
- func (x *GetOperationRequest) GetServer() string
- func (x *GetOperationRequest) GetTenant() string
- func (*GetOperationRequest) ProtoMessage()
- func (x *GetOperationRequest) ProtoReflect() protoreflect.Message
- func (x *GetOperationRequest) Reset()
- func (x *GetOperationRequest) String() string
- type GetOperationResponse
- func (*GetOperationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetOperationResponse) GetOperation() *Operation
- func (*GetOperationResponse) ProtoMessage()
- func (x *GetOperationResponse) ProtoReflect() protoreflect.Message
- func (x *GetOperationResponse) Reset()
- func (x *GetOperationResponse) String() string
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetAlert() string
- func (x *Item) GetAnnotations() map[string]string
- func (x *Item) GetExpr() string
- func (x *Item) GetFor() string
- func (x *Item) GetLabels() map[string]string
- func (x *Item) GetMatchers() []*Matcher
- func (x *Item) GetName() string
- func (x *Item) GetNamespace() string
- func (x *Item) GetThreshold() float64
- func (x *Item) GetType() string
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type Log
- type Matcher
- func (*Matcher) Descriptor() ([]byte, []int)deprecated
- func (x *Matcher) GetName() string
- func (x *Matcher) GetType() string
- func (x *Matcher) GetValue() string
- func (*Matcher) ProtoMessage()
- func (x *Matcher) ProtoReflect() protoreflect.Message
- func (x *Matcher) Reset()
- func (x *Matcher) String() string
- type Metric
- type Operation
- func (*Operation) Descriptor() ([]byte, []int)deprecated
- func (x *Operation) GetAlert() *Alert
- func (x *Operation) GetLog() *Log
- func (x *Operation) GetMetric() *Metric
- func (x *Operation) GetOwners() []*Owner
- func (x *Operation) GetResource() *Resource
- func (x *Operation) GetSampler() *Sampler
- func (x *Operation) GetService() *Service
- func (x *Operation) GetTrace() *Trace
- func (x *Operation) GetVersion() string
- func (*Operation) ProtoMessage()
- func (x *Operation) ProtoReflect() protoreflect.Message
- func (x *Operation) Reset()
- func (x *Operation) String() string
- type OperationServiceClient
- type OperationServiceServer
- type Owner
- type Resource
- func (*Resource) Descriptor() ([]byte, []int)deprecated
- func (x *Resource) GetApp() string
- func (x *Resource) GetCloud() *Cloud
- func (x *Resource) GetServer() string
- func (x *Resource) GetTenant() string
- func (*Resource) ProtoMessage()
- func (x *Resource) ProtoReflect() protoreflect.Message
- func (x *Resource) Reset()
- func (x *Resource) String() string
- type Sampler
- type Service
- type SetOperationRequest
- func (*SetOperationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetOperationRequest) GetOperation() *Operation
- func (*SetOperationRequest) ProtoMessage()
- func (x *SetOperationRequest) ProtoReflect() protoreflect.Message
- func (x *SetOperationRequest) Reset()
- func (x *SetOperationRequest) String() string
- type SetOperationResponse
- type Trace
- type UnimplementedOperationServiceServer
- type UnsafeOperationServiceServer
Constants ¶
const ( OperationService_SetOperation_FullMethodName = "/opentelemetry.ext.proto.operation.OperationService/SetOperation" OperationService_GetOperation_FullMethodName = "/opentelemetry.ext.proto.operation.OperationService/GetOperation" )
Variables ¶
var File_opentelemetry_ext_proto_operation_operation_proto protoreflect.FileDescriptor
var OperationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "opentelemetry.ext.proto.operation.OperationService", HandlerType: (*OperationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetOperation", Handler: _OperationService_SetOperation_Handler, }, { MethodName: "GetOperation", Handler: _OperationService_GetOperation_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "opentelemetry-ext/proto/operation/operation.proto", }
OperationService_ServiceDesc is the grpc.ServiceDesc for OperationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterOperationServiceHandler ¶
func RegisterOperationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterOperationServiceHandler registers the http handlers for service OperationService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterOperationServiceHandlerClient ¶
func RegisterOperationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OperationServiceClient) error
RegisterOperationServiceHandlerClient registers the http handlers for service OperationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OperationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OperationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OperationServiceClient" to call the correct interceptors.
func RegisterOperationServiceHandlerFromEndpoint ¶
func RegisterOperationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterOperationServiceHandlerFromEndpoint is same as RegisterOperationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOperationServiceHandlerServer ¶
func RegisterOperationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OperationServiceServer) error
RegisterOperationServiceHandlerServer registers the http handlers for service OperationService to "mux". UnaryRPC :call OperationServiceServer 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 RegisterOperationServiceHandlerFromEndpoint instead.
func RegisterOperationServiceServer ¶
func RegisterOperationServiceServer(s grpc.ServiceRegistrar, srv OperationServiceServer)
Types ¶
type Alert ¶
type Alert struct { Interval string `protobuf:"bytes,1,opt,name=interval,proto3" json:"interval,omitempty"` Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` For string `protobuf:"bytes,3,opt,name=for,proto3" json:"for,omitempty"` // 触发告警持续该时间后发出通知, 降低毛刺. 默认0m Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间. 默认Production. 可选(Development/Production), 支持正则 // contains filtered or unexported fields }
func (*Alert) Descriptor
deprecated
func (*Alert) GetInterval ¶
func (*Alert) GetNamespace ¶
func (*Alert) ProtoMessage ¶
func (*Alert) ProtoMessage()
func (*Alert) ProtoReflect ¶
func (x *Alert) ProtoReflect() protoreflect.Message
type Cloud ¶
type Cloud struct { Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` // contains filtered or unexported fields }
func (*Cloud) Descriptor
deprecated
func (*Cloud) GetPlatform ¶
func (*Cloud) GetProvider ¶
func (*Cloud) ProtoMessage ¶
func (*Cloud) ProtoMessage()
func (*Cloud) ProtoReflect ¶
func (x *Cloud) ProtoReflect() protoreflect.Message
type Code ¶
type Code struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` Method string `protobuf:"bytes,5,opt,name=method,proto3" json:"method,omitempty"` // contains filtered or unexported fields }
func (*Code) Descriptor
deprecated
func (*Code) GetDescription ¶
func (*Code) GetService ¶
func (*Code) ProtoMessage ¶
func (*Code) ProtoMessage()
func (*Code) ProtoReflect ¶
func (x *Code) ProtoReflect() protoreflect.Message
type GetOperationRequest ¶
type GetOperationRequest struct { Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` Server string `protobuf:"bytes,3,opt,name=server,proto3" json:"server,omitempty"` // contains filtered or unexported fields }
func (*GetOperationRequest) Descriptor
deprecated
func (*GetOperationRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetOperationRequest.ProtoReflect.Descriptor instead.
func (*GetOperationRequest) GetApp ¶
func (x *GetOperationRequest) GetApp() string
func (*GetOperationRequest) GetServer ¶
func (x *GetOperationRequest) GetServer() string
func (*GetOperationRequest) GetTenant ¶
func (x *GetOperationRequest) GetTenant() string
func (*GetOperationRequest) ProtoMessage ¶
func (*GetOperationRequest) ProtoMessage()
func (*GetOperationRequest) ProtoReflect ¶
func (x *GetOperationRequest) ProtoReflect() protoreflect.Message
func (*GetOperationRequest) Reset ¶
func (x *GetOperationRequest) Reset()
func (*GetOperationRequest) String ¶
func (x *GetOperationRequest) String() string
type GetOperationResponse ¶
type GetOperationResponse struct { Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` // contains filtered or unexported fields }
func (*GetOperationResponse) Descriptor
deprecated
func (*GetOperationResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetOperationResponse.ProtoReflect.Descriptor instead.
func (*GetOperationResponse) GetOperation ¶
func (x *GetOperationResponse) GetOperation() *Operation
func (*GetOperationResponse) ProtoMessage ¶
func (*GetOperationResponse) ProtoMessage()
func (*GetOperationResponse) ProtoReflect ¶
func (x *GetOperationResponse) ProtoReflect() protoreflect.Message
func (*GetOperationResponse) Reset ¶
func (x *GetOperationResponse) Reset()
func (*GetOperationResponse) String ¶
func (x *GetOperationResponse) String() string
type Item ¶
type Item struct { Alert string `protobuf:"bytes,8,opt,name=alert,proto3" json:"alert,omitempty"` // 告警标题 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 指标名 Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // 告警类型 max/min/delta_percent_max_5m/delta_percent_max_10m/delta_percent_max_1d/delta_percent_max_7d Threshold float64 `protobuf:"fixed64,4,opt,name=threshold,proto3" json:"threshold,omitempty"` // 阈值 For string `protobuf:"bytes,5,opt,name=for,proto3" json:"for,omitempty"` // 持续时间 Namespace string `protobuf:"bytes,6,opt,name=namespace,proto3" json:"namespace,omitempty"` // namespace选择器 Expr string `protobuf:"bytes,9,opt,name=expr,proto3" json:"expr,omitempty"` // 原始查询语句 Labels map[string]string `` // 告警 label /* 154-byte string literal not displayed */ Annotations map[string]string `` // 告警 annotations /* 164-byte string literal not displayed */ Matchers []*Matcher `protobuf:"bytes,12,rep,name=matchers,proto3" json:"matchers,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) GetAnnotations ¶
func (*Item) GetMatchers ¶
func (*Item) GetNamespace ¶
func (*Item) GetThreshold ¶
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (*Log) Descriptor
deprecated
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) ProtoReflect ¶
func (x *Log) ProtoReflect() protoreflect.Message
type Matcher ¶
type Matcher struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Matcher) Descriptor
deprecated
func (*Matcher) ProtoMessage ¶
func (*Matcher) ProtoMessage()
func (*Matcher) ProtoReflect ¶
func (x *Matcher) ProtoReflect() protoreflect.Message
type Metric ¶
type Metric struct { Codes []*Code `protobuf:"bytes,1,rep,name=codes,proto3" json:"codes,omitempty"` // contains filtered or unexported fields }
func (*Metric) Descriptor
deprecated
func (*Metric) ProtoMessage ¶
func (*Metric) ProtoMessage()
func (*Metric) ProtoReflect ¶
func (x *Metric) ProtoReflect() protoreflect.Message
type Operation ¶
type Operation struct { Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` Owners []*Owner `protobuf:"bytes,4,rep,name=owners,proto3" json:"owners,omitempty"` Sampler *Sampler `protobuf:"bytes,5,opt,name=sampler,proto3" json:"sampler,omitempty"` Alert *Alert `protobuf:"bytes,6,opt,name=alert,proto3" json:"alert,omitempty"` Metric *Metric `protobuf:"bytes,7,opt,name=metric,proto3" json:"metric,omitempty"` Trace *Trace `protobuf:"bytes,8,opt,name=trace,proto3" json:"trace,omitempty"` Log *Log `protobuf:"bytes,9,opt,name=log,proto3" json:"log,omitempty"` // contains filtered or unexported fields }
func (*Operation) Descriptor
deprecated
func (*Operation) GetResource ¶
func (*Operation) GetSampler ¶
func (*Operation) GetService ¶
func (*Operation) GetVersion ¶
func (*Operation) ProtoMessage ¶
func (*Operation) ProtoMessage()
func (*Operation) ProtoReflect ¶
func (x *Operation) ProtoReflect() protoreflect.Message
type OperationServiceClient ¶
type OperationServiceClient interface { SetOperation(ctx context.Context, in *SetOperationRequest, opts ...grpc.CallOption) (*SetOperationResponse, error) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*GetOperationResponse, error) }
OperationServiceClient is the client API for OperationService 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 NewOperationServiceClient ¶
func NewOperationServiceClient(cc grpc.ClientConnInterface) OperationServiceClient
type OperationServiceServer ¶
type OperationServiceServer interface { SetOperation(context.Context, *SetOperationRequest) (*SetOperationResponse, error) GetOperation(context.Context, *GetOperationRequest) (*GetOperationResponse, error) // contains filtered or unexported methods }
OperationServiceServer is the server API for OperationService service. All implementations must embed UnimplementedOperationServiceServer for forward compatibility
type Owner ¶
type Owner struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*Owner) Descriptor
deprecated
func (*Owner) ProtoMessage ¶
func (*Owner) ProtoMessage()
func (*Owner) ProtoReflect ¶
func (x *Owner) ProtoReflect() protoreflect.Message
type Resource ¶
type Resource struct { Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` Server string `protobuf:"bytes,3,opt,name=server,proto3" json:"server,omitempty"` Cloud *Cloud `protobuf:"bytes,4,opt,name=cloud,proto3" json:"cloud,omitempty"` // contains filtered or unexported fields }
func (*Resource) Descriptor
deprecated
func (*Resource) ProtoMessage ¶
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶
func (x *Resource) ProtoReflect() protoreflect.Message
type Sampler ¶
type Sampler struct { Fraction float64 `protobuf:"fixed64,1,opt,name=fraction,proto3" json:"fraction,omitempty"` // contains filtered or unexported fields }
func (*Sampler) Descriptor
deprecated
func (*Sampler) GetFraction ¶
func (*Sampler) ProtoMessage ¶
func (*Sampler) ProtoMessage()
func (*Sampler) ProtoReflect ¶
func (x *Sampler) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Service) Descriptor
deprecated
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ProtoReflect ¶
func (x *Service) ProtoReflect() protoreflect.Message
type SetOperationRequest ¶
type SetOperationRequest struct { Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` // contains filtered or unexported fields }
func (*SetOperationRequest) Descriptor
deprecated
func (*SetOperationRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetOperationRequest.ProtoReflect.Descriptor instead.
func (*SetOperationRequest) GetOperation ¶
func (x *SetOperationRequest) GetOperation() *Operation
func (*SetOperationRequest) ProtoMessage ¶
func (*SetOperationRequest) ProtoMessage()
func (*SetOperationRequest) ProtoReflect ¶
func (x *SetOperationRequest) ProtoReflect() protoreflect.Message
func (*SetOperationRequest) Reset ¶
func (x *SetOperationRequest) Reset()
func (*SetOperationRequest) String ¶
func (x *SetOperationRequest) String() string
type SetOperationResponse ¶
type SetOperationResponse struct {
// contains filtered or unexported fields
}
func (*SetOperationResponse) Descriptor
deprecated
func (*SetOperationResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetOperationResponse.ProtoReflect.Descriptor instead.
func (*SetOperationResponse) ProtoMessage ¶
func (*SetOperationResponse) ProtoMessage()
func (*SetOperationResponse) ProtoReflect ¶
func (x *SetOperationResponse) ProtoReflect() protoreflect.Message
func (*SetOperationResponse) Reset ¶
func (x *SetOperationResponse) Reset()
func (*SetOperationResponse) String ¶
func (x *SetOperationResponse) String() string
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
func (*Trace) Descriptor
deprecated
func (*Trace) ProtoMessage ¶
func (*Trace) ProtoMessage()
func (*Trace) ProtoReflect ¶
func (x *Trace) ProtoReflect() protoreflect.Message
type UnimplementedOperationServiceServer ¶
type UnimplementedOperationServiceServer struct { }
UnimplementedOperationServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOperationServiceServer) GetOperation ¶
func (UnimplementedOperationServiceServer) GetOperation(context.Context, *GetOperationRequest) (*GetOperationResponse, error)
func (UnimplementedOperationServiceServer) SetOperation ¶
func (UnimplementedOperationServiceServer) SetOperation(context.Context, *SetOperationRequest) (*SetOperationResponse, error)
type UnsafeOperationServiceServer ¶
type UnsafeOperationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeOperationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OperationServiceServer will result in compilation errors.