operation

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 15 Imported by: 0

Documentation

Overview

Package operation is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	OperationService_SetOperation_FullMethodName = "/opentelemetry.ext.proto.operation.OperationService/SetOperation"
	OperationService_GetOperation_FullMethodName = "/opentelemetry.ext.proto.operation.OperationService/GetOperation"
)

Variables

View Source
var File_opentelemetry_ext_proto_operation_operation_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Alert.ProtoReflect.Descriptor instead.

func (*Alert) GetFor

func (x *Alert) GetFor() string

func (*Alert) GetInterval

func (x *Alert) GetInterval() string

func (*Alert) GetItems

func (x *Alert) GetItems() []*Item

func (*Alert) GetNamespace

func (x *Alert) GetNamespace() string

func (*Alert) ProtoMessage

func (*Alert) ProtoMessage()

func (*Alert) ProtoReflect

func (x *Alert) ProtoReflect() protoreflect.Message

func (*Alert) Reset

func (x *Alert) Reset()

func (*Alert) String

func (x *Alert) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Cloud.ProtoReflect.Descriptor instead.

func (*Cloud) GetPlatform

func (x *Cloud) GetPlatform() string

func (*Cloud) GetProvider

func (x *Cloud) GetProvider() string

func (*Cloud) ProtoMessage

func (*Cloud) ProtoMessage()

func (*Cloud) ProtoReflect

func (x *Cloud) ProtoReflect() protoreflect.Message

func (*Cloud) Reset

func (x *Cloud) Reset()

func (*Cloud) String

func (x *Cloud) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Code.ProtoReflect.Descriptor instead.

func (*Code) GetCode

func (x *Code) GetCode() int32

func (*Code) GetDescription

func (x *Code) GetDescription() string

func (*Code) GetMethod

func (x *Code) GetMethod() string

func (*Code) GetService

func (x *Code) GetService() string

func (*Code) GetType

func (x *Code) GetType() string

func (*Code) ProtoMessage

func (*Code) ProtoMessage()

func (*Code) ProtoReflect

func (x *Code) ProtoReflect() protoreflect.Message

func (*Code) Reset

func (x *Code) Reset()

func (*Code) String

func (x *Code) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Item.ProtoReflect.Descriptor instead.

func (*Item) GetAlert

func (x *Item) GetAlert() string

func (*Item) GetAnnotations

func (x *Item) GetAnnotations() map[string]string

func (*Item) GetExpr

func (x *Item) GetExpr() string

func (*Item) GetFor

func (x *Item) GetFor() string

func (*Item) GetLabels

func (x *Item) GetLabels() map[string]string

func (*Item) GetMatchers

func (x *Item) GetMatchers() []*Matcher

func (*Item) GetName

func (x *Item) GetName() string

func (*Item) GetNamespace

func (x *Item) GetNamespace() string

func (*Item) GetThreshold

func (x *Item) GetThreshold() float64

func (*Item) GetType

func (x *Item) GetType() string

func (*Item) ProtoMessage

func (*Item) ProtoMessage()

func (*Item) ProtoReflect

func (x *Item) ProtoReflect() protoreflect.Message

func (*Item) Reset

func (x *Item) Reset()

func (*Item) String

func (x *Item) String() string

type Log

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

func (*Log) Descriptor deprecated

func (*Log) Descriptor() ([]byte, []int)

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

func (x *Log) ProtoReflect() protoreflect.Message

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Matcher.ProtoReflect.Descriptor instead.

func (*Matcher) GetName

func (x *Matcher) GetName() string

func (*Matcher) GetType

func (x *Matcher) GetType() string

func (*Matcher) GetValue

func (x *Matcher) GetValue() string

func (*Matcher) ProtoMessage

func (*Matcher) ProtoMessage()

func (*Matcher) ProtoReflect

func (x *Matcher) ProtoReflect() protoreflect.Message

func (*Matcher) Reset

func (x *Matcher) Reset()

func (*Matcher) String

func (x *Matcher) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetCodes

func (x *Metric) GetCodes() []*Code

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Operation.ProtoReflect.Descriptor instead.

func (*Operation) GetAlert

func (x *Operation) GetAlert() *Alert

func (*Operation) GetLog

func (x *Operation) GetLog() *Log

func (*Operation) GetMetric

func (x *Operation) GetMetric() *Metric

func (*Operation) GetOwners

func (x *Operation) GetOwners() []*Owner

func (*Operation) GetResource

func (x *Operation) GetResource() *Resource

func (*Operation) GetSampler

func (x *Operation) GetSampler() *Sampler

func (*Operation) GetService

func (x *Operation) GetService() *Service

func (*Operation) GetTrace

func (x *Operation) GetTrace() *Trace

func (*Operation) GetVersion

func (x *Operation) GetVersion() string

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) ProtoReflect

func (x *Operation) ProtoReflect() protoreflect.Message

func (*Operation) Reset

func (x *Operation) Reset()

func (*Operation) String

func (x *Operation) String() string

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use Owner.ProtoReflect.Descriptor instead.

func (*Owner) GetEmail

func (x *Owner) GetEmail() string

func (*Owner) GetName

func (x *Owner) GetName() string

func (*Owner) ProtoMessage

func (*Owner) ProtoMessage()

func (*Owner) ProtoReflect

func (x *Owner) ProtoReflect() protoreflect.Message

func (*Owner) Reset

func (x *Owner) Reset()

func (*Owner) String

func (x *Owner) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) GetApp

func (x *Resource) GetApp() string

func (*Resource) GetCloud

func (x *Resource) GetCloud() *Cloud

func (*Resource) GetServer

func (x *Resource) GetServer() string

func (*Resource) GetTenant

func (x *Resource) GetTenant() string

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) ProtoReflect

func (x *Resource) ProtoReflect() protoreflect.Message

func (*Resource) Reset

func (x *Resource) Reset()

func (*Resource) String

func (x *Resource) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Sampler.ProtoReflect.Descriptor instead.

func (*Sampler) GetFraction

func (x *Sampler) GetFraction() float64

func (*Sampler) ProtoMessage

func (*Sampler) ProtoMessage()

func (*Sampler) ProtoReflect

func (x *Sampler) ProtoReflect() protoreflect.Message

func (*Sampler) Reset

func (x *Sampler) Reset()

func (*Sampler) String

func (x *Sampler) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetName

func (x *Service) GetName() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Trace.ProtoReflect.Descriptor instead.

func (*Trace) ProtoMessage

func (*Trace) ProtoMessage()

func (*Trace) ProtoReflect

func (x *Trace) ProtoReflect() protoreflect.Message

func (*Trace) Reset

func (x *Trace) Reset()

func (*Trace) String

func (x *Trace) String() string

type UnimplementedOperationServiceServer

type UnimplementedOperationServiceServer struct {
}

UnimplementedOperationServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOperationServiceServer) GetOperation

func (UnimplementedOperationServiceServer) SetOperation

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.

Jump to

Keyboard shortcuts

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