observer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Apache-2.0, GPL-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_observiability_proto protoreflect.FileDescriptor
View Source
var Server_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "obi.v1.Server",
	HandlerType: (*ServerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPluginName",
			Handler:    _Server_GetPluginName_Handler,
		},
		{
			MethodName: "PluginCapabilities",
			Handler:    _Server_PluginCapabilities_Handler,
		},
		{
			MethodName: "GetMetrics",
			Handler:    _Server_GetMetrics_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "observiability.proto",
}

Server_ServiceDesc is the grpc.ServiceDesc for Server service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServerServer

func RegisterServerServer(s grpc.ServiceRegistrar, srv ServerServer)

Types

type GetMetricsRequest

type GetMetricsRequest struct {

	// pod name or node name.
	// if there is a query field, ignore the resource_name field
	ResourceNames []string `protobuf:"bytes,1,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"`
	Namespace     string   `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// cpu_usage, memory_usage eg.
	MetricName string `protobuf:"bytes,3,opt,name=metric_name,json=metricName,proto3" json:"metric_name,omitempty"`
	// max, min, avg. And so on, some ways to aggregate data
	Aggregation []string `protobuf:"bytes,4,rep,name=aggregation,proto3" json:"aggregation,omitempty"`
	// such as promql
	Query string `protobuf:"bytes,5,opt,name=query,proto3" json:"query,omitempty"`
	// 1650867976563 million second
	// 这个请求时间做一个保留
	StartTime int64 `protobuf:"varint,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime   int64 `protobuf:"varint,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// resource kind, Pod, Node etc.
	Kind string `protobuf:"bytes,8,opt,name=kind,proto3" json:"kind,omitempty"`
	Unit string `protobuf:"bytes,9,opt,name=unit,proto3" json:"unit,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricsRequest) Descriptor deprecated

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

Deprecated: Use GetMetricsRequest.ProtoReflect.Descriptor instead.

func (*GetMetricsRequest) GetAggregation

func (x *GetMetricsRequest) GetAggregation() []string

func (*GetMetricsRequest) GetEndTime

func (x *GetMetricsRequest) GetEndTime() int64

func (*GetMetricsRequest) GetKind

func (x *GetMetricsRequest) GetKind() string

func (*GetMetricsRequest) GetMetricName

func (x *GetMetricsRequest) GetMetricName() string

func (*GetMetricsRequest) GetNamespace

func (x *GetMetricsRequest) GetNamespace() string

func (*GetMetricsRequest) GetQuery

func (x *GetMetricsRequest) GetQuery() string

func (*GetMetricsRequest) GetResourceNames

func (x *GetMetricsRequest) GetResourceNames() []string

func (*GetMetricsRequest) GetStartTime

func (x *GetMetricsRequest) GetStartTime() int64

func (*GetMetricsRequest) GetUnit

func (x *GetMetricsRequest) GetUnit() string

func (*GetMetricsRequest) ProtoMessage

func (*GetMetricsRequest) ProtoMessage()

func (*GetMetricsRequest) ProtoReflect

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

func (*GetMetricsRequest) Reset

func (x *GetMetricsRequest) Reset()

func (*GetMetricsRequest) String

func (x *GetMetricsRequest) String() string

type GetMetricsResponse

type GetMetricsResponse struct {

	// maybe empty,
	// For example, metrics-server can return resource_name,
	// which is the acquisition of the instantaneous value of the data.
	ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
	Namespace    string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// maybe empty
	Unit    string                      `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"`
	Records []*GetMetricsResponseRecord `protobuf:"bytes,4,rep,name=records,proto3" json:"records,omitempty"` //map<string,double> values = 4;
	// contains filtered or unexported fields
}

func (*GetMetricsResponse) Descriptor deprecated

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

Deprecated: Use GetMetricsResponse.ProtoReflect.Descriptor instead.

func (*GetMetricsResponse) GetNamespace

func (x *GetMetricsResponse) GetNamespace() string

func (*GetMetricsResponse) GetRecords

func (x *GetMetricsResponse) GetRecords() []*GetMetricsResponseRecord

func (*GetMetricsResponse) GetResourceName

func (x *GetMetricsResponse) GetResourceName() string

func (*GetMetricsResponse) GetUnit

func (x *GetMetricsResponse) GetUnit() string

func (*GetMetricsResponse) ProtoMessage

func (*GetMetricsResponse) ProtoMessage()

func (*GetMetricsResponse) ProtoReflect

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

func (*GetMetricsResponse) Reset

func (x *GetMetricsResponse) Reset()

func (*GetMetricsResponse) String

func (x *GetMetricsResponse) String() string

type GetMetricsResponseRecord

type GetMetricsResponseRecord struct {
	Timestamp int64  `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Value     string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

the value field is string that is serialized by json. {"cpu_usage": 0.1}

func (*GetMetricsResponseRecord) Descriptor deprecated

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

Deprecated: Use GetMetricsResponseRecord.ProtoReflect.Descriptor instead.

func (*GetMetricsResponseRecord) GetTimestamp

func (x *GetMetricsResponseRecord) GetTimestamp() int64

func (*GetMetricsResponseRecord) GetValue

func (x *GetMetricsResponseRecord) GetValue() string

func (*GetMetricsResponseRecord) ProtoMessage

func (*GetMetricsResponseRecord) ProtoMessage()

func (*GetMetricsResponseRecord) ProtoReflect

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

func (*GetMetricsResponseRecord) Reset

func (x *GetMetricsResponseRecord) Reset()

func (*GetMetricsResponseRecord) String

func (x *GetMetricsResponseRecord) String() string

type GetPluginNameRequest

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

func (*GetPluginNameRequest) Descriptor deprecated

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

Deprecated: Use GetPluginNameRequest.ProtoReflect.Descriptor instead.

func (*GetPluginNameRequest) ProtoMessage

func (*GetPluginNameRequest) ProtoMessage()

func (*GetPluginNameRequest) ProtoReflect

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

func (*GetPluginNameRequest) Reset

func (x *GetPluginNameRequest) Reset()

func (*GetPluginNameRequest) String

func (x *GetPluginNameRequest) String() string

type GetPluginNameResponse

type GetPluginNameResponse struct {
	Name string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Attr map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetPluginNameResponse) Descriptor deprecated

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

Deprecated: Use GetPluginNameResponse.ProtoReflect.Descriptor instead.

func (*GetPluginNameResponse) GetAttr

func (x *GetPluginNameResponse) GetAttr() map[string]string

func (*GetPluginNameResponse) GetName

func (x *GetPluginNameResponse) GetName() string

func (*GetPluginNameResponse) ProtoMessage

func (*GetPluginNameResponse) ProtoMessage()

func (*GetPluginNameResponse) ProtoReflect

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

func (*GetPluginNameResponse) Reset

func (x *GetPluginNameResponse) Reset()

func (*GetPluginNameResponse) String

func (x *GetPluginNameResponse) String() string

type MetricInfo

type MetricInfo struct {

	// cpu_usage
	MetricUnit  string   `protobuf:"bytes,1,opt,name=metric_unit,json=metricUnit,proto3" json:"metric_unit,omitempty"`
	Description string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Aggregation []string `protobuf:"bytes,3,rep,name=aggregation,proto3" json:"aggregation,omitempty"`
	// contains filtered or unexported fields
}

func (*MetricInfo) Descriptor deprecated

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

Deprecated: Use MetricInfo.ProtoReflect.Descriptor instead.

func (*MetricInfo) GetAggregation

func (x *MetricInfo) GetAggregation() []string

func (*MetricInfo) GetDescription

func (x *MetricInfo) GetDescription() string

func (*MetricInfo) GetMetricUnit

func (x *MetricInfo) GetMetricUnit() string

func (*MetricInfo) ProtoMessage

func (*MetricInfo) ProtoMessage()

func (*MetricInfo) ProtoReflect

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

func (*MetricInfo) Reset

func (x *MetricInfo) Reset()

func (*MetricInfo) String

func (x *MetricInfo) String() string

type PluginCapabilitiesRequest

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

func (*PluginCapabilitiesRequest) Descriptor deprecated

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

Deprecated: Use PluginCapabilitiesRequest.ProtoReflect.Descriptor instead.

func (*PluginCapabilitiesRequest) ProtoMessage

func (*PluginCapabilitiesRequest) ProtoMessage()

func (*PluginCapabilitiesRequest) ProtoReflect

func (*PluginCapabilitiesRequest) Reset

func (x *PluginCapabilitiesRequest) Reset()

func (*PluginCapabilitiesRequest) String

func (x *PluginCapabilitiesRequest) String() string

type PluginCapabilitiesResponse

type PluginCapabilitiesResponse struct {

	// {"cpu_usage": {"metric_unit":"c","aggregation": ["a","b"]}}
	MetricInfo map[string]*MetricInfo `` /* 179-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*PluginCapabilitiesResponse) Descriptor deprecated

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

Deprecated: Use PluginCapabilitiesResponse.ProtoReflect.Descriptor instead.

func (*PluginCapabilitiesResponse) GetMetricInfo

func (x *PluginCapabilitiesResponse) GetMetricInfo() map[string]*MetricInfo

func (*PluginCapabilitiesResponse) ProtoMessage

func (*PluginCapabilitiesResponse) ProtoMessage()

func (*PluginCapabilitiesResponse) ProtoReflect

func (*PluginCapabilitiesResponse) Reset

func (x *PluginCapabilitiesResponse) Reset()

func (*PluginCapabilitiesResponse) String

func (x *PluginCapabilitiesResponse) String() string

type ServerClient

type ServerClient interface {
	GetPluginName(ctx context.Context, in *GetPluginNameRequest, opts ...grpc.CallOption) (*GetPluginNameResponse, error)
	PluginCapabilities(ctx context.Context, in *PluginCapabilitiesRequest, opts ...grpc.CallOption) (*PluginCapabilitiesResponse, error)
	GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error)
}

ServerClient is the client API for Server 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 NewServerClient

func NewServerClient(cc grpc.ClientConnInterface) ServerClient

type ServerServer

type ServerServer interface {
	GetPluginName(context.Context, *GetPluginNameRequest) (*GetPluginNameResponse, error)
	PluginCapabilities(context.Context, *PluginCapabilitiesRequest) (*PluginCapabilitiesResponse, error)
	GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error)
	// contains filtered or unexported methods
}

ServerServer is the server API for Server service. All implementations must embed UnimplementedServerServer for forward compatibility

type UnimplementedServerServer

type UnimplementedServerServer struct {
}

UnimplementedServerServer must be embedded to have forward compatible implementations.

func (UnimplementedServerServer) GetMetrics

func (UnimplementedServerServer) GetPluginName

type UnsafeServerServer

type UnsafeServerServer interface {
	// contains filtered or unexported methods
}

UnsafeServerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServerServer will result in compilation errors.

Jump to

Keyboard shortcuts

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