node

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CondRemoteWrite = "Remote Write"
	CondRuleSync    = "Rule Sync"
	CondNodeDriver  = "Node Driver"
)
View Source
const (
	NodeConfiguration_GetDefaultNodeConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/GetDefaultNodeConfiguration"
	NodeConfiguration_SetDefaultNodeConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/SetDefaultNodeConfiguration"
	NodeConfiguration_GetNodeConfiguration_FullMethodName        = "/node.metrics.NodeConfiguration/GetNodeConfiguration"
	NodeConfiguration_SetNodeConfiguration_FullMethodName        = "/node.metrics.NodeConfiguration/SetNodeConfiguration"
)
View Source
const (
	NodeMetricsCapability_Sync_FullMethodName = "/node.metrics.NodeMetricsCapability/Sync"
)

Variables

View Source
var (
	ConfigStatus_name = map[int32]string{
		0: "Unknown",
		1: "UpToDate",
		2: "NeedsUpdate",
	}
	ConfigStatus_value = map[string]int32{
		"Unknown":     0,
		"UpToDate":    1,
		"NeedsUpdate": 2,
	}
)

Enum value maps for ConfigStatus.

View Source
var File_github_com_rancher_opni_plugins_metrics_apis_node_node_proto protoreflect.FileDescriptor
View Source
var NodeConfiguration_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "node.metrics.NodeConfiguration",
	HandlerType: (*NodeConfigurationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetDefaultNodeConfiguration",
			Handler:    _NodeConfiguration_GetDefaultNodeConfiguration_Handler,
		},
		{
			MethodName: "SetDefaultNodeConfiguration",
			Handler:    _NodeConfiguration_SetDefaultNodeConfiguration_Handler,
		},
		{
			MethodName: "GetNodeConfiguration",
			Handler:    _NodeConfiguration_GetNodeConfiguration_Handler,
		},
		{
			MethodName: "SetNodeConfiguration",
			Handler:    _NodeConfiguration_SetNodeConfiguration_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/metrics/apis/node/node.proto",
}

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

View Source
var NodeMetricsCapability_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "node.metrics.NodeMetricsCapability",
	HandlerType: (*NodeMetricsCapabilityServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sync",
			Handler:    _NodeMetricsCapability_Sync_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/metrics/apis/node/node.proto",
}

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

Functions

func CompatOTELStruct

func CompatOTELStruct(in *OTELSpec) *otel.OTELSpec

func DefaultConfigMetadata

func DefaultConfigMetadata() metadata.MD

func IsDefaultConfig

func IsDefaultConfig(trailer metadata.MD) bool

func RegisterNodeConfigurationServer

func RegisterNodeConfigurationServer(s grpc.ServiceRegistrar, srv NodeConfigurationServer)

func RegisterNodeMetricsCapabilityServer

func RegisterNodeMetricsCapabilityServer(s grpc.ServiceRegistrar, srv NodeMetricsCapabilityServer)

Types

type ConfigStatus

type ConfigStatus int32
const (
	ConfigStatus_Unknown     ConfigStatus = 0
	ConfigStatus_UpToDate    ConfigStatus = 1
	ConfigStatus_NeedsUpdate ConfigStatus = 2
)

func (ConfigStatus) Descriptor

func (ConfigStatus) Enum

func (x ConfigStatus) Enum() *ConfigStatus

func (ConfigStatus) EnumDescriptor deprecated

func (ConfigStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use ConfigStatus.Descriptor instead.

func (ConfigStatus) Number

func (ConfigStatus) String

func (x ConfigStatus) String() string

func (ConfigStatus) Type

type MetricsCapabilityConfig

type MetricsCapabilityConfig struct {
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// If enabled is false, conditions may contain a list of relevant status
	// messages describing why the capability is disabled.
	Conditions []string               `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"`
	Spec       *MetricsCapabilitySpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*MetricsCapabilityConfig) Descriptor deprecated

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

Deprecated: Use MetricsCapabilityConfig.ProtoReflect.Descriptor instead.

func (*MetricsCapabilityConfig) GetConditions

func (x *MetricsCapabilityConfig) GetConditions() []string

func (*MetricsCapabilityConfig) GetEnabled

func (x *MetricsCapabilityConfig) GetEnabled() bool

func (*MetricsCapabilityConfig) GetSpec

func (*MetricsCapabilityConfig) ProtoMessage

func (*MetricsCapabilityConfig) ProtoMessage()

func (*MetricsCapabilityConfig) ProtoReflect

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

func (*MetricsCapabilityConfig) Reset

func (x *MetricsCapabilityConfig) Reset()

func (*MetricsCapabilityConfig) String

func (x *MetricsCapabilityConfig) String() string

type MetricsCapabilitySpec

type MetricsCapabilitySpec struct {
	Rules *v1beta1.RulesSpec `protobuf:"bytes,1,opt,name=rules,proto3" json:"rules,omitempty"`
	// Types that are assignable to Driver:
	//
	//	*MetricsCapabilitySpec_Prometheus
	//	*MetricsCapabilitySpec_Otel
	Driver isMetricsCapabilitySpec_Driver `protobuf_oneof:"driver"`
	// contains filtered or unexported fields
}

func (*MetricsCapabilitySpec) Descriptor deprecated

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

Deprecated: Use MetricsCapabilitySpec.ProtoReflect.Descriptor instead.

func (*MetricsCapabilitySpec) GetDriver

func (m *MetricsCapabilitySpec) GetDriver() isMetricsCapabilitySpec_Driver

func (*MetricsCapabilitySpec) GetOtel

func (x *MetricsCapabilitySpec) GetOtel() *OTELSpec

func (*MetricsCapabilitySpec) GetPrometheus

func (x *MetricsCapabilitySpec) GetPrometheus() *PrometheusSpec

func (*MetricsCapabilitySpec) GetRules

func (x *MetricsCapabilitySpec) GetRules() *v1beta1.RulesSpec

func (*MetricsCapabilitySpec) ProtoMessage

func (*MetricsCapabilitySpec) ProtoMessage()

func (*MetricsCapabilitySpec) ProtoReflect

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

func (*MetricsCapabilitySpec) Reset

func (x *MetricsCapabilitySpec) Reset()

func (*MetricsCapabilitySpec) RuleDiscoveryEnabled

func (m *MetricsCapabilitySpec) RuleDiscoveryEnabled() bool

func (*MetricsCapabilitySpec) String

func (x *MetricsCapabilitySpec) String() string

func (*MetricsCapabilitySpec) Validate

func (m *MetricsCapabilitySpec) Validate() error

type MetricsCapabilitySpec_Otel

type MetricsCapabilitySpec_Otel struct {
	Otel *OTELSpec `protobuf:"bytes,3,opt,name=otel,proto3,oneof"`
}

type MetricsCapabilitySpec_Prometheus

type MetricsCapabilitySpec_Prometheus struct {
	Prometheus *PrometheusSpec `protobuf:"bytes,2,opt,name=prometheus,proto3,oneof"`
}

type NodeConfigRequest

type NodeConfigRequest struct {
	Node *v1.Reference `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// Can be set to nil to use the default configuration for this node.
	Spec *MetricsCapabilitySpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeConfigRequest) Descriptor deprecated

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

Deprecated: Use NodeConfigRequest.ProtoReflect.Descriptor instead.

func (*NodeConfigRequest) GetNode

func (x *NodeConfigRequest) GetNode() *v1.Reference

func (*NodeConfigRequest) GetSpec

func (*NodeConfigRequest) ProtoMessage

func (*NodeConfigRequest) ProtoMessage()

func (*NodeConfigRequest) ProtoReflect

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

func (*NodeConfigRequest) Reset

func (x *NodeConfigRequest) Reset()

func (*NodeConfigRequest) String

func (x *NodeConfigRequest) String() string

type NodeConfigurationClient

type NodeConfigurationClient interface {
	GetDefaultNodeConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsCapabilitySpec, error)
	SetDefaultNodeConfiguration(ctx context.Context, in *MetricsCapabilitySpec, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetNodeConfiguration(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*MetricsCapabilitySpec, error)
	SetNodeConfiguration(ctx context.Context, in *NodeConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

NodeConfigurationClient is the client API for NodeConfiguration 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 NodeConfigurationServer

type NodeConfigurationServer interface {
	GetDefaultNodeConfiguration(context.Context, *emptypb.Empty) (*MetricsCapabilitySpec, error)
	SetDefaultNodeConfiguration(context.Context, *MetricsCapabilitySpec) (*emptypb.Empty, error)
	GetNodeConfiguration(context.Context, *v1.Reference) (*MetricsCapabilitySpec, error)
	SetNodeConfiguration(context.Context, *NodeConfigRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

NodeConfigurationServer is the server API for NodeConfiguration service. All implementations must embed UnimplementedNodeConfigurationServer for forward compatibility

type NodeMetricsCapabilityClient

type NodeMetricsCapabilityClient interface {
	Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
}

NodeMetricsCapabilityClient is the client API for NodeMetricsCapability 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 NodeMetricsCapabilityServer

type NodeMetricsCapabilityServer interface {
	Sync(context.Context, *SyncRequest) (*SyncResponse, error)
	// contains filtered or unexported methods
}

NodeMetricsCapabilityServer is the server API for NodeMetricsCapability service. All implementations must embed UnimplementedNodeMetricsCapabilityServer for forward compatibility

type OTELSpec

type OTELSpec struct {
	AdditionalScrapeConfigs []*ScrapeConfig `protobuf:"bytes,1,rep,name=additionalScrapeConfigs,proto3" json:"additionalScrapeConfigs,omitempty"`
	Wal                     *WALConfig      `protobuf:"bytes,2,opt,name=wal,proto3" json:"wal,omitempty"`
	HostMetrics             *bool           `protobuf:"varint,3,opt,name=hostMetrics,proto3,oneof" json:"hostMetrics,omitempty"`
	// contains filtered or unexported fields
}

func (*OTELSpec) DeepCopyInto

func (in *OTELSpec) DeepCopyInto(out *OTELSpec)

func (*OTELSpec) Descriptor deprecated

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

Deprecated: Use OTELSpec.ProtoReflect.Descriptor instead.

func (*OTELSpec) GetAdditionalScrapeConfigs

func (x *OTELSpec) GetAdditionalScrapeConfigs() []*ScrapeConfig

func (*OTELSpec) GetHostMetrics

func (x *OTELSpec) GetHostMetrics() bool

func (*OTELSpec) GetWal

func (x *OTELSpec) GetWal() *WALConfig

func (*OTELSpec) ProtoMessage

func (*OTELSpec) ProtoMessage()

func (*OTELSpec) ProtoReflect

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

func (*OTELSpec) Reset

func (x *OTELSpec) Reset()

func (*OTELSpec) String

func (x *OTELSpec) String() string

func (*OTELSpec) Validate

func (o *OTELSpec) Validate() error

type PrometheusSpec

type PrometheusSpec struct {

	// default: quay.io/prometheus/prometheus:latest
	Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
	// can be one of: ["externalPromOperator"]
	DeploymentStrategy string `protobuf:"bytes,2,opt,name=deploymentStrategy,proto3" json:"deploymentStrategy,omitempty"`
	// contains filtered or unexported fields
}

func (*PrometheusSpec) Descriptor deprecated

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

Deprecated: Use PrometheusSpec.ProtoReflect.Descriptor instead.

func (*PrometheusSpec) GetDeploymentStrategy

func (x *PrometheusSpec) GetDeploymentStrategy() string

func (*PrometheusSpec) GetImage

func (x *PrometheusSpec) GetImage() string

func (*PrometheusSpec) ProtoMessage

func (*PrometheusSpec) ProtoMessage()

func (*PrometheusSpec) ProtoReflect

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

func (*PrometheusSpec) Reset

func (x *PrometheusSpec) Reset()

func (*PrometheusSpec) String

func (x *PrometheusSpec) String() string

type ScrapeConfig

type ScrapeConfig struct {
	JobName        string   `protobuf:"bytes,1,opt,name=jobName,proto3" json:"jobName,omitempty"`
	Targets        []string `protobuf:"bytes,2,rep,name=targets,proto3" json:"targets,omitempty"`
	ScrapeInterval string   `protobuf:"bytes,3,opt,name=scrapeInterval,proto3" json:"scrapeInterval,omitempty"`
	// contains filtered or unexported fields
}

func (*ScrapeConfig) Descriptor deprecated

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

Deprecated: Use ScrapeConfig.ProtoReflect.Descriptor instead.

func (*ScrapeConfig) GetJobName

func (x *ScrapeConfig) GetJobName() string

func (*ScrapeConfig) GetScrapeInterval

func (x *ScrapeConfig) GetScrapeInterval() string

func (*ScrapeConfig) GetTargets

func (x *ScrapeConfig) GetTargets() []string

func (*ScrapeConfig) ProtoMessage

func (*ScrapeConfig) ProtoMessage()

func (*ScrapeConfig) ProtoReflect

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

func (*ScrapeConfig) Reset

func (x *ScrapeConfig) Reset()

func (*ScrapeConfig) String

func (x *ScrapeConfig) String() string

func (*ScrapeConfig) Validate

func (s *ScrapeConfig) Validate() error

type SyncRequest

type SyncRequest struct {
	CurrentConfig *MetricsCapabilityConfig `protobuf:"bytes,1,opt,name=currentConfig,proto3" json:"currentConfig,omitempty"`
	// contains filtered or unexported fields
}

func (*SyncRequest) Descriptor deprecated

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

Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.

func (*SyncRequest) GetCurrentConfig

func (x *SyncRequest) GetCurrentConfig() *MetricsCapabilityConfig

func (*SyncRequest) ProtoMessage

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) ProtoReflect

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

func (*SyncRequest) Reset

func (x *SyncRequest) Reset()

func (*SyncRequest) String

func (x *SyncRequest) String() string

func (*SyncRequest) Validate

func (s *SyncRequest) Validate() error

type SyncResponse

type SyncResponse struct {
	ConfigStatus  ConfigStatus             `protobuf:"varint,1,opt,name=configStatus,proto3,enum=node.metrics.ConfigStatus" json:"configStatus,omitempty"`
	UpdatedConfig *MetricsCapabilityConfig `protobuf:"bytes,2,opt,name=updatedConfig,proto3" json:"updatedConfig,omitempty"`
	// contains filtered or unexported fields
}

func (*SyncResponse) Descriptor deprecated

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

Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.

func (*SyncResponse) GetConfigStatus

func (x *SyncResponse) GetConfigStatus() ConfigStatus

func (*SyncResponse) GetUpdatedConfig

func (x *SyncResponse) GetUpdatedConfig() *MetricsCapabilityConfig

func (*SyncResponse) ProtoMessage

func (*SyncResponse) ProtoMessage()

func (*SyncResponse) ProtoReflect

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

func (*SyncResponse) Reset

func (x *SyncResponse) Reset()

func (*SyncResponse) String

func (x *SyncResponse) String() string

type UnimplementedNodeConfigurationServer

type UnimplementedNodeConfigurationServer struct {
}

UnimplementedNodeConfigurationServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeConfigurationServer) GetDefaultNodeConfiguration added in v0.12.0

func (UnimplementedNodeConfigurationServer) GetNodeConfiguration

func (UnimplementedNodeConfigurationServer) SetDefaultNodeConfiguration added in v0.12.0

func (UnimplementedNodeConfigurationServer) SetNodeConfiguration

type UnimplementedNodeMetricsCapabilityServer

type UnimplementedNodeMetricsCapabilityServer struct {
}

UnimplementedNodeMetricsCapabilityServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeMetricsCapabilityServer) Sync

type UnsafeNodeConfigurationServer

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

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

type UnsafeNodeMetricsCapabilityServer

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

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

type WALConfig

type WALConfig struct {
	Enabled           bool                 `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	BufferSize        int64                `protobuf:"varint,2,opt,name=bufferSize,proto3" json:"bufferSize,omitempty"`
	TruncateFrequency *durationpb.Duration `protobuf:"bytes,3,opt,name=truncateFrequency,proto3" json:"truncateFrequency,omitempty"`
	// contains filtered or unexported fields
}

func (*WALConfig) Descriptor deprecated

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

Deprecated: Use WALConfig.ProtoReflect.Descriptor instead.

func (*WALConfig) GetBufferSize

func (x *WALConfig) GetBufferSize() int64

func (*WALConfig) GetEnabled

func (x *WALConfig) GetEnabled() bool

func (*WALConfig) GetTruncateFrequency

func (x *WALConfig) GetTruncateFrequency() *durationpb.Duration

func (*WALConfig) ProtoMessage

func (*WALConfig) ProtoMessage()

func (*WALConfig) ProtoReflect

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

func (*WALConfig) Reset

func (x *WALConfig) Reset()

func (*WALConfig) String

func (x *WALConfig) String() string

func (*WALConfig) Validate

func (w *WALConfig) Validate() error

Jump to

Keyboard shortcuts

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