From ef495565240f4b46795d9e82e66b30e98c160c2d Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Tue, 13 Dec 2022 17:11:52 -0500 Subject: [PATCH 01/43] add cli commands --- pkg/opni/commands/import.go | 263 ++++++++++++++++++++++++++++++ pkg/opni/commands/setup_import.go | 38 +++++ 2 files changed, 301 insertions(+) create mode 100644 pkg/opni/commands/import.go create mode 100644 pkg/opni/commands/setup_import.go diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go new file mode 100644 index 0000000000..7e7c4299e9 --- /dev/null +++ b/pkg/opni/commands/import.go @@ -0,0 +1,263 @@ +package commands + +import ( + "fmt" + cliutil "github.com/rancher/opni/pkg/opni/util" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/spf13/cobra" + "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/timestamppb" + "strings" + "time" +) + +func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { + if strings.Contains(s, "!~") { + split := strings.SplitN(s, "!~", 2) + + return &remoteread.LabelMatcher{ + Type: remoteread.LabelMatcher_NOT_REGEX_EQUAL, + Name: split[0], + Value: split[1], + }, nil + } else if strings.Contains(s, "=~") { + split := strings.SplitN(s, "=~", 2) + + return &remoteread.LabelMatcher{ + Type: remoteread.LabelMatcher_REGEX_EQUAL, + Name: split[0], + Value: split[1], + }, nil + } else if strings.Contains(s, "!=") { + split := strings.SplitN(s, "!=", 2) + + return &remoteread.LabelMatcher{ + Type: remoteread.LabelMatcher_NOT_EQUAL, + Name: split[0], + Value: split[1], + }, nil + } else if strings.Contains(s, "=") { + split := strings.SplitN(s, "=", 2) + + return &remoteread.LabelMatcher{ + Type: remoteread.LabelMatcher_EQUAL, + Name: split[0], + Value: split[1], + }, nil + } + + return &remoteread.LabelMatcher{}, fmt.Errorf("label matcher must contain one of =, !=, =~, or !~") +} + +func BuildImportTargetAddCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "add [name]", + Short: "Add a new target", + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) error { + var target *remoteread.Target + + switch len(args) { + case 1: + target = &remoteread.Target{ + Name: args[0], + Endpoint: args[0], + } + case 2: + // todo: might be worthwhile pulling just the hostname from the given endpoint + target = &remoteread.Target{ + Name: args[1], + Endpoint: args[0], + } + } + + request := &remoteread.TargetAddRequest{ + Target: target, + } + + _, err := remoteReadClient.AddTarget(cmd.Context(), request) + + if err != nil { + return err + } + + lg.Infof("target added") + return nil + }, + } + + return cmd +} + +func BuildImportTargetEditCmd() *cobra.Command { + var newEndpoint string + var newName string + + cmd := &cobra.Command{ + Use: "edit", + Short: "Edit an existing target", + RunE: func(cmd *cobra.Command, args []string) error { + if newEndpoint == "" && newName == "" { + lg.Infof("no edits specified, doing nothing") + } + + request := &remoteread.TargetEditRequest{TargetDiff: &remoteread.TargetDiff{ + Endpoint: newEndpoint, + Name: newName, + }} + + _, err := remoteReadClient.EditTarget(cmd.Context(), request) + + if err != nil { + return err + } + + lg.Infof("target edited") + return nil + }, + } + + cmd.Flags().StringVar(&newEndpoint, "endpoint", "", "the new endpoint for the target") + + cmd.Flags().StringVar(&newName, "name", "", "the new name for the target") + + return cmd +} + +func BuildImportTargetRemoveCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove ", + Short: "Remove a target", + Aliases: []string{"rm"}, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + request := &remoteread.TargetRemoveRequest{TargetName: args[0]} + + _, err := remoteReadClient.RemoveTarget(cmd.Context(), request) + + if err != nil { + return err + } + + lg.Infof("target removed") + return nil + }, + } + + return cmd +} + +func BuildImportTargetListCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "List available targets", + Aliases: []string{"ls"}, + RunE: func(cmd *cobra.Command, args []string) error { + targetList, err := remoteReadClient.ListTargets(cmd.Context(), &emptypb.Empty{}) + if err != nil { + return err + } + + fmt.Println(cliutil.RenderTargetList(targetList)) + + return nil + }, + } + + return cmd +} + +func BuildImportTargetCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "target", + Short: "target", + Aliases: []string{"targets"}, + } + + // todo: scan && describe + cmd.AddCommand(BuildImportTargetAddCmd()) + cmd.AddCommand(BuildImportTargetEditCmd()) + cmd.AddCommand(BuildImportTargetRemoveCmd()) + cmd.AddCommand(BuildImportTargetListCmd()) + + return cmd +} + +func BuildImportStartCmd() *cobra.Command { + var labelFilters []string + var startTimestamp int64 + var endTimestamp int64 + var clusterId string + var forceOverlap bool + + cmd := &cobra.Command{ + Use: "start", + Short: "start", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + targetName := args[0] + labelMatchers := make([]*remoteread.LabelMatcher, len(labelFilters)) + + for _, labelFilter := range labelFilters { + matcher, err := parseLabelMatcher(labelFilter) + + if err != nil { + return fmt.Errorf("filter '%s' is not valid: %w", labelFilter, err) + } + + labelMatchers = append(labelMatchers, matcher) + } + + query := &remoteread.Query{ + StartTimestamp: ×tamppb.Timestamp{Seconds: startTimestamp}, + EndTimestamp: ×tamppb.Timestamp{Seconds: endTimestamp}, + Matcher: labelMatchers, + } + + request := &remoteread.StartReadRequest{ + TargetName: targetName, + Query: query, + ForceOverlap: forceOverlap, + } + + if _, err := remoteReadClient.Start(cmd.Context(), request); err != nil { + return err + } + + lg.Infof("import started") + + return nil + }, + } + + cmd.Flags().StringVar(&clusterId, "cluster", "", "the id of the cluster") + + cmd.Flags().StringSliceVar(&labelFilters, "filters", []string{"__name__=~\".+\""}, "promql query for the thing") + + // todo: we probably want to allow for more human readable timestamps here + cmd.Flags().Int64Var(&startTimestamp, "start", 0, "start time for the remote read") + cmd.Flags().Int64Var(&endTimestamp, "end", time.Now().Unix(), "start time for the remote read") + + cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") + + ConfigureImportCommand(cmd) + + return cmd +} + +func BuildImportCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "import", + Short: "Interact with metrics import plugin APIs", + } + + cmd.AddCommand(BuildImportTargetCmd()) + cmd.AddCommand(BuildImportStartCmd()) + cmd.AddCommand(BuildImportTargetCmd()) + + return cmd +} + +func init() { + AddCommandsToGroup(PluginAPIs, BuildImportCmd()) +} diff --git a/pkg/opni/commands/setup_import.go b/pkg/opni/commands/setup_import.go new file mode 100644 index 0000000000..8dbd924150 --- /dev/null +++ b/pkg/opni/commands/setup_import.go @@ -0,0 +1,38 @@ +package commands + +import ( + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/spf13/cobra" +) + +var remoteReadClient remoteread.RemoteReadClient + +func ConfigureImportCommand(cmd *cobra.Command) { + if cmd.PersistentPreRunE == nil { + cmd.PersistentPostRunE = importPreRunE + } else { + oldPreRunE := cmd.PersistentPreRunE + cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error { + if err := oldPreRunE(cmd, args); err != nil { + return err + } + + return importPreRunE(cmd, args) + } + } +} + +func importPreRunE(cmd *cobra.Command, args []string) error { + if managementListenAddress == "" { + panic("bug: managementListenAddress is empty") + } + + client, err := remoteread.NewClient(cmd.Context(), remoteread.WithListenAddress("")) + if err != nil { + return err + } + + remoteReadClient = client + + return nil +} From 1b70c74c95eee9b49ec59e030fa7bb8d34f31068 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:27:12 -0500 Subject: [PATCH 02/43] basic target path impl --- pkg/opni/util/render_cortex.go | 14 + plugins/metrics/pkg/apis/remoteread/client.go | 69 + .../pkg/apis/remoteread/remoteread.pb.go | 1167 +++++++++++++++++ .../pkg/apis/remoteread/remoteread.pb.gw.go | 173 +++ .../pkg/apis/remoteread/remoteread.proto | 98 ++ .../pkg/apis/remoteread/remoteread_grpc.pb.go | 288 ++++ plugins/metrics/pkg/apis/remoteread/server.go | 118 ++ plugins/metrics/pkg/gateway/plugin.go | 4 +- plugins/metrics/pkg/gateway/remoteread.go | 20 + 9 files changed, 1948 insertions(+), 3 deletions(-) create mode 100644 plugins/metrics/pkg/apis/remoteread/client.go create mode 100644 plugins/metrics/pkg/apis/remoteread/remoteread.pb.go create mode 100644 plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go create mode 100644 plugins/metrics/pkg/apis/remoteread/remoteread.proto create mode 100644 plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go create mode 100644 plugins/metrics/pkg/apis/remoteread/server.go create mode 100644 plugins/metrics/pkg/gateway/remoteread.go diff --git a/pkg/opni/util/render_cortex.go b/pkg/opni/util/render_cortex.go index 7db0385d4b..90259d8e50 100644 --- a/pkg/opni/util/render_cortex.go +++ b/pkg/opni/util/render_cortex.go @@ -4,6 +4,7 @@ package cliutil import ( "fmt" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "strings" "github.com/jedib0t/go-pretty/v6/table" @@ -202,3 +203,16 @@ func servicesByName[T interface { } return services } + +func RenderTargetList(list *remoteread.TargetList) string { + writer := table.NewWriter() + writer.SetStyle(table.StyleColoredDark) + writer.AppendHeader(table.Row{"NAME", "ENDPOINT", "LAST READ"}) + + for _, target := range list.Targets { + row := table.Row{target.Name, target.Endpoint, target.Meta.LastReadTimestamp} + writer.AppendRow(row) + } + + return writer.Render() +} diff --git a/plugins/metrics/pkg/apis/remoteread/client.go b/plugins/metrics/pkg/apis/remoteread/client.go new file mode 100644 index 0000000000..71519724eb --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/client.go @@ -0,0 +1,69 @@ +package remoteread + +import ( + "fmt" + "github.com/rancher/opni/pkg/util/waitctx" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type ClientOptions struct { + listenAddr string + dialOptions []grpc.DialOption + + //clients.Locker[remotewrite.RemoteWriteClient] + remoteWriteClient remotewrite.RemoteWriteClient +} + +type ClientOption func(*ClientOptions) + +func (opt *ClientOptions) apply(opts ...ClientOption) { + for _, op := range opts { + op(opt) + } +} + +func WithListenAddress(addr string) ClientOption { + return func(opt *ClientOptions) { + opt.listenAddr = addr + } +} + +func WithDialOptions(options ...grpc.DialOption) ClientOption { + return func(opt *ClientOptions) { + opt.dialOptions = append(opt.dialOptions, options...) + } +} + +func WithRemoteWriteClient(client remotewrite.RemoteWriteClient) ClientOption { + return func(opt *ClientOptions) { + opt.remoteWriteClient = client + } +} + +func NewClient(ctx waitctx.PermissiveContext, opts ...ClientOption) (RemoteReadClient, error) { + // todo: figure out remote read gateway address + options := ClientOptions{ + dialOptions: []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithChainStreamInterceptor(otelgrpc.StreamClientInterceptor()), + grpc.WithChainUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), + }, + } + + options.apply(opts...) + + connection, err := grpc.DialContext(ctx, options.listenAddr, options.dialOptions...) + if err != nil { + return nil, fmt.Errorf("could not establish connection: %w", err) + } + + waitctx.Permissive.Go(ctx, func() { + <-ctx.Done() + connection.Close() + }) + + return NewRemoteReadClient(connection), nil +} diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go new file mode 100644 index 0000000000..5753561b88 --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -0,0 +1,1167 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1-devel +// protoc v1.0.0 +// source: github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto + +package remoteread + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LabelMatcher_Type int32 + +const ( + LabelMatcher_EQUAL LabelMatcher_Type = 0 + LabelMatcher_NOT_EQUAL LabelMatcher_Type = 1 + LabelMatcher_REGEX_EQUAL LabelMatcher_Type = 2 + LabelMatcher_NOT_REGEX_EQUAL LabelMatcher_Type = 3 +) + +// Enum value maps for LabelMatcher_Type. +var ( + LabelMatcher_Type_name = map[int32]string{ + 0: "EQUAL", + 1: "NOT_EQUAL", + 2: "REGEX_EQUAL", + 3: "NOT_REGEX_EQUAL", + } + LabelMatcher_Type_value = map[string]int32{ + "EQUAL": 0, + "NOT_EQUAL": 1, + "REGEX_EQUAL": 2, + "NOT_REGEX_EQUAL": 3, + } +) + +func (x LabelMatcher_Type) Enum() *LabelMatcher_Type { + p := new(LabelMatcher_Type) + *p = x + return p +} + +func (x LabelMatcher_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0].Descriptor() +} + +func (LabelMatcher_Type) Type() protoreflect.EnumType { + return &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0] +} + +func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LabelMatcher_Type.Descriptor instead. +func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11, 0} +} + +type Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Meta *TargetMetadata `protobuf:"bytes,3,opt,name=meta,proto3" json:"meta,omitempty"` +} + +func (x *Target) Reset() { + *x = Target{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Target) ProtoMessage() {} + +func (x *Target) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Target.ProtoReflect.Descriptor instead. +func (*Target) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{0} +} + +func (x *Target) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Target) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Target) GetMeta() *TargetMetadata { + if x != nil { + return x.Meta + } + return nil +} + +type TargetMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` +} + +func (x *TargetMetadata) Reset() { + *x = TargetMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetMetadata) ProtoMessage() {} + +func (x *TargetMetadata) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetMetadata.ProtoReflect.Descriptor instead. +func (*TargetMetadata) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{1} +} + +func (x *TargetMetadata) GetLastReadTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.LastReadTimestamp + } + return nil +} + +type TargetDiff struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *TargetDiff) Reset() { + *x = TargetDiff{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetDiff) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetDiff) ProtoMessage() {} + +func (x *TargetDiff) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetDiff.ProtoReflect.Descriptor instead. +func (*TargetDiff) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2} +} + +func (x *TargetDiff) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *TargetDiff) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type TargetList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Targets []*Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *TargetList) Reset() { + *x = TargetList{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetList) ProtoMessage() {} + +func (x *TargetList) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetList.ProtoReflect.Descriptor instead. +func (*TargetList) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{3} +} + +func (x *TargetList) GetTargets() []*Target { + if x != nil { + return x.Targets + } + return nil +} + +type TargetAddRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *TargetAddRequest) Reset() { + *x = TargetAddRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetAddRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetAddRequest) ProtoMessage() {} + +func (x *TargetAddRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetAddRequest.ProtoReflect.Descriptor instead. +func (*TargetAddRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{4} +} + +func (x *TargetAddRequest) GetTarget() *Target { + if x != nil { + return x.Target + } + return nil +} + +type TargetEditRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + TargetDiff *TargetDiff `protobuf:"bytes,2,opt,name=targetDiff,proto3" json:"targetDiff,omitempty"` +} + +func (x *TargetEditRequest) Reset() { + *x = TargetEditRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetEditRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetEditRequest) ProtoMessage() {} + +func (x *TargetEditRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetEditRequest.ProtoReflect.Descriptor instead. +func (*TargetEditRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{5} +} + +func (x *TargetEditRequest) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +func (x *TargetEditRequest) GetTargetDiff() *TargetDiff { + if x != nil { + return x.TargetDiff + } + return nil +} + +type TargetRemoveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` +} + +func (x *TargetRemoveRequest) Reset() { + *x = TargetRemoveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetRemoveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetRemoveRequest) ProtoMessage() {} + +func (x *TargetRemoveRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetRemoveRequest.ProtoReflect.Descriptor instead. +func (*TargetRemoveRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{6} +} + +func (x *TargetRemoveRequest) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +type StartReadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp + ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` +} + +func (x *StartReadRequest) Reset() { + *x = StartReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartReadRequest) ProtoMessage() {} + +func (x *StartReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartReadRequest.ProtoReflect.Descriptor instead. +func (*StartReadRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} +} + +func (x *StartReadRequest) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +func (x *StartReadRequest) GetQuery() *Query { + if x != nil { + return x.Query + } + return nil +} + +func (x *StartReadRequest) GetForceOverlap() bool { + if x != nil { + return x.ForceOverlap + } + return false +} + +type ProgressRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` +} + +func (x *ProgressRequest) Reset() { + *x = ProgressRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProgressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProgressRequest) ProtoMessage() {} + +func (x *ProgressRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProgressRequest.ProtoReflect.Descriptor instead. +func (*ProgressRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} +} + +func (x *ProgressRequest) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +type StopReadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` +} + +func (x *StopReadRequest) Reset() { + *x = StopReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopReadRequest) ProtoMessage() {} + +func (x *StopReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopReadRequest.ProtoReflect.Descriptor instead. +func (*StopReadRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{9} +} + +func (x *StopReadRequest) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +// PromQL query +type Query struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` + EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` + Matcher []*LabelMatcher `protobuf:"bytes,3,rep,name=matcher,proto3" json:"matcher,omitempty"` +} + +func (x *Query) Reset() { + *x = Query{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Query) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Query) ProtoMessage() {} + +func (x *Query) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Query.ProtoReflect.Descriptor instead. +func (*Query) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} +} + +func (x *Query) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp + } + return nil +} + +func (x *Query) GetEndTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.EndTimestamp + } + return nil +} + +func (x *Query) GetMatcher() []*LabelMatcher { + if x != nil { + return x.Matcher + } + return nil +} + +type LabelMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=remoteread.LabelMatcher_Type" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *LabelMatcher) Reset() { + *x = LabelMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LabelMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LabelMatcher) ProtoMessage() {} + +func (x *LabelMatcher) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. +func (*LabelMatcher) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11} +} + +func (x *LabelMatcher) GetType() LabelMatcher_Type { + if x != nil { + return x.Type + } + return LabelMatcher_EQUAL +} + +func (x *LabelMatcher) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LabelMatcher) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Progress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` + EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` + PercentDone float32 `protobuf:"fixed32,3,opt,name=percentDone,proto3" json:"percentDone,omitempty"` +} + +func (x *Progress) Reset() { + *x = Progress{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Progress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Progress) ProtoMessage() {} + +func (x *Progress) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Progress.ProtoReflect.Descriptor instead. +func (*Progress) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} +} + +func (x *Progress) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp + } + return nil +} + +func (x *Progress) GetEndTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.EndTimestamp + } + return nil +} + +func (x *Progress) GetPercentDone() float32 { + if x != nil { + return x.PercentDone + } + return 0 +} + +var File_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto protoreflect.FileDescriptor + +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc = []byte{ + 0x0a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, + 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2f, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, + 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x5a, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, + 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, + 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x3e, 0x0a, + 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x6b, 0x0a, + 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x35, 0x0a, 0x13, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x7f, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, + 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, + 0x61, 0x70, 0x22, 0x31, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0xb3, 0x01, 0x0a, 0x0c, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, + 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, + 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4e, + 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, + 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, + 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, + 0x6f, 0x6e, 0x65, 0x32, 0x8c, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, + 0x61, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, + 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, + 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescOnce sync.Once + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescData = file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc +) + +func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP() []byte { + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescOnce.Do(func() { + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescData) + }) + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescData +} + +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = []interface{}{ + (LabelMatcher_Type)(0), // 0: remoteread.LabelMatcher.Type + (*Target)(nil), // 1: remoteread.Target + (*TargetMetadata)(nil), // 2: remoteread.TargetMetadata + (*TargetDiff)(nil), // 3: remoteread.TargetDiff + (*TargetList)(nil), // 4: remoteread.TargetList + (*TargetAddRequest)(nil), // 5: remoteread.TargetAddRequest + (*TargetEditRequest)(nil), // 6: remoteread.TargetEditRequest + (*TargetRemoveRequest)(nil), // 7: remoteread.TargetRemoveRequest + (*StartReadRequest)(nil), // 8: remoteread.StartReadRequest + (*ProgressRequest)(nil), // 9: remoteread.ProgressRequest + (*StopReadRequest)(nil), // 10: remoteread.StopReadRequest + (*Query)(nil), // 11: remoteread.Query + (*LabelMatcher)(nil), // 12: remoteread.LabelMatcher + (*Progress)(nil), // 13: remoteread.Progress + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty +} +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = []int32{ + 2, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMetadata + 14, // 1: remoteread.TargetMetadata.lastReadTimestamp:type_name -> google.protobuf.Timestamp + 1, // 2: remoteread.TargetList.targets:type_name -> remoteread.Target + 1, // 3: remoteread.TargetAddRequest.target:type_name -> remoteread.Target + 3, // 4: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff + 11, // 5: remoteread.StartReadRequest.query:type_name -> remoteread.Query + 14, // 6: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp + 14, // 7: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp + 12, // 8: remoteread.Query.matcher:type_name -> remoteread.LabelMatcher + 0, // 9: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type + 14, // 10: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp + 14, // 11: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp + 5, // 12: remoteread.RemoteRead.AddTarget:input_type -> remoteread.TargetAddRequest + 6, // 13: remoteread.RemoteRead.EditTarget:input_type -> remoteread.TargetEditRequest + 7, // 14: remoteread.RemoteRead.RemoveTarget:input_type -> remoteread.TargetRemoveRequest + 15, // 15: remoteread.RemoteRead.ListTargets:input_type -> google.protobuf.Empty + 8, // 16: remoteread.RemoteRead.Start:input_type -> remoteread.StartReadRequest + 10, // 17: remoteread.RemoteRead.Stop:input_type -> remoteread.StopReadRequest + 1, // 18: remoteread.RemoteRead.AddTarget:output_type -> remoteread.Target + 1, // 19: remoteread.RemoteRead.EditTarget:output_type -> remoteread.Target + 1, // 20: remoteread.RemoteRead.RemoveTarget:output_type -> remoteread.Target + 4, // 21: remoteread.RemoteRead.ListTargets:output_type -> remoteread.TargetList + 15, // 22: remoteread.RemoteRead.Start:output_type -> google.protobuf.Empty + 15, // 23: remoteread.RemoteRead.Stop:output_type -> google.protobuf.Empty + 18, // [18:24] is the sub-list for method output_type + 12, // [12:18] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() } +func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() { + if File_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetDiff); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetAddRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetEditRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetRemoveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProgressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Progress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc, + NumEnums: 1, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes, + DependencyIndexes: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs, + EnumInfos: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes, + MessageInfos: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes, + }.Build() + File_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto = out.File + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc = nil + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = nil + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = nil +} diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go new file mode 100644 index 0000000000..ccebb8bf06 --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto + +/* +Package remoteread is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package remoteread + +import ( + "context" + "io" + "net/http" + + "github.com/kralicky/grpc-gateway/v2/runtime" + "github.com/kralicky/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +var ( + filter_RemoteRead_AddTarget_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RemoteRead_AddTarget_0(ctx context.Context, marshaler runtime.Marshaler, client RemoteReadClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TargetAddRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RemoteRead_AddTarget_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddTarget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RemoteRead_AddTarget_0(ctx context.Context, marshaler runtime.Marshaler, server RemoteReadServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TargetAddRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RemoteRead_AddTarget_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddTarget(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterRemoteReadHandlerServer registers the http handlers for service RemoteRead to "mux". +// UnaryRPC :call RemoteReadServer 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 RegisterRemoteReadHandlerFromEndpoint instead. +func RegisterRemoteReadHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RemoteReadServer) error { + + mux.Handle("GET", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/metrics/remoteread/target/add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RemoteRead_AddTarget_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RemoteRead_AddTarget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRemoteReadHandlerFromEndpoint is same as RegisterRemoteReadHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRemoteReadHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRemoteReadHandler(ctx, mux, conn) +} + +// RegisterRemoteReadHandler registers the http handlers for service RemoteRead to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRemoteReadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRemoteReadHandlerClient(ctx, mux, NewRemoteReadClient(conn)) +} + +// RegisterRemoteReadHandlerClient registers the http handlers for service RemoteRead +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RemoteReadClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RemoteReadClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RemoteReadClient" to call the correct interceptors. +func RegisterRemoteReadHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RemoteReadClient) error { + + mux.Handle("GET", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/metrics/remoteread/target/add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RemoteRead_AddTarget_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RemoteRead_AddTarget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RemoteRead_AddTarget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"metrics", "remoteread", "target", "add"}, "")) +) + +var ( + forward_RemoteRead_AddTarget_0 = runtime.ForwardResponseMessage +) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto new file mode 100644 index 0000000000..ab2a67b7af --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +option go_package = "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/api/http.proto"; +import "google/api/annotations.proto"; + +package remoteread; + +service RemoteRead { + // todo: we probably need a new type for Describe and ScanFor +// rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); +// rpc Describe(Target) returns (Target); + + rpc AddTarget(TargetAddRequest) returns (Target); + rpc EditTarget(TargetEditRequest) returns (Target); + rpc RemoveTarget(TargetRemoveRequest) returns (Target); + rpc ListTargets(google.protobuf.Empty) returns (TargetList); + rpc Start(StartReadRequest) returns (google.protobuf.Empty); +// rpc GetProgress(ProgressRequest) returns (stream Progress); + rpc Stop(StopReadRequest) returns (google.protobuf.Empty); +} + +message Target { + string endpoint = 1; + string name = 2; + TargetMetadata meta = 3; +} + +message TargetMetadata { + google.protobuf.Timestamp lastReadTimestamp = 1; +} + +message TargetDiff { + string endpoint = 1; + string name = 2; +} + +message TargetList { + repeated Target targets = 1; +} + +message TargetAddRequest { + Target target = 1; +} + +message TargetEditRequest { + string targetName = 1; + TargetDiff targetDiff = 2; +} + +message TargetRemoveRequest { + string targetName = 1; +} + +message StartReadRequest { + string targetName = 1; + Query query = 2; + + // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp + bool forceOverlap = 3; +} + +message ProgressRequest { + string targetName = 1; +} + +message StopReadRequest { + string targetName = 1; +} + +// PromQL query +message Query { + google.protobuf.Timestamp startTimestamp = 1; + google.protobuf.Timestamp endTimestamp = 2; + repeated LabelMatcher matcher = 3; +} + +message LabelMatcher { + enum Type { + EQUAL = 0; + NOT_EQUAL = 1; + REGEX_EQUAL = 2; + NOT_REGEX_EQUAL = 3; + } + + Type type = 1; + string name = 2; + string value = 3; +} + +message Progress { + google.protobuf.Timestamp startTimestamp = 1; + google.protobuf.Timestamp endTimestamp = 2; + float percentDone = 3; +} diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go new file mode 100644 index 0000000000..8c74ad2bab --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -0,0 +1,288 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - ragu v1.0.0 +// source: github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto + +package remoteread + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RemoteReadClient is the client API for RemoteRead 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 RemoteReadClient interface { + AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*Target, error) + EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*Target, error) + RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*Target, error) + ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TargetList, error) + Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // rpc GetProgress(ProgressRequest) returns (stream Progress); + Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type remoteReadClient struct { + cc grpc.ClientConnInterface +} + +func NewRemoteReadClient(cc grpc.ClientConnInterface) RemoteReadClient { + return &remoteReadClient{cc} +} + +func (c *remoteReadClient) AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*Target, error) { + out := new(Target) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/AddTarget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadClient) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*Target, error) { + out := new(Target) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/EditTarget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadClient) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*Target, error) { + out := new(Target) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/RemoveTarget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadClient) ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TargetList, error) { + out := new(TargetList) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/ListTargets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/Start", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/Stop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RemoteReadServer is the server API for RemoteRead service. +// All implementations must embed UnimplementedRemoteReadServer +// for forward compatibility +type RemoteReadServer interface { + AddTarget(context.Context, *TargetAddRequest) (*Target, error) + EditTarget(context.Context, *TargetEditRequest) (*Target, error) + RemoveTarget(context.Context, *TargetRemoveRequest) (*Target, error) + ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) + Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) + // rpc GetProgress(ProgressRequest) returns (stream Progress); + Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedRemoteReadServer() +} + +// UnimplementedRemoteReadServer must be embedded to have forward compatible implementations. +type UnimplementedRemoteReadServer struct { +} + +func (UnimplementedRemoteReadServer) AddTarget(context.Context, *TargetAddRequest) (*Target, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddTarget not implemented") +} +func (UnimplementedRemoteReadServer) EditTarget(context.Context, *TargetEditRequest) (*Target, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditTarget not implemented") +} +func (UnimplementedRemoteReadServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*Target, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveTarget not implemented") +} +func (UnimplementedRemoteReadServer) ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented") +} +func (UnimplementedRemoteReadServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedRemoteReadServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") +} +func (UnimplementedRemoteReadServer) mustEmbedUnimplementedRemoteReadServer() {} + +// UnsafeRemoteReadServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RemoteReadServer will +// result in compilation errors. +type UnsafeRemoteReadServer interface { + mustEmbedUnimplementedRemoteReadServer() +} + +func RegisterRemoteReadServer(s grpc.ServiceRegistrar, srv RemoteReadServer) { + s.RegisterService(&RemoteRead_ServiceDesc, srv) +} + +func _RemoteRead_AddTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetAddRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).AddTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/AddTarget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).AddTarget(ctx, req.(*TargetAddRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteRead_EditTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetEditRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).EditTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/EditTarget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).EditTarget(ctx, req.(*TargetEditRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteRead_RemoveTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetRemoveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).RemoveTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/RemoveTarget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).RemoveTarget(ctx, req.(*TargetRemoveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteRead_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).ListTargets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/ListTargets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).ListTargets(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteRead_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/Start", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).Start(ctx, req.(*StartReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteRead_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteRead/Stop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadServer).Stop(ctx, req.(*StopReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RemoteRead_ServiceDesc is the grpc.ServiceDesc for RemoteRead service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RemoteRead_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "remoteread.RemoteRead", + HandlerType: (*RemoteReadServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddTarget", + Handler: _RemoteRead_AddTarget_Handler, + }, + { + MethodName: "EditTarget", + Handler: _RemoteRead_EditTarget_Handler, + }, + { + MethodName: "RemoveTarget", + Handler: _RemoteRead_RemoveTarget_Handler, + }, + { + MethodName: "ListTargets", + Handler: _RemoteRead_ListTargets_Handler, + }, + { + MethodName: "Start", + Handler: _RemoteRead_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _RemoteRead_Stop_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", +} diff --git a/plugins/metrics/pkg/apis/remoteread/server.go b/plugins/metrics/pkg/apis/remoteread/server.go new file mode 100644 index 0000000000..2b71a0fab7 --- /dev/null +++ b/plugins/metrics/pkg/apis/remoteread/server.go @@ -0,0 +1,118 @@ +package remoteread + +import ( + "context" + "fmt" + "github.com/rancher/opni/pkg/config/v1beta1" + "github.com/rancher/opni/pkg/util" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + metricsutil "github.com/rancher/opni/plugins/metrics/pkg/util" + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/emptypb" + "sync" +) + +// block compilation until type assertion is satisfied +var _ RemoteReadServer = (*RemoteRead)(nil) + +type RemoteReadConfig struct { + remoteWriterClient remotewrite.RemoteWriteClient `validate:"required"` + Config *v1beta1.GatewayConfig `validate:"required"` + Logger *zap.SugaredLogger `validate:"required"` +} + +type RemoteRead struct { + UnsafeRemoteReadServer + RemoteReadConfig + util.Initializer + + // todo: might need something more robust + targets map[string]*Target + targetsMu sync.RWMutex +} + +func (reader *RemoteRead) Initialize(conf RemoteReadConfig) { + reader.InitOnce(func() { + if err := metricsutil.Validate.Struct(conf); err != nil { + panic(err) + } + + reader.RemoteReadConfig = conf + }) +} + +func (reader *RemoteRead) AddTarget(_ context.Context, request *TargetAddRequest) (*Target, error) { + target := request.Target + + reader.targetsMu.Lock() + defer reader.targetsMu.Unlock() + + reader.targets[target.Name] = target + + return target, nil +} + +func (reader *RemoteRead) EditTarget(_ context.Context, request *TargetEditRequest) (*Target, error) { + diff := request.TargetDiff + + reader.targetsMu.Lock() + defer reader.targetsMu.Unlock() + + target := reader.targets[request.TargetName] + + if diff.Endpoint != "" { + target.Endpoint = diff.Endpoint + } + + if diff.Name != "" { + target.Name = diff.Name + + delete(reader.targets, request.TargetName) + } + + reader.targets[target.Name] = target + + return target, nil +} + +func (reader *RemoteRead) RemoveTarget(_ context.Context, request *TargetRemoveRequest) (*Target, error) { + reader.targetsMu.Lock() + defer reader.targetsMu.Unlock() + + if target, found := reader.targets[request.TargetName]; found { + delete(reader.targets, request.TargetName) + return target, nil + } + + return nil, fmt.Errorf("no target '%s' found", request.TargetName) +} + +func (reader *RemoteRead) ListTargets(_ context.Context, _ *emptypb.Empty) (*TargetList, error) { + reader.targetsMu.Lock() + defer reader.targetsMu.Unlock() + + targets := make([]*Target, len(reader.targets)) + + for _, target := range reader.targets { + targets = append(targets, target) + } + + return &TargetList{ + Targets: targets, + }, nil +} + +func (reader *RemoteRead) Start(_ context.Context, _ *StartReadRequest) (*emptypb.Empty, error) { + // todo: implement + return nil, fmt.Errorf("not yet implemented") +} + +//func (reader *RemoteRead) GetProgress(_ context.Context, _ *ProgressRequest) (*emptypb.Empty, error) { +// // todo: implement +// return nil, fmt.Errorf("not yet implemented") +//} + +func (reader *RemoteRead) Stop(_ context.Context, _ *StopReadRequest) (*emptypb.Empty, error) { + // todo: implement + return nil, fmt.Errorf("not yet implemented") +} diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index b5aa8c92d7..1437a56d54 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -3,9 +3,6 @@ package gateway import ( "context" "crypto/tls" - - "go.uber.org/zap" - capabilityv1 "github.com/rancher/opni/pkg/apis/capability/v1" managementv1 "github.com/rancher/opni/pkg/apis/management/v1" "github.com/rancher/opni/pkg/auth" @@ -28,6 +25,7 @@ import ( "github.com/rancher/opni/plugins/metrics/pkg/backend" "github.com/rancher/opni/plugins/metrics/pkg/cortex" "github.com/rancher/opni/plugins/metrics/pkg/gateway/drivers" + "go.uber.org/zap" ) type Plugin struct { diff --git a/plugins/metrics/pkg/gateway/remoteread.go b/plugins/metrics/pkg/gateway/remoteread.go new file mode 100644 index 0000000000..f1dd576e23 --- /dev/null +++ b/plugins/metrics/pkg/gateway/remoteread.go @@ -0,0 +1,20 @@ +package gateway + +import ( + "github.com/rancher/opni/pkg/config/v1beta1" + "github.com/rancher/opni/pkg/util" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "go.uber.org/zap" +) + +type RemoteReadConfig struct { + Config *v1beta1.GatewayConfigSpec `validate:"required"` + Logger *zap.SugaredLogger `validate:"required"` +} + +type RemoteReader struct { + remoteread.UnsafeRemoteReadServer + RemoteReadConfig + + util.Initializer +} From e2e32c0794f4b5655257509afa7e6edea18d39e2 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 15 Dec 2022 14:49:25 -0500 Subject: [PATCH 03/43] impl agent remote read --- pkg/config/v1beta1/gateway_config.go | 5 + pkg/opni/commands/import.go | 9 +- pkg/opni/commands/setup_import.go | 4 +- plugins/metrics/pkg/agent/http.go | 197 ++++++++++++- plugins/metrics/pkg/agent/remoteread.go | 87 ++++++ plugins/metrics/pkg/agent/runner.go | 272 ++++++++++++++++++ plugins/metrics/pkg/agent/stream.go | 8 + .../pkg/apis/remoteread/remoteread.pb.go | 125 ++++---- .../pkg/apis/remoteread/remoteread.proto | 8 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 30 +- plugins/metrics/pkg/apis/remoteread/server.go | 118 -------- plugins/metrics/pkg/cortex/api.go | 12 + plugins/metrics/pkg/gateway/remoteread.go | 20 -- plugins/metrics/pkg/gateway/stream.go | 6 + 14 files changed, 675 insertions(+), 226 deletions(-) create mode 100644 plugins/metrics/pkg/agent/remoteread.go create mode 100644 plugins/metrics/pkg/agent/runner.go delete mode 100644 plugins/metrics/pkg/apis/remoteread/server.go delete mode 100644 plugins/metrics/pkg/gateway/remoteread.go diff --git a/pkg/config/v1beta1/gateway_config.go b/pkg/config/v1beta1/gateway_config.go index b76225dc23..1a773412e4 100644 --- a/pkg/config/v1beta1/gateway_config.go +++ b/pkg/config/v1beta1/gateway_config.go @@ -29,6 +29,7 @@ type GatewayConfigSpec struct { Plugins PluginsSpec `json:"plugins,omitempty"` Alerting AlertingSpec `json:"alerting,omitempty"` Profiling ProfilingSpec `json:"profiling,omitempty"` + RemoteRead RemoteReadSpec `json:"remoteRead,omitempty"` } type AlertingSpec struct { @@ -54,6 +55,10 @@ type ProfilingSpec struct { Path string `json:"path,omitempty"` } +type RemoteReadSpec struct { + HttpAddress string `json:"path,omitempty"` +} + func (s MetricsSpec) GetPath() string { if s.Path == "" { return "/metrics" diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 7e7c4299e9..5525c5dd32 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -191,7 +191,7 @@ func BuildImportStartCmd() *cobra.Command { var forceOverlap bool cmd := &cobra.Command{ - Use: "start", + Use: "start ", Short: "start", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -211,7 +211,7 @@ func BuildImportStartCmd() *cobra.Command { query := &remoteread.Query{ StartTimestamp: ×tamppb.Timestamp{Seconds: startTimestamp}, EndTimestamp: ×tamppb.Timestamp{Seconds: endTimestamp}, - Matcher: labelMatchers, + Matchers: labelMatchers, } request := &remoteread.StartReadRequest{ @@ -240,6 +240,7 @@ func BuildImportStartCmd() *cobra.Command { cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") + ConfigureManagementCommand(cmd) ConfigureImportCommand(cmd) return cmd @@ -251,10 +252,12 @@ func BuildImportCmd() *cobra.Command { Short: "Interact with metrics import plugin APIs", } - cmd.AddCommand(BuildImportTargetCmd()) cmd.AddCommand(BuildImportStartCmd()) cmd.AddCommand(BuildImportTargetCmd()) + ConfigureManagementCommand(cmd) + ConfigureImportCommand(cmd) + return cmd } diff --git a/pkg/opni/commands/setup_import.go b/pkg/opni/commands/setup_import.go index 8dbd924150..c826664848 100644 --- a/pkg/opni/commands/setup_import.go +++ b/pkg/opni/commands/setup_import.go @@ -9,7 +9,7 @@ var remoteReadClient remoteread.RemoteReadClient func ConfigureImportCommand(cmd *cobra.Command) { if cmd.PersistentPreRunE == nil { - cmd.PersistentPostRunE = importPreRunE + cmd.PersistentPreRunE = importPreRunE } else { oldPreRunE := cmd.PersistentPreRunE cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error { @@ -27,7 +27,7 @@ func importPreRunE(cmd *cobra.Command, args []string) error { panic("bug: managementListenAddress is empty") } - client, err := remoteread.NewClient(cmd.Context(), remoteread.WithListenAddress("")) + client, err := remoteread.NewClient(cmd.Context(), remoteread.WithListenAddress(managementListenAddress)) if err != nil { return err } diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index 39c907a6ca..d97ef2a430 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -2,6 +2,8 @@ package agent import ( "errors" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "google.golang.org/protobuf/proto" "net/http" "strings" "sync" @@ -28,6 +30,9 @@ type HttpServer struct { remoteWriteClientMu sync.RWMutex remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] + targetRunnerMu sync.RWMutex + targetRunner clients.Locker[TargetRunner] + conditions health.ConditionTracker enabled atomic.Bool @@ -52,15 +57,38 @@ func (s *HttpServer) SetEnabled(enabled bool) { func (s *HttpServer) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { s.remoteWriteClientMu.Lock() defer s.remoteWriteClientMu.Unlock() + s.remoteWriteClient = client } +func (s *HttpServer) SetTargetRunner(runner clients.Locker[TargetRunner]) { + s.targetRunnerMu.Lock() + defer s.targetRunnerMu.Unlock() + + s.remoteWriteClientMu.Lock() + if s.remoteWriteClient != nil { + runner.Use(func(runner TargetRunner) { + runner.SetRemoteWriteClient(s.remoteWriteClient) + }) + } + + s.targetRunner = runner +} + func (s *HttpServer) ConfigureRoutes(router *gin.Engine) { - router.POST("/api/agent/push", s.handlePushRequest) + router.POST("/api/agent/push", s.handleMetricPushRequest) pprof.Register(router, "/debug/plugin_metrics/pprof") + + router.POST("/api/remoteread/target/add", s.handleTargetAdd) + router.PATCH("/api/remoteread/target/edit", s.handleTargetEdit) + router.DELETE("/api/remoteread/target/remove", s.handleTargetRemove) + router.GET("/api/remoteread/target/list", s.handleTargetList) + + router.GET("/api/remoteread/start", s.handleRemoteReadStart) + router.GET("/api/remoteread/stop", s.handleRemoteReadStop) } -func (s *HttpServer) handlePushRequest(c *gin.Context) { +func (s *HttpServer) handleMetricPushRequest(c *gin.Context) { if !s.enabled.Load() { c.Status(http.StatusServiceUnavailable) return @@ -132,3 +160,168 @@ func (s *HttpServer) handlePushRequest(c *gin.Context) { c.Status(http.StatusServiceUnavailable) } } + +func (s *HttpServer) handleTargetAdd(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + buf := bytebufferpool.Get() + if _, err := buf.ReadFrom(c.Request.Body); err != nil { + c.Status(http.StatusInternalServerError) + return + } + + var request remoteread.TargetAddRequest + if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + target := request.Target + + s.targetRunner.Use(func(runner TargetRunner) { + if err := runner.Add(target); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + c.Status(http.StatusOK) + }) +} + +func (s *HttpServer) handleTargetEdit(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + buf := bytebufferpool.Get() + if _, err := buf.ReadFrom(c.Request.Body); err != nil { + c.Status(http.StatusInternalServerError) + return + } + + var request remoteread.TargetEditRequest + if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + targetName := request.TargetName + diff := request.TargetDiff + + s.targetRunner.Use(func(runner TargetRunner) { + if err := runner.Edit(targetName, diff); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + } + + c.Status(http.StatusOK) + }) +} + +func (s *HttpServer) handleTargetRemove(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + buf := bytebufferpool.Get() + if _, err := buf.ReadFrom(c.Request.Body); err != nil { + c.Status(http.StatusInternalServerError) + return + } + + var request remoteread.TargetRemoveRequest + if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + s.targetRunner.Use(func(runner TargetRunner) { + if err := runner.Remove(request.TargetName); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + c.Status(http.StatusOK) + }) +} + +func (s *HttpServer) handleTargetList(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + s.targetRunner.Use(func(runner TargetRunner) { + c.ProtoBuf(http.StatusOK, runner.List()) + }) +} + +func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + buf := bytebufferpool.Get() + if _, err := buf.ReadFrom(c.Request.Body); err != nil { + c.Status(http.StatusInternalServerError) + return + } + + var request remoteread.StartReadRequest + if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + s.targetRunner.Use(func(runner TargetRunner) { + if err := runner.Start(request.TargetName, request.Query); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + c.Status(http.StatusOK) + }) +} + +func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { + if !s.enabled.Load() { + c.Status(http.StatusServiceUnavailable) + return + } + + buf := bytebufferpool.Get() + if _, err := buf.ReadFrom(c.Request.Body); err != nil { + c.Status(http.StatusInternalServerError) + return + } + + var request remoteread.StopReadRequest + if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + s.targetRunner.Use(func(runner TargetRunner) { + if err := runner.Stop(request.TargetName); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } + + c.Status(http.StatusOK) + }) +} diff --git a/plugins/metrics/pkg/agent/remoteread.go b/plugins/metrics/pkg/agent/remoteread.go new file mode 100644 index 0000000000..4f0ac00ee6 --- /dev/null +++ b/plugins/metrics/pkg/agent/remoteread.go @@ -0,0 +1,87 @@ +package agent + +import ( + "bytes" + "context" + "fmt" + "github.com/golang/protobuf/proto" + "github.com/golang/snappy" + "github.com/prometheus/common/version" + "github.com/prometheus/prometheus/prompb" + "io" + "net/http" + "time" +) + +type RemoteReadClient struct { + stopChan chan interface{} + prometheusClient *http.Client +} + +func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReadClient { + return &RemoteReadClient{ + stopChan: stopChan, + prometheusClient: prometheusClient, + } +} + +func (client *RemoteReadClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { + uncompressedData, err := proto.Marshal(readRequest) + if err != nil { + return nil, fmt.Errorf("unable to marshal remote read readRequest: %w", err) + } + + compressedData := snappy.Encode(nil, uncompressedData) + + request, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewReader(compressedData)) + if err != nil { + return nil, fmt.Errorf("unable to crete remote read http readRequest: %w", err) + } + + request.Header.Add("Content-Encoding", "snappy") + request.Header.Add("Accept-Encoding", "snappy") + request.Header.Set("Content-Type", "application/x-protobuf") + request.Header.Set("User-Agent", "Prometheus/xx") + request.Header.Set("X-Prometheus-Remote-Read-Version", fmt.Sprintf("Prometheus/%s", version.Version)) + + // todo: timeout should be configurable + ctx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + + request = request.WithContext(ctx) + + response, err := client.prometheusClient.Do(request) + if err != nil { + return nil, fmt.Errorf("could not get response from rmeote read: %w", err) + } + + defer func() { + _, _ = io.Copy(io.Discard, response.Body) + _ = response.Body.Close() + }() + + var reader bytes.Buffer + _, _ = io.Copy(&reader, response.Body) + + compressedData, err = io.ReadAll(bytes.NewReader(reader.Bytes())) + if err != nil { + return nil, fmt.Errorf("error reading http response: %w", err) + } + + if response.StatusCode/100 != 2 { + return nil, fmt.Errorf("endpoint '%s' responded with status code '%d'", endpoint, response.StatusCode) + } + + uncompressedData, err = snappy.Decode(nil, compressedData) + if err != nil { + return nil, fmt.Errorf("unabled to uncompress reponse: %w", err) + } + + var readResponse prompb.ReadResponse + err = proto.Unmarshal(uncompressedData, &readResponse) + if err != nil { + return nil, fmt.Errorf("could not unmarshal remote read reponse: %w", err) + } + + return &readResponse, nil +} diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go new file mode 100644 index 0000000000..5c1345a6cb --- /dev/null +++ b/plugins/metrics/pkg/agent/runner.go @@ -0,0 +1,272 @@ +package agent + +import ( + "context" + "fmt" + "github.com/golang/protobuf/proto" + "github.com/golang/snappy" + "github.com/opentracing-contrib/go-stdlib/nethttp" + promConfig "github.com/prometheus/common/config" + "github.com/prometheus/prometheus/prompb" + "github.com/rancher/opni/pkg/clients" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "time" +) + +func targetAlreadyExistsError(name string) error { + return fmt.Errorf("target '%s' already exists", name) +} + +func targetDoesNotExistError(name string) error { + return fmt.Errorf("target '%s' does not exist", name) +} + +func targetIsRunningError(name string) error { + return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", name) +} + +func targetIsNotRunningError(name string) error { + return fmt.Errorf("target '%s' is not running", name) +} + +// todo: import prometheus LabelMatcher into apis/remoteread.proto to remove this +func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { + pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) + + for _, matcher := range rrLabelMatchers { + var matchType prompb.LabelMatcher_Type + + switch matcher.Type { + case remoteread.LabelMatcher_EQUAL: + matchType = prompb.LabelMatcher_EQ + case remoteread.LabelMatcher_NOT_EQUAL: + matchType = prompb.LabelMatcher_NEQ + case remoteread.LabelMatcher_REGEX_EQUAL: + matchType = prompb.LabelMatcher_RE + case remoteread.LabelMatcher_NOT_REGEX_EQUAL: + matchType = prompb.LabelMatcher_NRE + default: + // todo: log something + } + + pbLabelMatchers = append(pbLabelMatchers, &prompb.LabelMatcher{ + Type: matchType, + Name: matcher.Name, + Value: matcher.Value, + }) + } + + return pbLabelMatchers +} + +func dereferenceResultTimeseries(in []*prompb.TimeSeries) []prompb.TimeSeries { + dereferenced := make([]prompb.TimeSeries, 0, len(in)) + + for _, ref := range in { + dereferenced = append(dereferenced, *ref) + } + + return dereferenced +} + +type Run struct { + stopChan chan interface{} + target *remoteread.Target + query *remoteread.Query +} + +type TargetRunner interface { + Add(target *remoteread.Target) error + + Edit(name string, diff *remoteread.TargetDiff) error + + Remove(name string) error + + List() *remoteread.TargetList + + Start(name string, query *remoteread.Query) error + + Stop(name string) error + + SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) +} + +func NewTargetRunner() TargetRunner { + return &targetRunner{ + targets: make(map[string]*remoteread.Target), + runs: make(map[string]Run), + } +} + +type targetRunner struct { + targets map[string]*remoteread.Target + runs map[string]Run + + remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] +} + +func (runner *targetRunner) Add(target *remoteread.Target) error { + if _, found := runner.targets[target.Name]; found { + return targetAlreadyExistsError(target.Name) + } + + runner.targets[target.Name] = target + + return nil +} + +func (runner *targetRunner) Edit(name string, diff *remoteread.TargetDiff) error { + target, found := runner.targets[name] + + if !found { + return targetDoesNotExistError(target.Name) + } + + if _, found := runner.runs[name]; found { + return targetIsRunningError(name) + } + + if diff.Endpoint != "" { + target.Endpoint = diff.Endpoint + } + + if diff.Name != "" { + target.Name = diff.Name + + delete(runner.targets, name) + } + + runner.targets[target.Name] = target + + return nil +} + +func (runner *targetRunner) Remove(name string) error { + if _, found := runner.targets[name]; !found { + return targetDoesNotExistError(name) + } + + delete(runner.targets, name) + + return nil +} + +func (runner *targetRunner) List() *remoteread.TargetList { + targets := make([]*remoteread.Target, 0, len(runner.targets)) + + for _, target := range runner.targets { + targets = append(targets, target) + } + + return &remoteread.TargetList{Targets: targets} +} + +func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReadClient) { + labelMatchers := toLabelMatchers(run.query.Matchers) + + // todo: this should probably be a lot more sophisticated than this + importEnd := run.query.EndTimestamp.AsTime().UnixMilli() + nextEndDelta := time.Minute.Milliseconds() * 5 + + nextStart := run.query.StartTimestamp.AsTime().UnixMilli() + + for nextStart < importEnd { + nextEnd := nextStart + nextEndDelta + if nextEnd > importEnd { + nextEnd = importEnd + } + + readRequest := &prompb.ReadRequest{ + Queries: []*prompb.Query{ + { + StartTimestampMs: nextStart, + EndTimestampMs: nextEnd, + Matchers: labelMatchers, + }, + }, + } + + readResponse, err := remoteReadClient.Read(context.TODO(), run.target.Endpoint, readRequest) + + if err != nil { + // todo: log this event + return + } + + for _, result := range readResponse.Results { + writeRequest := prompb.WriteRequest{ + Timeseries: dereferenceResultTimeseries(result.Timeseries), + } + + uncompressed, err := proto.Marshal(&writeRequest) + if err != nil { + // todo: log failure + continue + } + + compressed := snappy.Encode(nil, uncompressed) + + payload := &remotewrite.Payload{ + Contents: compressed, + } + + runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { + if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { + // todo: log this error + } + }) + } + } +} + +func (runner *targetRunner) Start(name string, query *remoteread.Query) error { + if _, found := runner.runs[name]; found { + return targetIsRunningError(name) + } + + target, found := runner.targets[name] + + if !found { + return targetDoesNotExistError(name) + } + + run := Run{ + stopChan: make(chan interface{}), + target: target, + query: query, + } + + prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Name), promConfig.WithHTTP2Disabled()) + if err != nil { + return fmt.Errorf("could not start import: %w", err) + } + + prometheusClient.Transport = &nethttp.Transport{ + RoundTripper: prometheusClient.Transport, + } + + remoteReadClient := NewRemoteReadClient(run.stopChan, prometheusClient) + + go runner.run(run, remoteReadClient) + runner.runs[name] = run + + return nil +} + +func (runner *targetRunner) Stop(name string) error { + run, found := runner.runs[name] + + if !found { + return targetIsNotRunningError(name) + } + + close(run.stopChan) + delete(runner.runs, name) + + return nil +} + +func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { + runner.remoteWriteClient = client +} diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index 216b205f0d..c3820e2aab 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -6,6 +6,7 @@ import ( "github.com/rancher/opni/pkg/clients" streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" "github.com/rancher/opni/plugins/metrics/pkg/apis/node" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" "google.golang.org/grpc" ) @@ -16,11 +17,18 @@ func (p *Plugin) StreamServers() []streamext.Server { Desc: &capabilityv1.Node_ServiceDesc, Impl: p.node, }, + { + Desc: &remoteread.RemoteRead_ServiceDesc, + Impl: p.node, + }, } } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) + p.httpServer.SetTargetRunner(clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { + return NewTargetRunner() + })) p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) nodeClient := node.NewNodeMetricsCapabilityClient(cc) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 5753561b88..bd54f38594 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -603,7 +603,7 @@ type Query struct { StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` - Matcher []*LabelMatcher `protobuf:"bytes,3,rep,name=matcher,proto3" json:"matcher,omitempty"` + Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers,omitempty"` } func (x *Query) Reset() { @@ -652,9 +652,9 @@ func (x *Query) GetEndTimestamp() *timestamppb.Timestamp { return nil } -func (x *Query) GetMatcher() []*LabelMatcher { +func (x *Query) GetMatchers() []*LabelMatcher { if x != nil { - return x.Matcher + return x.Matchers } return nil } @@ -851,7 +851,7 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, @@ -860,62 +860,63 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0xb3, 0x01, 0x0a, 0x0c, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, - 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, - 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4e, - 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, - 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, - 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, 0x01, 0x0a, + 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, + 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, + 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, + 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, - 0x6f, 0x6e, 0x65, 0x32, 0x8c, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, - 0x61, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, + 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0x98, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x52, 0x65, 0x61, 0x64, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, - 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, - 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -959,7 +960,7 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 11, // 5: remoteread.StartReadRequest.query:type_name -> remoteread.Query 14, // 6: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp 14, // 7: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp - 12, // 8: remoteread.Query.matcher:type_name -> remoteread.LabelMatcher + 12, // 8: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher 0, // 9: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type 14, // 10: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp 14, // 11: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp @@ -969,9 +970,9 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 15, // 15: remoteread.RemoteRead.ListTargets:input_type -> google.protobuf.Empty 8, // 16: remoteread.RemoteRead.Start:input_type -> remoteread.StartReadRequest 10, // 17: remoteread.RemoteRead.Stop:input_type -> remoteread.StopReadRequest - 1, // 18: remoteread.RemoteRead.AddTarget:output_type -> remoteread.Target - 1, // 19: remoteread.RemoteRead.EditTarget:output_type -> remoteread.Target - 1, // 20: remoteread.RemoteRead.RemoveTarget:output_type -> remoteread.Target + 15, // 18: remoteread.RemoteRead.AddTarget:output_type -> google.protobuf.Empty + 15, // 19: remoteread.RemoteRead.EditTarget:output_type -> google.protobuf.Empty + 15, // 20: remoteread.RemoteRead.RemoveTarget:output_type -> google.protobuf.Empty 4, // 21: remoteread.RemoteRead.ListTargets:output_type -> remoteread.TargetList 15, // 22: remoteread.RemoteRead.Start:output_type -> google.protobuf.Empty 15, // 23: remoteread.RemoteRead.Stop:output_type -> google.protobuf.Empty diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index ab2a67b7af..4fa1f38bb2 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -14,9 +14,9 @@ service RemoteRead { // rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); // rpc Describe(Target) returns (Target); - rpc AddTarget(TargetAddRequest) returns (Target); - rpc EditTarget(TargetEditRequest) returns (Target); - rpc RemoveTarget(TargetRemoveRequest) returns (Target); + rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); + rpc EditTarget(TargetEditRequest) returns (google.protobuf.Empty); + rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); rpc ListTargets(google.protobuf.Empty) returns (TargetList); rpc Start(StartReadRequest) returns (google.protobuf.Empty); // rpc GetProgress(ProgressRequest) returns (stream Progress); @@ -75,7 +75,7 @@ message StopReadRequest { message Query { google.protobuf.Timestamp startTimestamp = 1; google.protobuf.Timestamp endTimestamp = 2; - repeated LabelMatcher matcher = 3; + repeated LabelMatcher matchers = 3; } message LabelMatcher { diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index 8c74ad2bab..929847b92b 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -23,9 +23,9 @@ const _ = grpc.SupportPackageIsVersion7 // // 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 RemoteReadClient interface { - AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*Target, error) - EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*Target, error) - RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*Target, error) + AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TargetList, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // rpc GetProgress(ProgressRequest) returns (stream Progress); @@ -40,8 +40,8 @@ func NewRemoteReadClient(cc grpc.ClientConnInterface) RemoteReadClient { return &remoteReadClient{cc} } -func (c *remoteReadClient) AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*Target, error) { - out := new(Target) +func (c *remoteReadClient) AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/AddTarget", in, out, opts...) if err != nil { return nil, err @@ -49,8 +49,8 @@ func (c *remoteReadClient) AddTarget(ctx context.Context, in *TargetAddRequest, return out, nil } -func (c *remoteReadClient) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*Target, error) { - out := new(Target) +func (c *remoteReadClient) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/EditTarget", in, out, opts...) if err != nil { return nil, err @@ -58,8 +58,8 @@ func (c *remoteReadClient) EditTarget(ctx context.Context, in *TargetEditRequest return out, nil } -func (c *remoteReadClient) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*Target, error) { - out := new(Target) +func (c *remoteReadClient) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/RemoveTarget", in, out, opts...) if err != nil { return nil, err @@ -98,9 +98,9 @@ func (c *remoteReadClient) Stop(ctx context.Context, in *StopReadRequest, opts . // All implementations must embed UnimplementedRemoteReadServer // for forward compatibility type RemoteReadServer interface { - AddTarget(context.Context, *TargetAddRequest) (*Target, error) - EditTarget(context.Context, *TargetEditRequest) (*Target, error) - RemoveTarget(context.Context, *TargetRemoveRequest) (*Target, error) + AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) + EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) + RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) // rpc GetProgress(ProgressRequest) returns (stream Progress); @@ -112,13 +112,13 @@ type RemoteReadServer interface { type UnimplementedRemoteReadServer struct { } -func (UnimplementedRemoteReadServer) AddTarget(context.Context, *TargetAddRequest) (*Target, error) { +func (UnimplementedRemoteReadServer) AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method AddTarget not implemented") } -func (UnimplementedRemoteReadServer) EditTarget(context.Context, *TargetEditRequest) (*Target, error) { +func (UnimplementedRemoteReadServer) EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method EditTarget not implemented") } -func (UnimplementedRemoteReadServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*Target, error) { +func (UnimplementedRemoteReadServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveTarget not implemented") } func (UnimplementedRemoteReadServer) ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) { diff --git a/plugins/metrics/pkg/apis/remoteread/server.go b/plugins/metrics/pkg/apis/remoteread/server.go deleted file mode 100644 index 2b71a0fab7..0000000000 --- a/plugins/metrics/pkg/apis/remoteread/server.go +++ /dev/null @@ -1,118 +0,0 @@ -package remoteread - -import ( - "context" - "fmt" - "github.com/rancher/opni/pkg/config/v1beta1" - "github.com/rancher/opni/pkg/util" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" - metricsutil "github.com/rancher/opni/plugins/metrics/pkg/util" - "go.uber.org/zap" - "google.golang.org/protobuf/types/known/emptypb" - "sync" -) - -// block compilation until type assertion is satisfied -var _ RemoteReadServer = (*RemoteRead)(nil) - -type RemoteReadConfig struct { - remoteWriterClient remotewrite.RemoteWriteClient `validate:"required"` - Config *v1beta1.GatewayConfig `validate:"required"` - Logger *zap.SugaredLogger `validate:"required"` -} - -type RemoteRead struct { - UnsafeRemoteReadServer - RemoteReadConfig - util.Initializer - - // todo: might need something more robust - targets map[string]*Target - targetsMu sync.RWMutex -} - -func (reader *RemoteRead) Initialize(conf RemoteReadConfig) { - reader.InitOnce(func() { - if err := metricsutil.Validate.Struct(conf); err != nil { - panic(err) - } - - reader.RemoteReadConfig = conf - }) -} - -func (reader *RemoteRead) AddTarget(_ context.Context, request *TargetAddRequest) (*Target, error) { - target := request.Target - - reader.targetsMu.Lock() - defer reader.targetsMu.Unlock() - - reader.targets[target.Name] = target - - return target, nil -} - -func (reader *RemoteRead) EditTarget(_ context.Context, request *TargetEditRequest) (*Target, error) { - diff := request.TargetDiff - - reader.targetsMu.Lock() - defer reader.targetsMu.Unlock() - - target := reader.targets[request.TargetName] - - if diff.Endpoint != "" { - target.Endpoint = diff.Endpoint - } - - if diff.Name != "" { - target.Name = diff.Name - - delete(reader.targets, request.TargetName) - } - - reader.targets[target.Name] = target - - return target, nil -} - -func (reader *RemoteRead) RemoveTarget(_ context.Context, request *TargetRemoveRequest) (*Target, error) { - reader.targetsMu.Lock() - defer reader.targetsMu.Unlock() - - if target, found := reader.targets[request.TargetName]; found { - delete(reader.targets, request.TargetName) - return target, nil - } - - return nil, fmt.Errorf("no target '%s' found", request.TargetName) -} - -func (reader *RemoteRead) ListTargets(_ context.Context, _ *emptypb.Empty) (*TargetList, error) { - reader.targetsMu.Lock() - defer reader.targetsMu.Unlock() - - targets := make([]*Target, len(reader.targets)) - - for _, target := range reader.targets { - targets = append(targets, target) - } - - return &TargetList{ - Targets: targets, - }, nil -} - -func (reader *RemoteRead) Start(_ context.Context, _ *StartReadRequest) (*emptypb.Empty, error) { - // todo: implement - return nil, fmt.Errorf("not yet implemented") -} - -//func (reader *RemoteRead) GetProgress(_ context.Context, _ *ProgressRequest) (*emptypb.Empty, error) { -// // todo: implement -// return nil, fmt.Errorf("not yet implemented") -//} - -func (reader *RemoteRead) Stop(_ context.Context, _ *StopReadRequest) (*emptypb.Empty, error) { - // todo: implement - return nil, fmt.Errorf("not yet implemented") -} diff --git a/plugins/metrics/pkg/cortex/api.go b/plugins/metrics/pkg/cortex/api.go index 03b7eb8cf1..07c08f1881 100644 --- a/plugins/metrics/pkg/cortex/api.go +++ b/plugins/metrics/pkg/cortex/api.go @@ -25,6 +25,7 @@ type forwarders struct { QueryFrontend gin.HandlerFunc Alertmanager gin.HandlerFunc Ruler gin.HandlerFunc + RemoteRead gin.HandlerFunc } type middlewares struct { @@ -80,6 +81,7 @@ func (p *HttpApiServer) ConfigureRoutes(router *gin.Engine) { QueryFrontend: fwd.To(p.Config.Cortex.QueryFrontend.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("query-frontend")), Alertmanager: fwd.To(p.Config.Cortex.Alertmanager.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("alertmanager")), Ruler: fwd.To(p.Config.Cortex.Ruler.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("ruler")), + RemoteRead: fwd.To(p.Config.RemoteRead.HttpAddress, fwd.WithLogger(p.Logger), fwd.WithName("remote-read")), } mws := &middlewares{ @@ -150,3 +152,13 @@ func (p *HttpApiServer) configureQueryFrontend(router *gin.Engine, f *forwarders group.GET("/metadata", f.QueryFrontend) } } + +func (p *HttpApiServer) configureImport(router *gin.Engine, f *forwarders, m *middlewares) { + router.POST("/api/remoteread/target/add", f.RemoteRead) + router.PATCH("/api/remoteread/target/edit", f.RemoteRead) + router.DELETE("/api/remoteread/target/remove", f.RemoteRead) + router.GET("/api/remoteread/target/list", f.RemoteRead) + + router.POST("/api/remoteread/start", f.RemoteRead) + router.POST("/api/remoteread/stop", f.RemoteRead) +} diff --git a/plugins/metrics/pkg/gateway/remoteread.go b/plugins/metrics/pkg/gateway/remoteread.go deleted file mode 100644 index f1dd576e23..0000000000 --- a/plugins/metrics/pkg/gateway/remoteread.go +++ /dev/null @@ -1,20 +0,0 @@ -package gateway - -import ( - "github.com/rancher/opni/pkg/config/v1beta1" - "github.com/rancher/opni/pkg/util" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" - "go.uber.org/zap" -) - -type RemoteReadConfig struct { - Config *v1beta1.GatewayConfigSpec `validate:"required"` - Logger *zap.SugaredLogger `validate:"required"` -} - -type RemoteReader struct { - remoteread.UnsafeRemoteReadServer - RemoteReadConfig - - util.Initializer -} diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index a6c4aa5e56..013812d173 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -4,6 +4,7 @@ import ( "github.com/rancher/opni/pkg/capabilities/wellknown" streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" "github.com/rancher/opni/plugins/metrics/pkg/apis/node" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" ) @@ -14,6 +15,11 @@ func (p *Plugin) StreamServers() []streamext.Server { Impl: &p.cortexRemoteWrite, RequireCapability: wellknown.CapabilityMetrics, }, + { + Desc: &remoteread.RemoteRead_ServiceDesc, + Impl: &p.cortexRemoteWrite, + RequireCapability: wellknown.CapabilityMetrics, + }, { Desc: &node.NodeMetricsCapability_ServiceDesc, Impl: &p.metrics, From 339cc1c3408223da9b730d8c7e69b4240189b8c3 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Fri, 16 Dec 2022 11:57:49 -0500 Subject: [PATCH 04/43] add gateway logic --- pkg/config/v1beta1/gateway_config.go | 5 - pkg/opni/commands/import.go | 43 ++- plugins/metrics/pkg/agent/node.go | 89 +++++ plugins/metrics/pkg/agent/remoteread.go | 8 +- plugins/metrics/pkg/agent/runner.go | 2 +- plugins/metrics/pkg/agent/stream.go | 3 + .../pkg/apis/remoteread/remoteread.pb.go | 322 ++++++++++-------- .../pkg/apis/remoteread/remoteread.pb.gw.go | 10 +- .../pkg/apis/remoteread/remoteread.proto | 29 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 12 +- plugins/metrics/pkg/backend/metrics.go | 167 +++++++++ plugins/metrics/pkg/cortex/api.go | 19 +- plugins/metrics/pkg/gateway/plugin.go | 8 +- plugins/metrics/pkg/gateway/stream.go | 2 +- 14 files changed, 541 insertions(+), 178 deletions(-) diff --git a/pkg/config/v1beta1/gateway_config.go b/pkg/config/v1beta1/gateway_config.go index 1a773412e4..b76225dc23 100644 --- a/pkg/config/v1beta1/gateway_config.go +++ b/pkg/config/v1beta1/gateway_config.go @@ -29,7 +29,6 @@ type GatewayConfigSpec struct { Plugins PluginsSpec `json:"plugins,omitempty"` Alerting AlertingSpec `json:"alerting,omitempty"` Profiling ProfilingSpec `json:"profiling,omitempty"` - RemoteRead RemoteReadSpec `json:"remoteRead,omitempty"` } type AlertingSpec struct { @@ -55,10 +54,6 @@ type ProfilingSpec struct { Path string `json:"path,omitempty"` } -type RemoteReadSpec struct { - HttpAddress string `json:"path,omitempty"` -} - func (s MetricsSpec) GetPath() string { if s.Path == "" { return "/metrics" diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 5525c5dd32..5425a78253 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -5,12 +5,13 @@ import ( cliutil "github.com/rancher/opni/pkg/opni/util" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/spf13/cobra" - "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" "strings" "time" ) +// todo: add cluster id as a positional arg where appropriate + func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { if strings.Contains(s, "!~") { split := strings.SplitN(s, "!~", 2) @@ -153,7 +154,9 @@ func BuildImportTargetListCmd() *cobra.Command { Short: "List available targets", Aliases: []string{"ls"}, RunE: func(cmd *cobra.Command, args []string) error { - targetList, err := remoteReadClient.ListTargets(cmd.Context(), &emptypb.Empty{}) + request := &remoteread.TargetListRequest{ClusterId: ""} + + targetList, err := remoteReadClient.ListTargets(cmd.Context(), request) if err != nil { return err } @@ -246,14 +249,48 @@ func BuildImportStartCmd() *cobra.Command { return cmd } +func BuildImportStopCmd() *cobra.Command { + var clusterId string + + cmd := &cobra.Command{ + Use: "start ", + Short: "start", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + targetName := args[0] + + request := &remoteread.StopReadRequest{ + TargetName: targetName, + ClusterId: clusterId, + } + + if _, err := remoteReadClient.Stop(cmd.Context(), request); err != nil { + return err + } + + lg.Infof("import stopped") + + return nil + }, + } + + cmd.Flags().StringVar(&clusterId, "cluster", "", "the id of the cluster") + + ConfigureManagementCommand(cmd) + ConfigureImportCommand(cmd) + + return cmd +} + func BuildImportCmd() *cobra.Command { cmd := &cobra.Command{ Use: "import", Short: "Interact with metrics import plugin APIs", } - cmd.AddCommand(BuildImportStartCmd()) cmd.AddCommand(BuildImportTargetCmd()) + cmd.AddCommand(BuildImportStartCmd()) + cmd.AddCommand(BuildImportStopCmd()) ConfigureManagementCommand(cmd) ConfigureImportCommand(cmd) diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 735a0ccc15..7a98a3673a 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -3,6 +3,7 @@ package agent import ( "context" "fmt" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "sort" "strings" "sync" @@ -26,6 +27,7 @@ import ( type MetricsNode struct { capabilityv1.UnsafeNodeServer controlv1.UnsafeHealthServer + remoteread.UnsafeRemoteReadServer logger *zap.SugaredLogger @@ -38,6 +40,9 @@ type MetricsNode struct { healthListenerClientMu sync.RWMutex healthListenerClient controlv1.HealthListenerClient + remoteReadClientMu sync.RWMutex + remoteReadClient remoteread.RemoteReadClient + configMu sync.RWMutex config *node.MetricsCapabilityConfig @@ -75,6 +80,7 @@ func (m *MetricsNode) sendHealthUpdate() { } } } + func (m *MetricsNode) AddConfigListener(ch chan<- *node.MetricsCapabilityConfig) { m.listeners = append(m.listeners, ch) } @@ -102,6 +108,13 @@ func (m *MetricsNode) SetHealthListenerClient(client controlv1.HealthListenerCli m.sendHealthUpdate() } +func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadClient) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + m.remoteReadClient = client +} + func (m *MetricsNode) Info(_ context.Context, _ *emptypb.Empty) (*capabilityv1.Details, error) { return &capabilityv1.Details{ Name: wellknown.CapabilityMetrics, @@ -204,3 +217,79 @@ func (m *MetricsNode) updateConfig(config *node.MetricsCapabilityConfig) { } } } + +// Start Implements remoteread.RemoteReadServer + +func (m *MetricsNode) AddTarget(ctx context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.AddTarget(ctx, request) +} + +func (m *MetricsNode) EditTarget(ctx context.Context, request *remoteread.TargetEditRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.EditTarget(ctx, request) +} + +func (m *MetricsNode) RemoveTarget(ctx context.Context, request *remoteread.TargetRemoveRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.RemoveTarget(ctx, request) +} + +func (m *MetricsNode) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return nil, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.ListTargets(ctx, request) +} + +func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.Start(ctx, request) +} + +func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.Stop(ctx, request) +} + +// End implement remotread.RemoteReadServer diff --git a/plugins/metrics/pkg/agent/remoteread.go b/plugins/metrics/pkg/agent/remoteread.go index 4f0ac00ee6..b258fcee34 100644 --- a/plugins/metrics/pkg/agent/remoteread.go +++ b/plugins/metrics/pkg/agent/remoteread.go @@ -13,19 +13,19 @@ import ( "time" ) -type RemoteReadClient struct { +type RemoteReaderClient struct { stopChan chan interface{} prometheusClient *http.Client } -func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReadClient { - return &RemoteReadClient{ +func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { + return &RemoteReaderClient{ stopChan: stopChan, prometheusClient: prometheusClient, } } -func (client *RemoteReadClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { +func (client *RemoteReaderClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { uncompressedData, err := proto.Marshal(readRequest) if err != nil { return nil, fmt.Errorf("unable to marshal remote read readRequest: %w", err) diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 5c1345a6cb..bdcd4602a5 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -162,7 +162,7 @@ func (runner *targetRunner) List() *remoteread.TargetList { return &remoteread.TargetList{Targets: targets} } -func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReadClient) { +func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { labelMatchers := toLabelMatchers(run.query.Matchers) // todo: this should probably be a lot more sophisticated than this diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index c3820e2aab..5c938cb44e 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -34,7 +34,10 @@ func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { nodeClient := node.NewNodeMetricsCapabilityClient(cc) healthListenerClient := controlv1.NewHealthListenerClient(cc) identityClient := controlv1.NewIdentityClient(cc) + remoteReadClient := remoteread.NewRemoteReadClient(cc) + p.node.SetNodeClient(nodeClient) p.node.SetHealthListenerClient(healthListenerClient) p.node.SetIdentityClient(identityClient) + p.node.SetRemoteReadClient(remoteReadClient) } diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index bd54f38594..1d43d3dc90 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -83,7 +83,7 @@ type Target struct { Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Meta *TargetMetadata `protobuf:"bytes,3,opt,name=meta,proto3" json:"meta,omitempty"` + Meta *TargetMetadata `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"` } func (x *Target) Reset() { @@ -293,7 +293,8 @@ type TargetAddRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *TargetAddRequest) Reset() { @@ -335,6 +336,13 @@ func (x *TargetAddRequest) GetTarget() *Target { return nil } +func (x *TargetAddRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + type TargetEditRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -342,6 +350,7 @@ type TargetEditRequest struct { TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` TargetDiff *TargetDiff `protobuf:"bytes,2,opt,name=targetDiff,proto3" json:"targetDiff,omitempty"` + ClusterId string `protobuf:"bytes,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *TargetEditRequest) Reset() { @@ -390,12 +399,20 @@ func (x *TargetEditRequest) GetTargetDiff() *TargetDiff { return nil } +func (x *TargetEditRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + type TargetRemoveRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *TargetRemoveRequest) Reset() { @@ -437,19 +454,23 @@ func (x *TargetRemoveRequest) GetTargetName() string { return "" } -type StartReadRequest struct { +func (x *TargetRemoveRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +type TargetListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` - Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp - ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` + ClusterId string `protobuf:"bytes,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } -func (x *StartReadRequest) Reset() { - *x = StartReadRequest{} +func (x *TargetListRequest) Reset() { + *x = TargetListRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -457,13 +478,13 @@ func (x *StartReadRequest) Reset() { } } -func (x *StartReadRequest) String() string { +func (x *TargetListRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*StartReadRequest) ProtoMessage() {} +func (*TargetListRequest) ProtoMessage() {} -func (x *StartReadRequest) ProtoReflect() protoreflect.Message { +func (x *TargetListRequest) ProtoReflect() protoreflect.Message { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -475,42 +496,32 @@ func (x *StartReadRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use StartReadRequest.ProtoReflect.Descriptor instead. -func (*StartReadRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use TargetListRequest.ProtoReflect.Descriptor instead. +func (*TargetListRequest) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} } -func (x *StartReadRequest) GetTargetName() string { +func (x *TargetListRequest) GetClusterId() string { if x != nil { - return x.TargetName + return x.ClusterId } return "" } -func (x *StartReadRequest) GetQuery() *Query { - if x != nil { - return x.Query - } - return nil -} - -func (x *StartReadRequest) GetForceOverlap() bool { - if x != nil { - return x.ForceOverlap - } - return false -} - -type ProgressRequest struct { +type StartReadRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp + ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` + ClusterId string `protobuf:"bytes,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } -func (x *ProgressRequest) Reset() { - *x = ProgressRequest{} +func (x *StartReadRequest) Reset() { + *x = StartReadRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -518,13 +529,13 @@ func (x *ProgressRequest) Reset() { } } -func (x *ProgressRequest) String() string { +func (x *StartReadRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ProgressRequest) ProtoMessage() {} +func (*StartReadRequest) ProtoMessage() {} -func (x *ProgressRequest) ProtoReflect() protoreflect.Message { +func (x *StartReadRequest) ProtoReflect() protoreflect.Message { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -536,24 +547,46 @@ func (x *ProgressRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ProgressRequest.ProtoReflect.Descriptor instead. -func (*ProgressRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use StartReadRequest.ProtoReflect.Descriptor instead. +func (*StartReadRequest) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} } -func (x *ProgressRequest) GetTargetName() string { +func (x *StartReadRequest) GetTargetName() string { if x != nil { return x.TargetName } return "" } +func (x *StartReadRequest) GetQuery() *Query { + if x != nil { + return x.Query + } + return nil +} + +func (x *StartReadRequest) GetForceOverlap() bool { + if x != nil { + return x.ForceOverlap + } + return false +} + +func (x *StartReadRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + type StopReadRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *StopReadRequest) Reset() { @@ -595,6 +628,13 @@ func (x *StopReadRequest) GetTargetName() string { return "" } +func (x *StopReadRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + // PromQL query type Query struct { state protoimpl.MessageState @@ -807,7 +847,7 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x5a, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, @@ -822,101 +862,113 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x3e, 0x0a, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x6b, 0x0a, - 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x35, 0x0a, 0x13, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x11, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x7f, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, - 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, - 0x61, 0x70, 0x22, 0x31, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, 0x01, 0x0a, - 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, - 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, - 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, - 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, - 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, - 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, - 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0x98, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x61, 0x64, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x72, + 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x53, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x11, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x9d, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, + 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, + 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x4f, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, + 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, + 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, + 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, + 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, + 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, + 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xbf, 0x03, + 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x12, 0x61, 0x0a, 0x09, + 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x16, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x12, + 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, + 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, + 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -942,8 +994,8 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ (*TargetAddRequest)(nil), // 5: remoteread.TargetAddRequest (*TargetEditRequest)(nil), // 6: remoteread.TargetEditRequest (*TargetRemoveRequest)(nil), // 7: remoteread.TargetRemoveRequest - (*StartReadRequest)(nil), // 8: remoteread.StartReadRequest - (*ProgressRequest)(nil), // 9: remoteread.ProgressRequest + (*TargetListRequest)(nil), // 8: remoteread.TargetListRequest + (*StartReadRequest)(nil), // 9: remoteread.StartReadRequest (*StopReadRequest)(nil), // 10: remoteread.StopReadRequest (*Query)(nil), // 11: remoteread.Query (*LabelMatcher)(nil), // 12: remoteread.LabelMatcher @@ -967,8 +1019,8 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 5, // 12: remoteread.RemoteRead.AddTarget:input_type -> remoteread.TargetAddRequest 6, // 13: remoteread.RemoteRead.EditTarget:input_type -> remoteread.TargetEditRequest 7, // 14: remoteread.RemoteRead.RemoveTarget:input_type -> remoteread.TargetRemoveRequest - 15, // 15: remoteread.RemoteRead.ListTargets:input_type -> google.protobuf.Empty - 8, // 16: remoteread.RemoteRead.Start:input_type -> remoteread.StartReadRequest + 8, // 15: remoteread.RemoteRead.ListTargets:input_type -> remoteread.TargetListRequest + 9, // 16: remoteread.RemoteRead.Start:input_type -> remoteread.StartReadRequest 10, // 17: remoteread.RemoteRead.Stop:input_type -> remoteread.StopReadRequest 15, // 18: remoteread.RemoteRead.AddTarget:output_type -> google.protobuf.Empty 15, // 19: remoteread.RemoteRead.EditTarget:output_type -> google.protobuf.Empty @@ -1074,7 +1126,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReadRequest); i { + switch v := v.(*TargetListRequest); i { case 0: return &v.state case 1: @@ -1086,7 +1138,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProgressRequest); i { + switch v := v.(*StartReadRequest); i { case 0: return &v.state case 1: diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go index ccebb8bf06..3bb59865db 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go @@ -73,7 +73,7 @@ func local_request_RemoteRead_AddTarget_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRemoteReadHandlerFromEndpoint instead. func RegisterRemoteReadHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RemoteReadServer) error { - mux.Handle("GET", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -81,7 +81,7 @@ func RegisterRemoteReadHandlerServer(ctx context.Context, mux *runtime.ServeMux, inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/metrics/remoteread/target/add")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/remoteread/target/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -139,13 +139,13 @@ func RegisterRemoteReadHandler(ctx context.Context, mux *runtime.ServeMux, conn // "RemoteReadClient" to call the correct interceptors. func RegisterRemoteReadHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RemoteReadClient) error { - mux.Handle("GET", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/metrics/remoteread/target/add")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/remoteread/target/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -165,7 +165,7 @@ func RegisterRemoteReadHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_RemoteRead_AddTarget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"metrics", "remoteread", "target", "add"}, "")) + pattern_RemoteRead_AddTarget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"remoteread", "target", "add"}, "")) ) var ( diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index 4fa1f38bb2..b7d2d8a4cd 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -14,10 +14,15 @@ service RemoteRead { // rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); // rpc Describe(Target) returns (Target); - rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); + rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/remoteread/target/add" + }; + } + rpc EditTarget(TargetEditRequest) returns (google.protobuf.Empty); rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); - rpc ListTargets(google.protobuf.Empty) returns (TargetList); + rpc ListTargets(TargetListRequest) returns (TargetList); rpc Start(StartReadRequest) returns (google.protobuf.Empty); // rpc GetProgress(ProgressRequest) returns (stream Progress); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); @@ -26,7 +31,7 @@ service RemoteRead { message Target { string endpoint = 1; string name = 2; - TargetMetadata meta = 3; + TargetMetadata meta = 4; } message TargetMetadata { @@ -44,15 +49,22 @@ message TargetList { message TargetAddRequest { Target target = 1; + string clusterId = 2; } message TargetEditRequest { string targetName = 1; TargetDiff targetDiff = 2; + string clusterId = 3; } message TargetRemoveRequest { string targetName = 1; + string clusterId = 2; +} + +message TargetListRequest { + string clusterId = 1; } message StartReadRequest { @@ -61,14 +73,19 @@ message StartReadRequest { // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp bool forceOverlap = 3; -} -message ProgressRequest { - string targetName = 1; + string clusterId = 4; } +//message ProgressRequest { +// string targetName = 1; +// string clusterId = 2; +// +//} + message StopReadRequest { string targetName = 1; + string clusterId = 2; } // PromQL query diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index 929847b92b..f8163f0bd5 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -26,7 +26,7 @@ type RemoteReadClient interface { AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TargetList, error) + ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // rpc GetProgress(ProgressRequest) returns (stream Progress); Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -67,7 +67,7 @@ func (c *remoteReadClient) RemoveTarget(ctx context.Context, in *TargetRemoveReq return out, nil } -func (c *remoteReadClient) ListTargets(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TargetList, error) { +func (c *remoteReadClient) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) { out := new(TargetList) err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/ListTargets", in, out, opts...) if err != nil { @@ -101,7 +101,7 @@ type RemoteReadServer interface { AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) - ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) + ListTargets(context.Context, *TargetListRequest) (*TargetList, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) // rpc GetProgress(ProgressRequest) returns (stream Progress); Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) @@ -121,7 +121,7 @@ func (UnimplementedRemoteReadServer) EditTarget(context.Context, *TargetEditRequ func (UnimplementedRemoteReadServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveTarget not implemented") } -func (UnimplementedRemoteReadServer) ListTargets(context.Context, *emptypb.Empty) (*TargetList, error) { +func (UnimplementedRemoteReadServer) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented") } func (UnimplementedRemoteReadServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { @@ -198,7 +198,7 @@ func _RemoteRead_RemoveTarget_Handler(srv interface{}, ctx context.Context, dec } func _RemoteRead_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) + in := new(TargetListRequest) if err := dec(in); err != nil { return nil, err } @@ -210,7 +210,7 @@ func _RemoteRead_ListTargets_Handler(srv interface{}, ctx context.Context, dec f FullMethod: "/remoteread.RemoteRead/ListTargets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).ListTargets(ctx, req.(*emptypb.Empty)) + return srv.(RemoteReadServer).ListTargets(ctx, req.(*TargetListRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 10de91b1d8..1669af4edd 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,6 +3,7 @@ package backend import ( "context" "fmt" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "strings" "sync" @@ -35,6 +36,7 @@ type MetricsBackend struct { capabilityv1.UnsafeBackendServer node.UnsafeNodeMetricsCapabilityServer cortexops.UnsafeCortexOpsServer + remoteread.UnsafeRemoteReadServer MetricsBackendConfig nodeStatusMu sync.RWMutex @@ -48,12 +50,14 @@ type MetricsBackend struct { var _ node.NodeMetricsCapabilityServer = (*MetricsBackend)(nil) var _ cortexops.CortexOpsServer = (*MetricsBackend)(nil) +var _ remoteread.RemoteReadServer = (*MetricsBackend)(nil) type MetricsBackendConfig struct { Logger *zap.SugaredLogger `validate:"required"` StorageBackend storage.Backend `validate:"required"` MgmtClient managementv1.ManagementClient `validate:"required"` NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` + RemoteReadClient remoteread.RemoteReadClient `validate:"required"` UninstallController *task.Controller `validate:"required"` ClusterDriver drivers.ClusterDriver `validate:"required"` } @@ -408,3 +412,166 @@ func (m *MetricsBackend) UninstallCluster(ctx context.Context, in *emptypb.Empty defer m.requestNodeSync(ctx, &corev1.Reference{}) return m.ClusterDriver.UninstallCluster(ctx, in) } + +// Metrics Remote Read Backend + +func (m *MetricsBackend) AddTarget(ctx context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { + _, err := m.RemoteReadClient.AddTarget(ctx, request) + + clusterId := request.ClusterId + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.Target.Name, + zap.Error(err), + ).Warn("failed to create target") + + return nil, err + } + + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.Target.Name, + ).Info("target created") + + return nil, nil +} + +func (m *MetricsBackend) EditTarget(ctx context.Context, request *remoteread.TargetEditRequest) (*emptypb.Empty, error) { + _, err := m.RemoteReadClient.EditTarget(ctx, request) + + clusterId := request.ClusterId + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + zap.Error(err), + ).Warn("failed to edit target") + + return nil, err + } + + // todo: we might want to display the new name if it was changed + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + ).Info("target edited") + + return nil, nil +} + +func (m *MetricsBackend) RemoveTarget(ctx context.Context, request *remoteread.TargetRemoveRequest) (*emptypb.Empty, error) { + _, err := m.RemoteReadClient.RemoveTarget(ctx, request) + + clusterId := request.ClusterId + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + zap.Error(err), + ).Warn("failed to remove target") + + return nil, err + } + + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + ).Info("target remove") + + return nil, nil +} + +func (m *MetricsBackend) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { + list, err := m.RemoteReadClient.ListTargets(ctx, request) + + clusterId := request.ClusterId + if clusterId == "" { + clusterId = "(all)" + } + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + zap.Error(err), + ).Warn("failed to list targets") + + return nil, err + } + + // todo: we might want to display the new name if it was changed + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + ).Info("targets listed") + + return list, nil +} + +func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { + _, err := m.RemoteReadClient.Start(ctx, request) + + clusterId := request.TargetName + if clusterId == "" { + clusterId = "(all)" + } + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + zap.Error(err), + ).Warn("failed to start client") + + return nil, err + } + + // todo: we might want to display the new name if it was changed + m.Logger.With( + "cluster", clusterId, + "target", request.TargetName, + "capability", wellknown.CapabilityMetrics, + ).Info("target started") + + return nil, nil +} + +func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { + _, err := m.RemoteReadClient.Stop(ctx, request) + + clusterId := request.TargetName + if clusterId == "" { + clusterId = "(all)" + } + + if err != nil { + m.Logger.With( + "cluster", clusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.TargetName, + zap.Error(err), + ).Warn("failed to stop client") + + return nil, err + } + + // todo: we might want to display the new name if it was changed + m.Logger.With( + "cluster", clusterId, + "target", request.TargetName, + "capability", wellknown.CapabilityMetrics, + ).Info("target stopped") + + return nil, nil +} diff --git a/plugins/metrics/pkg/cortex/api.go b/plugins/metrics/pkg/cortex/api.go index 07c08f1881..6c76ce7aba 100644 --- a/plugins/metrics/pkg/cortex/api.go +++ b/plugins/metrics/pkg/cortex/api.go @@ -81,7 +81,6 @@ func (p *HttpApiServer) ConfigureRoutes(router *gin.Engine) { QueryFrontend: fwd.To(p.Config.Cortex.QueryFrontend.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("query-frontend")), Alertmanager: fwd.To(p.Config.Cortex.Alertmanager.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("alertmanager")), Ruler: fwd.To(p.Config.Cortex.Ruler.HTTPAddress, fwd.WithLogger(p.Logger), fwd.WithTLS(p.CortexTLSConfig), fwd.WithName("ruler")), - RemoteRead: fwd.To(p.Config.RemoteRead.HttpAddress, fwd.WithLogger(p.Logger), fwd.WithName("remote-read")), } mws := &middlewares{ @@ -153,12 +152,12 @@ func (p *HttpApiServer) configureQueryFrontend(router *gin.Engine, f *forwarders } } -func (p *HttpApiServer) configureImport(router *gin.Engine, f *forwarders, m *middlewares) { - router.POST("/api/remoteread/target/add", f.RemoteRead) - router.PATCH("/api/remoteread/target/edit", f.RemoteRead) - router.DELETE("/api/remoteread/target/remove", f.RemoteRead) - router.GET("/api/remoteread/target/list", f.RemoteRead) - - router.POST("/api/remoteread/start", f.RemoteRead) - router.POST("/api/remoteread/stop", f.RemoteRead) -} +//func (p *HttpApiServer) configureImport(router *gin.Engine, f *forwarders, m *middlewares) { +// router.POST("/api/remoteread/target/add", f.RemoteRead) +// router.PATCH("/api/remoteread/target/edit", f.RemoteRead) +// router.DELETE("/api/remoteread/target/remove", f.RemoteRead) +// router.GET("/api/remoteread/target/list", f.RemoteRead) +// +// router.POST("/api/remoteread/start", f.RemoteRead) +// router.POST("/api/remoteread/stop", f.RemoteRead) +//} diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index 1437a56d54..d65abdc5fc 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -22,6 +22,7 @@ import ( "github.com/rancher/opni/pkg/util/future" "github.com/rancher/opni/plugins/metrics/pkg/apis/cortexadmin" "github.com/rancher/opni/plugins/metrics/pkg/apis/cortexops" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/backend" "github.com/rancher/opni/plugins/metrics/pkg/cortex" "github.com/rancher/opni/plugins/metrics/pkg/gateway/drivers" @@ -29,7 +30,6 @@ import ( ) type Plugin struct { - // capabilityv1.UnsafeBackendServer system.UnimplementedSystemPluginClient collector.CollectorServer @@ -48,6 +48,7 @@ type Plugin struct { mgmtClient future.Future[managementv1.ManagementClient] nodeManagerClient future.Future[capabilityv1.NodeManagerClient] storageBackend future.Future[storage.Backend] + remoteReadClient future.Future[remoteread.RemoteReadClient] cortexTlsConfig future.Future[*tls.Config] cortexClientSet future.Future[cortex.ClientSet] uninstallController future.Future[*task.Controller] @@ -67,6 +68,7 @@ func NewPlugin(ctx context.Context) *Plugin { mgmtClient: future.New[managementv1.ManagementClient](), nodeManagerClient: future.New[capabilityv1.NodeManagerClient](), storageBackend: future.New[storage.Backend](), + remoteReadClient: future.New[remoteread.RemoteReadClient](), cortexTlsConfig: future.New[*tls.Config](), cortexClientSet: future.New[cortex.ClientSet](), uninstallController: future.New[*task.Controller](), @@ -100,13 +102,14 @@ func NewPlugin(ctx context.Context) *Plugin { }) }) - future.Wait5(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, + future.Wait6(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, p.remoteReadClient, func( storageBackend storage.Backend, mgmtClient managementv1.ManagementClient, nodeManagerClient capabilityv1.NodeManagerClient, uninstallController *task.Controller, clusterDriver drivers.ClusterDriver, + remoteReadClient remoteread.RemoteReadClient, ) { p.metrics.Initialize(backend.MetricsBackendConfig{ Logger: p.logger.Named("metrics-backend"), @@ -115,6 +118,7 @@ func NewPlugin(ctx context.Context) *Plugin { NodeManagerClient: nodeManagerClient, UninstallController: uninstallController, ClusterDriver: clusterDriver, + RemoteReadClient: remoteReadClient, }) }) diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index 013812d173..b682a41803 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -17,7 +17,7 @@ func (p *Plugin) StreamServers() []streamext.Server { }, { Desc: &remoteread.RemoteRead_ServiceDesc, - Impl: &p.cortexRemoteWrite, + Impl: &p.metrics, RequireCapability: wellknown.CapabilityMetrics, }, { From 3a97a5174029bb16511aafa0c0100d4d60c415c0 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Fri, 16 Dec 2022 16:38:09 -0500 Subject: [PATCH 05/43] refractor target --- .../pkg/apis/remoteread/remoteread.pb.gw.go | 173 ------------------ 1 file changed, 173 deletions(-) delete mode 100644 plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go deleted file mode 100644 index 3bb59865db..0000000000 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.gw.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto - -/* -Package remoteread is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package remoteread - -import ( - "context" - "io" - "net/http" - - "github.com/kralicky/grpc-gateway/v2/runtime" - "github.com/kralicky/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - -var ( - filter_RemoteRead_AddTarget_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RemoteRead_AddTarget_0(ctx context.Context, marshaler runtime.Marshaler, client RemoteReadClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TargetAddRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RemoteRead_AddTarget_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AddTarget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RemoteRead_AddTarget_0(ctx context.Context, marshaler runtime.Marshaler, server RemoteReadServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TargetAddRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RemoteRead_AddTarget_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AddTarget(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterRemoteReadHandlerServer registers the http handlers for service RemoteRead to "mux". -// UnaryRPC :call RemoteReadServer 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 RegisterRemoteReadHandlerFromEndpoint instead. -func RegisterRemoteReadHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RemoteReadServer) error { - - mux.Handle("POST", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/remoteread/target/add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RemoteRead_AddTarget_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_RemoteRead_AddTarget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterRemoteReadHandlerFromEndpoint is same as RegisterRemoteReadHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRemoteReadHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRemoteReadHandler(ctx, mux, conn) -} - -// RegisterRemoteReadHandler registers the http handlers for service RemoteRead to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRemoteReadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRemoteReadHandlerClient(ctx, mux, NewRemoteReadClient(conn)) -} - -// RegisterRemoteReadHandlerClient registers the http handlers for service RemoteRead -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RemoteReadClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RemoteReadClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RemoteReadClient" to call the correct interceptors. -func RegisterRemoteReadHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RemoteReadClient) error { - - mux.Handle("POST", pattern_RemoteRead_AddTarget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/remoteread.RemoteRead/AddTarget", runtime.WithHTTPPathPattern("/remoteread/target/add")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RemoteRead_AddTarget_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_RemoteRead_AddTarget_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_RemoteRead_AddTarget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"remoteread", "target", "add"}, "")) -) - -var ( - forward_RemoteRead_AddTarget_0 = runtime.ForwardResponseMessage -) From 38b3d15aa0d8b25ee9ddf49ea266a8d305797ce6 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:29:09 -0500 Subject: [PATCH 06/43] refractor target --- pkg/opni/commands/import.go | 89 ++- pkg/opni/commands/setup_import.go | 2 +- plugins/metrics/pkg/agent/http.go | 114 +-- plugins/metrics/pkg/agent/node.go | 110 +-- plugins/metrics/pkg/agent/runner.go | 74 +- plugins/metrics/pkg/agent/stream.go | 4 +- plugins/metrics/pkg/apis/remoteread/client.go | 15 +- .../pkg/apis/remoteread/remoteread.pb.go | 692 ++++++++++-------- .../pkg/apis/remoteread/remoteread.proto | 59 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 264 +++++-- plugins/metrics/pkg/backend/metrics.go | 200 ++--- plugins/metrics/pkg/backend/remoteread.go | 21 + plugins/metrics/pkg/cortex/api.go | 10 - plugins/metrics/pkg/gateway/plugin.go | 8 +- plugins/metrics/pkg/gateway/stream.go | 4 +- 15 files changed, 854 insertions(+), 812 deletions(-) create mode 100644 plugins/metrics/pkg/backend/remoteread.go diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 5425a78253..ed615423a3 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -52,24 +52,22 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { func BuildImportTargetAddCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "add [name]", + Use: "add ", Short: "Add a new target", - Args: cobra.RangeArgs(1, 2), + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { - var target *remoteread.Target - - switch len(args) { - case 1: - target = &remoteread.Target{ - Name: args[0], - Endpoint: args[0], - } - case 2: - // todo: might be worthwhile pulling just the hostname from the given endpoint - target = &remoteread.Target{ - Name: args[1], - Endpoint: args[0], - } + clusterId := args[0] + targetName := args[2] + endpoint := args[2] + + target := &remoteread.Target{ + Meta: &remoteread.TargetMeta{ + ClusterId: clusterId, + Name: targetName, + }, + Spec: &remoteread.TargetSpec{ + Endpoint: endpoint, + }, } request := &remoteread.TargetAddRequest{ @@ -102,10 +100,16 @@ func BuildImportTargetEditCmd() *cobra.Command { lg.Infof("no edits specified, doing nothing") } - request := &remoteread.TargetEditRequest{TargetDiff: &remoteread.TargetDiff{ - Endpoint: newEndpoint, - Name: newName, - }} + request := &remoteread.TargetEditRequest{ + Meta: &remoteread.TargetMeta{ + ClusterId: args[0], + Name: args[1], + }, + TargetDiff: &remoteread.TargetDiff{ + Endpoint: newEndpoint, + Name: newName, + }, + } _, err := remoteReadClient.EditTarget(cmd.Context(), request) @@ -127,12 +131,17 @@ func BuildImportTargetEditCmd() *cobra.Command { func BuildImportTargetRemoveCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "remove ", + Use: "remove ", Short: "Remove a target", Aliases: []string{"rm"}, - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { - request := &remoteread.TargetRemoveRequest{TargetName: args[0]} + request := &remoteread.TargetRemoveRequest{ + Meta: &remoteread.TargetMeta{ + ClusterId: args[0], + Name: args[1], + }, + } _, err := remoteReadClient.RemoveTarget(cmd.Context(), request) @@ -161,6 +170,10 @@ func BuildImportTargetListCmd() *cobra.Command { return err } + if targetList == nil { + return fmt.Errorf("received list is nil") + } + fmt.Println(cliutil.RenderTargetList(targetList)) return nil @@ -190,15 +203,15 @@ func BuildImportStartCmd() *cobra.Command { var labelFilters []string var startTimestamp int64 var endTimestamp int64 - var clusterId string var forceOverlap bool cmd := &cobra.Command{ - Use: "start ", + Use: "start ", Short: "start", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - targetName := args[0] + clusterId := args[0] + targetName := args[1] labelMatchers := make([]*remoteread.LabelMatcher, len(labelFilters)) for _, labelFilter := range labelFilters { @@ -218,7 +231,10 @@ func BuildImportStartCmd() *cobra.Command { } request := &remoteread.StartReadRequest{ - TargetName: targetName, + Meta: &remoteread.TargetMeta{ + ClusterId: clusterId, + Name: targetName, + }, Query: query, ForceOverlap: forceOverlap, } @@ -233,8 +249,6 @@ func BuildImportStartCmd() *cobra.Command { }, } - cmd.Flags().StringVar(&clusterId, "cluster", "", "the id of the cluster") - cmd.Flags().StringSliceVar(&labelFilters, "filters", []string{"__name__=~\".+\""}, "promql query for the thing") // todo: we probably want to allow for more human readable timestamps here @@ -250,18 +264,19 @@ func BuildImportStartCmd() *cobra.Command { } func BuildImportStopCmd() *cobra.Command { - var clusterId string - cmd := &cobra.Command{ - Use: "start ", - Short: "start", + Use: "stop ", + Short: "stop", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - targetName := args[0] + clusterId := args[0] + targetName := args[1] request := &remoteread.StopReadRequest{ - TargetName: targetName, - ClusterId: clusterId, + Meta: &remoteread.TargetMeta{ + ClusterId: clusterId, + Name: targetName, + }, } if _, err := remoteReadClient.Stop(cmd.Context(), request); err != nil { @@ -274,8 +289,6 @@ func BuildImportStopCmd() *cobra.Command { }, } - cmd.Flags().StringVar(&clusterId, "cluster", "", "the id of the cluster") - ConfigureManagementCommand(cmd) ConfigureImportCommand(cmd) diff --git a/pkg/opni/commands/setup_import.go b/pkg/opni/commands/setup_import.go index c826664848..16bfda4ab9 100644 --- a/pkg/opni/commands/setup_import.go +++ b/pkg/opni/commands/setup_import.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" ) -var remoteReadClient remoteread.RemoteReadClient +var remoteReadClient remoteread.RemoteReadGatewayClient func ConfigureImportCommand(cmd *cobra.Command) { if cmd.PersistentPreRunE == nil { diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index d97ef2a430..da3a75d170 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -79,11 +79,6 @@ func (s *HttpServer) ConfigureRoutes(router *gin.Engine) { router.POST("/api/agent/push", s.handleMetricPushRequest) pprof.Register(router, "/debug/plugin_metrics/pprof") - router.POST("/api/remoteread/target/add", s.handleTargetAdd) - router.PATCH("/api/remoteread/target/edit", s.handleTargetEdit) - router.DELETE("/api/remoteread/target/remove", s.handleTargetRemove) - router.GET("/api/remoteread/target/list", s.handleTargetList) - router.GET("/api/remoteread/start", s.handleRemoteReadStart) router.GET("/api/remoteread/stop", s.handleRemoteReadStop) } @@ -161,111 +156,6 @@ func (s *HttpServer) handleMetricPushRequest(c *gin.Context) { } } -func (s *HttpServer) handleTargetAdd(c *gin.Context) { - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - buf := bytebufferpool.Get() - if _, err := buf.ReadFrom(c.Request.Body); err != nil { - c.Status(http.StatusInternalServerError) - return - } - - var request remoteread.TargetAddRequest - if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - target := request.Target - - s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Add(target); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - c.Status(http.StatusOK) - }) -} - -func (s *HttpServer) handleTargetEdit(c *gin.Context) { - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - buf := bytebufferpool.Get() - if _, err := buf.ReadFrom(c.Request.Body); err != nil { - c.Status(http.StatusInternalServerError) - return - } - - var request remoteread.TargetEditRequest - if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - targetName := request.TargetName - diff := request.TargetDiff - - s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Edit(targetName, diff); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - } - - c.Status(http.StatusOK) - }) -} - -func (s *HttpServer) handleTargetRemove(c *gin.Context) { - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - buf := bytebufferpool.Get() - if _, err := buf.ReadFrom(c.Request.Body); err != nil { - c.Status(http.StatusInternalServerError) - return - } - - var request remoteread.TargetRemoveRequest - if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Remove(request.TargetName); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - c.Status(http.StatusOK) - }) -} - -func (s *HttpServer) handleTargetList(c *gin.Context) { - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - s.targetRunner.Use(func(runner TargetRunner) { - c.ProtoBuf(http.StatusOK, runner.List()) - }) -} - func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { if !s.enabled.Load() { c.Status(http.StatusServiceUnavailable) @@ -286,7 +176,7 @@ func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { } s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Start(request.TargetName, request.Query); err != nil { + if err := runner.Start(request.Meta.Name, request.Query); err != nil { c.Status(http.StatusBadRequest) c.Error(err) return @@ -316,7 +206,7 @@ func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { } s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Stop(request.TargetName); err != nil { + if err := runner.Stop(request.Meta.Name); err != nil { c.Status(http.StatusBadRequest) c.Error(err) return diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 7a98a3673a..0d73d1eae9 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -27,7 +27,7 @@ import ( type MetricsNode struct { capabilityv1.UnsafeNodeServer controlv1.UnsafeHealthServer - remoteread.UnsafeRemoteReadServer + remoteread.UnsafeRemoteReadAgentServer logger *zap.SugaredLogger @@ -41,7 +41,7 @@ type MetricsNode struct { healthListenerClient controlv1.HealthListenerClient remoteReadClientMu sync.RWMutex - remoteReadClient remoteread.RemoteReadClient + remoteReadClient remoteread.RemoteReadAgentClient configMu sync.RWMutex config *node.MetricsCapabilityConfig @@ -108,7 +108,7 @@ func (m *MetricsNode) SetHealthListenerClient(client controlv1.HealthListenerCli m.sendHealthUpdate() } -func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadClient) { +func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadAgentClient) { m.remoteReadClientMu.Lock() defer m.remoteReadClientMu.Unlock() @@ -124,6 +124,7 @@ func (m *MetricsNode) Info(_ context.Context, _ *emptypb.Empty) (*capabilityv1.D } // Implements capabilityv1.NodeServer + func (m *MetricsNode) SyncNow(_ context.Context, req *capabilityv1.Filter) (*emptypb.Empty, error) { if len(req.CapabilityNames) > 0 { if !slices.Contains(req.CapabilityNames, wellknown.CapabilityMetrics) { @@ -148,6 +149,7 @@ func (m *MetricsNode) SyncNow(_ context.Context, req *capabilityv1.Filter) (*emp } // Implements controlv1.HealthServer + func (m *MetricsNode) GetHealth(_ context.Context, _ *emptypb.Empty) (*corev1.Health, error) { m.configMu.RLock() defer m.configMu.RUnlock() @@ -162,6 +164,32 @@ func (m *MetricsNode) GetHealth(_ context.Context, _ *emptypb.Empty) (*corev1.He }, nil } +// Start Implements remoteread.RemoteReadServer + +func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.Start(ctx, request) +} + +func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.Stop(ctx, request) +} + func (m *MetricsNode) doSync(ctx context.Context) { m.logger.Debug("syncing metrics node") m.nodeClientMu.RLock() @@ -217,79 +245,3 @@ func (m *MetricsNode) updateConfig(config *node.MetricsCapabilityConfig) { } } } - -// Start Implements remoteread.RemoteReadServer - -func (m *MetricsNode) AddTarget(ctx context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.AddTarget(ctx, request) -} - -func (m *MetricsNode) EditTarget(ctx context.Context, request *remoteread.TargetEditRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.EditTarget(ctx, request) -} - -func (m *MetricsNode) RemoveTarget(ctx context.Context, request *remoteread.TargetRemoveRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.RemoveTarget(ctx, request) -} - -func (m *MetricsNode) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return nil, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.ListTargets(ctx, request) -} - -func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.Start(ctx, request) -} - -func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") - } - - return m.remoteReadClient.Stop(ctx, request) -} - -// End implement remotread.RemoteReadServer diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index bdcd4602a5..46a6a76c70 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -14,10 +14,6 @@ import ( "time" ) -func targetAlreadyExistsError(name string) error { - return fmt.Errorf("target '%s' already exists", name) -} - func targetDoesNotExistError(name string) error { return fmt.Errorf("target '%s' does not exist", name) } @@ -30,7 +26,7 @@ func targetIsNotRunningError(name string) error { return fmt.Errorf("target '%s' is not running", name) } -// todo: import prometheus LabelMatcher into apis/remoteread.proto to remove this +// todo: import prometheus LabelMatcher into plugins/metrics/pkg/apis/remoteread.proto to remove this func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) @@ -77,14 +73,6 @@ type Run struct { } type TargetRunner interface { - Add(target *remoteread.Target) error - - Edit(name string, diff *remoteread.TargetDiff) error - - Remove(name string) error - - List() *remoteread.TargetList - Start(name string, query *remoteread.Query) error Stop(name string) error @@ -106,62 +94,6 @@ type targetRunner struct { remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] } -func (runner *targetRunner) Add(target *remoteread.Target) error { - if _, found := runner.targets[target.Name]; found { - return targetAlreadyExistsError(target.Name) - } - - runner.targets[target.Name] = target - - return nil -} - -func (runner *targetRunner) Edit(name string, diff *remoteread.TargetDiff) error { - target, found := runner.targets[name] - - if !found { - return targetDoesNotExistError(target.Name) - } - - if _, found := runner.runs[name]; found { - return targetIsRunningError(name) - } - - if diff.Endpoint != "" { - target.Endpoint = diff.Endpoint - } - - if diff.Name != "" { - target.Name = diff.Name - - delete(runner.targets, name) - } - - runner.targets[target.Name] = target - - return nil -} - -func (runner *targetRunner) Remove(name string) error { - if _, found := runner.targets[name]; !found { - return targetDoesNotExistError(name) - } - - delete(runner.targets, name) - - return nil -} - -func (runner *targetRunner) List() *remoteread.TargetList { - targets := make([]*remoteread.Target, 0, len(runner.targets)) - - for _, target := range runner.targets { - targets = append(targets, target) - } - - return &remoteread.TargetList{Targets: targets} -} - func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { labelMatchers := toLabelMatchers(run.query.Matchers) @@ -187,7 +119,7 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { }, } - readResponse, err := remoteReadClient.Read(context.TODO(), run.target.Endpoint, readRequest) + readResponse, err := remoteReadClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) if err != nil { // todo: log this event @@ -237,7 +169,7 @@ func (runner *targetRunner) Start(name string, query *remoteread.Query) error { query: query, } - prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Name), promConfig.WithHTTP2Disabled()) + prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Meta.Name), promConfig.WithHTTP2Disabled()) if err != nil { return fmt.Errorf("could not start import: %w", err) } diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index 5c938cb44e..6825a549b2 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -18,7 +18,7 @@ func (p *Plugin) StreamServers() []streamext.Server { Impl: p.node, }, { - Desc: &remoteread.RemoteRead_ServiceDesc, + Desc: &remoteread.RemoteReadGateway_ServiceDesc, Impl: p.node, }, } @@ -34,7 +34,7 @@ func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { nodeClient := node.NewNodeMetricsCapabilityClient(cc) healthListenerClient := controlv1.NewHealthListenerClient(cc) identityClient := controlv1.NewIdentityClient(cc) - remoteReadClient := remoteread.NewRemoteReadClient(cc) + remoteReadClient := remoteread.NewRemoteReadAgentClient(cc) p.node.SetNodeClient(nodeClient) p.node.SetHealthListenerClient(healthListenerClient) diff --git a/plugins/metrics/pkg/apis/remoteread/client.go b/plugins/metrics/pkg/apis/remoteread/client.go index 71519724eb..dee51f0e2b 100644 --- a/plugins/metrics/pkg/apis/remoteread/client.go +++ b/plugins/metrics/pkg/apis/remoteread/client.go @@ -3,7 +3,6 @@ package remoteread import ( "fmt" "github.com/rancher/opni/pkg/util/waitctx" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -12,9 +11,6 @@ import ( type ClientOptions struct { listenAddr string dialOptions []grpc.DialOption - - //clients.Locker[remotewrite.RemoteWriteClient] - remoteWriteClient remotewrite.RemoteWriteClient } type ClientOption func(*ClientOptions) @@ -37,14 +33,7 @@ func WithDialOptions(options ...grpc.DialOption) ClientOption { } } -func WithRemoteWriteClient(client remotewrite.RemoteWriteClient) ClientOption { - return func(opt *ClientOptions) { - opt.remoteWriteClient = client - } -} - -func NewClient(ctx waitctx.PermissiveContext, opts ...ClientOption) (RemoteReadClient, error) { - // todo: figure out remote read gateway address +func NewClient(ctx waitctx.PermissiveContext, opts ...ClientOption) (RemoteReadGatewayClient, error) { options := ClientOptions{ dialOptions: []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), @@ -65,5 +54,5 @@ func NewClient(ctx waitctx.PermissiveContext, opts ...ClientOption) (RemoteReadC connection.Close() }) - return NewRemoteReadClient(connection), nil + return NewRemoteReadGatewayClient(connection), nil } diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 1d43d3dc90..5183eb587b 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -73,7 +73,7 @@ func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { // Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11, 0} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13, 0} } type Target struct { @@ -81,9 +81,9 @@ type Target struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Meta *TargetMetadata `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"` + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + Spec *TargetSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + Status *TargetStatus `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` } func (x *Target) Reset() { @@ -118,37 +118,38 @@ func (*Target) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{0} } -func (x *Target) GetEndpoint() string { +func (x *Target) GetMeta() *TargetMeta { if x != nil { - return x.Endpoint + return x.Meta } - return "" + return nil } -func (x *Target) GetName() string { +func (x *Target) GetSpec() *TargetSpec { if x != nil { - return x.Name + return x.Spec } - return "" + return nil } -func (x *Target) GetMeta() *TargetMetadata { +func (x *Target) GetStatus() *TargetStatus { if x != nil { - return x.Meta + return x.Status } return nil } -type TargetMetadata struct { +type TargetMeta struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } -func (x *TargetMetadata) Reset() { - *x = TargetMetadata{} +func (x *TargetMeta) Reset() { + *x = TargetMeta{} if protoimpl.UnsafeEnabled { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -156,13 +157,13 @@ func (x *TargetMetadata) Reset() { } } -func (x *TargetMetadata) String() string { +func (x *TargetMeta) String() string { return protoimpl.X.MessageStringOf(x) } -func (*TargetMetadata) ProtoMessage() {} +func (*TargetMeta) ProtoMessage() {} -func (x *TargetMetadata) ProtoReflect() protoreflect.Message { +func (x *TargetMeta) ProtoReflect() protoreflect.Message { mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -174,18 +175,119 @@ func (x *TargetMetadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use TargetMetadata.ProtoReflect.Descriptor instead. -func (*TargetMetadata) Descriptor() ([]byte, []int) { +// Deprecated: Use TargetMeta.ProtoReflect.Descriptor instead. +func (*TargetMeta) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{1} } -func (x *TargetMetadata) GetLastReadTimestamp() *timestamppb.Timestamp { +func (x *TargetMeta) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TargetMeta) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +type TargetStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` +} + +func (x *TargetStatus) Reset() { + *x = TargetStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetStatus) ProtoMessage() {} + +func (x *TargetStatus) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetStatus.ProtoReflect.Descriptor instead. +func (*TargetStatus) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2} +} + +func (x *TargetStatus) GetLastReadTimestamp() *timestamppb.Timestamp { if x != nil { return x.LastReadTimestamp } return nil } +type TargetSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` +} + +func (x *TargetSpec) Reset() { + *x = TargetSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetSpec) ProtoMessage() {} + +func (x *TargetSpec) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetSpec.ProtoReflect.Descriptor instead. +func (*TargetSpec) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{3} +} + +func (x *TargetSpec) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + type TargetDiff struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -198,7 +300,7 @@ type TargetDiff struct { func (x *TargetDiff) Reset() { *x = TargetDiff{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -211,7 +313,7 @@ func (x *TargetDiff) String() string { func (*TargetDiff) ProtoMessage() {} func (x *TargetDiff) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -224,7 +326,7 @@ func (x *TargetDiff) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetDiff.ProtoReflect.Descriptor instead. func (*TargetDiff) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{4} } func (x *TargetDiff) GetEndpoint() string { @@ -252,7 +354,7 @@ type TargetList struct { func (x *TargetList) Reset() { *x = TargetList{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +367,7 @@ func (x *TargetList) String() string { func (*TargetList) ProtoMessage() {} func (x *TargetList) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,7 +380,7 @@ func (x *TargetList) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetList.ProtoReflect.Descriptor instead. func (*TargetList) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{3} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{5} } func (x *TargetList) GetTargets() []*Target { @@ -300,7 +402,7 @@ type TargetAddRequest struct { func (x *TargetAddRequest) Reset() { *x = TargetAddRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -313,7 +415,7 @@ func (x *TargetAddRequest) String() string { func (*TargetAddRequest) ProtoMessage() {} func (x *TargetAddRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -326,7 +428,7 @@ func (x *TargetAddRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetAddRequest.ProtoReflect.Descriptor instead. func (*TargetAddRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{4} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{6} } func (x *TargetAddRequest) GetTarget() *Target { @@ -348,15 +450,14 @@ type TargetEditRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` TargetDiff *TargetDiff `protobuf:"bytes,2,opt,name=targetDiff,proto3" json:"targetDiff,omitempty"` - ClusterId string `protobuf:"bytes,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *TargetEditRequest) Reset() { *x = TargetEditRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -369,7 +470,7 @@ func (x *TargetEditRequest) String() string { func (*TargetEditRequest) ProtoMessage() {} func (x *TargetEditRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -382,14 +483,14 @@ func (x *TargetEditRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetEditRequest.ProtoReflect.Descriptor instead. func (*TargetEditRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{5} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} } -func (x *TargetEditRequest) GetTargetName() string { +func (x *TargetEditRequest) GetMeta() *TargetMeta { if x != nil { - return x.TargetName + return x.Meta } - return "" + return nil } func (x *TargetEditRequest) GetTargetDiff() *TargetDiff { @@ -399,26 +500,18 @@ func (x *TargetEditRequest) GetTargetDiff() *TargetDiff { return nil } -func (x *TargetEditRequest) GetClusterId() string { - if x != nil { - return x.ClusterId - } - return "" -} - type TargetRemoveRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` - ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` } func (x *TargetRemoveRequest) Reset() { *x = TargetRemoveRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -431,7 +524,7 @@ func (x *TargetRemoveRequest) String() string { func (*TargetRemoveRequest) ProtoMessage() {} func (x *TargetRemoveRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -444,21 +537,14 @@ func (x *TargetRemoveRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetRemoveRequest.ProtoReflect.Descriptor instead. func (*TargetRemoveRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{6} -} - -func (x *TargetRemoveRequest) GetTargetName() string { - if x != nil { - return x.TargetName - } - return "" + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} } -func (x *TargetRemoveRequest) GetClusterId() string { +func (x *TargetRemoveRequest) GetMeta() *TargetMeta { if x != nil { - return x.ClusterId + return x.Meta } - return "" + return nil } type TargetListRequest struct { @@ -472,7 +558,7 @@ type TargetListRequest struct { func (x *TargetListRequest) Reset() { *x = TargetListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -485,7 +571,7 @@ func (x *TargetListRequest) String() string { func (*TargetListRequest) ProtoMessage() {} func (x *TargetListRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -498,7 +584,7 @@ func (x *TargetListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetListRequest.ProtoReflect.Descriptor instead. func (*TargetListRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{9} } func (x *TargetListRequest) GetClusterId() string { @@ -513,17 +599,16 @@ type StartReadRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` - Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp - ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` - ClusterId string `protobuf:"bytes,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` } func (x *StartReadRequest) Reset() { *x = StartReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -536,7 +621,7 @@ func (x *StartReadRequest) String() string { func (*StartReadRequest) ProtoMessage() {} func (x *StartReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -549,14 +634,14 @@ func (x *StartReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartReadRequest.ProtoReflect.Descriptor instead. func (*StartReadRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} } -func (x *StartReadRequest) GetTargetName() string { +func (x *StartReadRequest) GetMeta() *TargetMeta { if x != nil { - return x.TargetName + return x.Meta } - return "" + return nil } func (x *StartReadRequest) GetQuery() *Query { @@ -573,26 +658,18 @@ func (x *StartReadRequest) GetForceOverlap() bool { return false } -func (x *StartReadRequest) GetClusterId() string { - if x != nil { - return x.ClusterId - } - return "" -} - type StopReadRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetName string `protobuf:"bytes,1,opt,name=targetName,proto3" json:"targetName,omitempty"` - ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` } func (x *StopReadRequest) Reset() { *x = StopReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -605,7 +682,7 @@ func (x *StopReadRequest) String() string { func (*StopReadRequest) ProtoMessage() {} func (x *StopReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -618,21 +695,14 @@ func (x *StopReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReadRequest.ProtoReflect.Descriptor instead. func (*StopReadRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{9} -} - -func (x *StopReadRequest) GetTargetName() string { - if x != nil { - return x.TargetName - } - return "" + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11} } -func (x *StopReadRequest) GetClusterId() string { +func (x *StopReadRequest) GetMeta() *TargetMeta { if x != nil { - return x.ClusterId + return x.Meta } - return "" + return nil } // PromQL query @@ -649,7 +719,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -662,7 +732,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -675,7 +745,7 @@ func (x *Query) ProtoReflect() protoreflect.Message { // Deprecated: Use Query.ProtoReflect.Descriptor instead. func (*Query) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} } func (x *Query) GetStartTimestamp() *timestamppb.Timestamp { @@ -712,7 +782,7 @@ type LabelMatcher struct { func (x *LabelMatcher) Reset() { *x = LabelMatcher{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -725,7 +795,7 @@ func (x *LabelMatcher) String() string { func (*LabelMatcher) ProtoMessage() {} func (x *LabelMatcher) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -738,7 +808,7 @@ func (x *LabelMatcher) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. func (*LabelMatcher) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13} } func (x *LabelMatcher) GetType() LabelMatcher_Type { @@ -775,7 +845,7 @@ type Progress struct { func (x *Progress) Reset() { *x = Progress{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -788,7 +858,7 @@ func (x *Progress) String() string { func (*Progress) ProtoMessage() {} func (x *Progress) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -801,7 +871,7 @@ func (x *Progress) ProtoReflect() protoreflect.Message { // Deprecated: Use Progress.ProtoReflect.Descriptor instead. func (*Progress) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{14} } func (x *Progress) GetStartTimestamp() *timestamppb.Timestamp { @@ -842,133 +912,145 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, - 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x5a, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, - 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, - 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x5c, 0x0a, - 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x11, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x53, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x11, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x9d, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, - 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, - 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x4f, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, - 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, - 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, - 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, - 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, - 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, - 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, - 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, - 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xbf, 0x03, - 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x12, 0x61, 0x0a, 0x09, - 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x16, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x12, - 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, + 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x64, 0x22, 0x58, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, + 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x28, 0x0a, 0x0a, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x44, 0x69, 0x66, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, + 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, + 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x01, + 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x27, + 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, 0x0f, 0x53, + 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, + 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, + 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, + 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, + 0x41, 0x4c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xa6, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, + 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, + 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, - 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, - 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -984,55 +1066,67 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = []interface{}{ (LabelMatcher_Type)(0), // 0: remoteread.LabelMatcher.Type (*Target)(nil), // 1: remoteread.Target - (*TargetMetadata)(nil), // 2: remoteread.TargetMetadata - (*TargetDiff)(nil), // 3: remoteread.TargetDiff - (*TargetList)(nil), // 4: remoteread.TargetList - (*TargetAddRequest)(nil), // 5: remoteread.TargetAddRequest - (*TargetEditRequest)(nil), // 6: remoteread.TargetEditRequest - (*TargetRemoveRequest)(nil), // 7: remoteread.TargetRemoveRequest - (*TargetListRequest)(nil), // 8: remoteread.TargetListRequest - (*StartReadRequest)(nil), // 9: remoteread.StartReadRequest - (*StopReadRequest)(nil), // 10: remoteread.StopReadRequest - (*Query)(nil), // 11: remoteread.Query - (*LabelMatcher)(nil), // 12: remoteread.LabelMatcher - (*Progress)(nil), // 13: remoteread.Progress - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 15: google.protobuf.Empty + (*TargetMeta)(nil), // 2: remoteread.TargetMeta + (*TargetStatus)(nil), // 3: remoteread.TargetStatus + (*TargetSpec)(nil), // 4: remoteread.TargetSpec + (*TargetDiff)(nil), // 5: remoteread.TargetDiff + (*TargetList)(nil), // 6: remoteread.TargetList + (*TargetAddRequest)(nil), // 7: remoteread.TargetAddRequest + (*TargetEditRequest)(nil), // 8: remoteread.TargetEditRequest + (*TargetRemoveRequest)(nil), // 9: remoteread.TargetRemoveRequest + (*TargetListRequest)(nil), // 10: remoteread.TargetListRequest + (*StartReadRequest)(nil), // 11: remoteread.StartReadRequest + (*StopReadRequest)(nil), // 12: remoteread.StopReadRequest + (*Query)(nil), // 13: remoteread.Query + (*LabelMatcher)(nil), // 14: remoteread.LabelMatcher + (*Progress)(nil), // 15: remoteread.Progress + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 17: google.protobuf.Empty } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = []int32{ - 2, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMetadata - 14, // 1: remoteread.TargetMetadata.lastReadTimestamp:type_name -> google.protobuf.Timestamp - 1, // 2: remoteread.TargetList.targets:type_name -> remoteread.Target - 1, // 3: remoteread.TargetAddRequest.target:type_name -> remoteread.Target - 3, // 4: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff - 11, // 5: remoteread.StartReadRequest.query:type_name -> remoteread.Query - 14, // 6: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp - 14, // 7: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp - 12, // 8: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher - 0, // 9: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type - 14, // 10: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp - 14, // 11: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp - 5, // 12: remoteread.RemoteRead.AddTarget:input_type -> remoteread.TargetAddRequest - 6, // 13: remoteread.RemoteRead.EditTarget:input_type -> remoteread.TargetEditRequest - 7, // 14: remoteread.RemoteRead.RemoveTarget:input_type -> remoteread.TargetRemoveRequest - 8, // 15: remoteread.RemoteRead.ListTargets:input_type -> remoteread.TargetListRequest - 9, // 16: remoteread.RemoteRead.Start:input_type -> remoteread.StartReadRequest - 10, // 17: remoteread.RemoteRead.Stop:input_type -> remoteread.StopReadRequest - 15, // 18: remoteread.RemoteRead.AddTarget:output_type -> google.protobuf.Empty - 15, // 19: remoteread.RemoteRead.EditTarget:output_type -> google.protobuf.Empty - 15, // 20: remoteread.RemoteRead.RemoveTarget:output_type -> google.protobuf.Empty - 4, // 21: remoteread.RemoteRead.ListTargets:output_type -> remoteread.TargetList - 15, // 22: remoteread.RemoteRead.Start:output_type -> google.protobuf.Empty - 15, // 23: remoteread.RemoteRead.Stop:output_type -> google.protobuf.Empty - 18, // [18:24] is the sub-list for method output_type - 12, // [12:18] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 2, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMeta + 4, // 1: remoteread.Target.spec:type_name -> remoteread.TargetSpec + 3, // 2: remoteread.Target.status:type_name -> remoteread.TargetStatus + 16, // 3: remoteread.TargetStatus.lastReadTimestamp:type_name -> google.protobuf.Timestamp + 1, // 4: remoteread.TargetList.targets:type_name -> remoteread.Target + 1, // 5: remoteread.TargetAddRequest.target:type_name -> remoteread.Target + 2, // 6: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta + 5, // 7: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff + 2, // 8: remoteread.TargetRemoveRequest.meta:type_name -> remoteread.TargetMeta + 2, // 9: remoteread.StartReadRequest.meta:type_name -> remoteread.TargetMeta + 13, // 10: remoteread.StartReadRequest.query:type_name -> remoteread.Query + 2, // 11: remoteread.StopReadRequest.meta:type_name -> remoteread.TargetMeta + 16, // 12: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp + 16, // 13: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp + 14, // 14: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher + 0, // 15: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type + 16, // 16: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp + 16, // 17: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp + 7, // 18: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest + 8, // 19: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest + 9, // 20: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest + 10, // 21: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest + 11, // 22: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 12, // 23: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 11, // 24: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest + 12, // 25: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest + 17, // 26: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 17, // 27: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 17, // 28: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 6, // 29: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 17, // 30: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty + 17, // 31: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty + 17, // 32: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 17, // 33: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 26, // [26:34] is the sub-list for method output_type + 18, // [18:26] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() } @@ -1054,7 +1148,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetMetadata); i { + switch v := v.(*TargetMeta); i { case 0: return &v.state case 1: @@ -1066,7 +1160,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetDiff); i { + switch v := v.(*TargetStatus); i { case 0: return &v.state case 1: @@ -1078,7 +1172,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetList); i { + switch v := v.(*TargetSpec); i { case 0: return &v.state case 1: @@ -1090,7 +1184,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetAddRequest); i { + switch v := v.(*TargetDiff); i { case 0: return &v.state case 1: @@ -1102,7 +1196,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetEditRequest); i { + switch v := v.(*TargetList); i { case 0: return &v.state case 1: @@ -1114,7 +1208,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetRemoveRequest); i { + switch v := v.(*TargetAddRequest); i { case 0: return &v.state case 1: @@ -1126,7 +1220,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetListRequest); i { + switch v := v.(*TargetEditRequest); i { case 0: return &v.state case 1: @@ -1138,7 +1232,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReadRequest); i { + switch v := v.(*TargetRemoveRequest); i { case 0: return &v.state case 1: @@ -1150,7 +1244,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReadRequest); i { + switch v := v.(*TargetListRequest); i { case 0: return &v.state case 1: @@ -1162,7 +1256,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { + switch v := v.(*StartReadRequest); i { case 0: return &v.state case 1: @@ -1174,7 +1268,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelMatcher); i { + switch v := v.(*StopReadRequest); i { case 0: return &v.state case 1: @@ -1186,6 +1280,30 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Progress); i { case 0: return &v.state @@ -1204,9 +1322,9 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc, NumEnums: 1, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes, DependencyIndexes: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs, diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index b7d2d8a4cd..b444592c8c 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -9,35 +9,45 @@ import "google/api/annotations.proto"; package remoteread; -service RemoteRead { - // todo: we probably need a new type for Describe and ScanFor -// rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); -// rpc Describe(Target) returns (Target); - - rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/remoteread/target/add" - }; - } +// todo: we probably need a new type for Describe and ScanFor +service RemoteReadGateway { +// rpc ScanForTargets(google.protobuf.Empty) returns (stream/ Target); +// rpc Describe(Target) returns (Target) +// rpc GetProgress(ProgressRequest) returns (stream Progress); + rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); rpc EditTarget(TargetEditRequest) returns (google.protobuf.Empty); rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); rpc ListTargets(TargetListRequest) returns (TargetList); rpc Start(StartReadRequest) returns (google.protobuf.Empty); -// rpc GetProgress(ProgressRequest) returns (stream Progress); + rpc Stop(StopReadRequest) returns (google.protobuf.Empty); +} + +// RemoteReadAgent does not need to have the same target methods since those will be store by the gateway +service RemoteReadAgent { + rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); } message Target { - string endpoint = 1; - string name = 2; - TargetMetadata meta = 4; + TargetMeta meta = 1; + TargetSpec spec = 2; + TargetStatus status = 3; } -message TargetMetadata { +message TargetMeta { + string name = 1; + string clusterId = 2; +} + +message TargetStatus { google.protobuf.Timestamp lastReadTimestamp = 1; } +message TargetSpec { + string endpoint = 1; +} + message TargetDiff { string endpoint = 1; string name = 2; @@ -53,14 +63,12 @@ message TargetAddRequest { } message TargetEditRequest { - string targetName = 1; + TargetMeta meta = 1; TargetDiff targetDiff = 2; - string clusterId = 3; } message TargetRemoveRequest { - string targetName = 1; - string clusterId = 2; + TargetMeta meta = 1; } message TargetListRequest { @@ -68,24 +76,15 @@ message TargetListRequest { } message StartReadRequest { - string targetName = 1; + TargetMeta meta = 1; Query query = 2; // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp bool forceOverlap = 3; - - string clusterId = 4; } -//message ProgressRequest { -// string targetName = 1; -// string clusterId = 2; -// -//} - message StopReadRequest { - string targetName = 1; - string clusterId = 2; + TargetMeta meta = 1; } // PromQL query diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index f8163f0bd5..9f94e2dd89 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -19,268 +19,388 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -// RemoteReadClient is the client API for RemoteRead service. +// RemoteReadGatewayClient is the client API for RemoteReadGateway 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 RemoteReadClient interface { +type RemoteReadGatewayClient interface { AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // rpc GetProgress(ProgressRequest) returns (stream Progress); Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } -type remoteReadClient struct { +type remoteReadGatewayClient struct { cc grpc.ClientConnInterface } -func NewRemoteReadClient(cc grpc.ClientConnInterface) RemoteReadClient { - return &remoteReadClient{cc} +func NewRemoteReadGatewayClient(cc grpc.ClientConnInterface) RemoteReadGatewayClient { + return &remoteReadGatewayClient{cc} } -func (c *remoteReadClient) AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) AddTarget(ctx context.Context, in *TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/AddTarget", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/AddTarget", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadClient) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/EditTarget", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/EditTarget", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadClient) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/RemoveTarget", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/RemoveTarget", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadClient) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) { +func (c *remoteReadGatewayClient) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) { out := new(TargetList) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/ListTargets", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/ListTargets", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/Start", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Start", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteRead/Stop", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Stop", in, out, opts...) if err != nil { return nil, err } return out, nil } -// RemoteReadServer is the server API for RemoteRead service. -// All implementations must embed UnimplementedRemoteReadServer +// RemoteReadGatewayServer is the server API for RemoteReadGateway service. +// All implementations must embed UnimplementedRemoteReadGatewayServer // for forward compatibility -type RemoteReadServer interface { +type RemoteReadGatewayServer interface { AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) - // rpc GetProgress(ProgressRequest) returns (stream Progress); Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedRemoteReadServer() + mustEmbedUnimplementedRemoteReadGatewayServer() } -// UnimplementedRemoteReadServer must be embedded to have forward compatible implementations. -type UnimplementedRemoteReadServer struct { +// UnimplementedRemoteReadGatewayServer must be embedded to have forward compatible implementations. +type UnimplementedRemoteReadGatewayServer struct { } -func (UnimplementedRemoteReadServer) AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) { +func (UnimplementedRemoteReadGatewayServer) AddTarget(context.Context, *TargetAddRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method AddTarget not implemented") } -func (UnimplementedRemoteReadServer) EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) { +func (UnimplementedRemoteReadGatewayServer) EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method EditTarget not implemented") } -func (UnimplementedRemoteReadServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) { +func (UnimplementedRemoteReadGatewayServer) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveTarget not implemented") } -func (UnimplementedRemoteReadServer) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) { +func (UnimplementedRemoteReadGatewayServer) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented") } -func (UnimplementedRemoteReadServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { +func (UnimplementedRemoteReadGatewayServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } -func (UnimplementedRemoteReadServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { +func (UnimplementedRemoteReadGatewayServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } -func (UnimplementedRemoteReadServer) mustEmbedUnimplementedRemoteReadServer() {} +func (UnimplementedRemoteReadGatewayServer) mustEmbedUnimplementedRemoteReadGatewayServer() {} -// UnsafeRemoteReadServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RemoteReadServer will +// UnsafeRemoteReadGatewayServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RemoteReadGatewayServer will // result in compilation errors. -type UnsafeRemoteReadServer interface { - mustEmbedUnimplementedRemoteReadServer() +type UnsafeRemoteReadGatewayServer interface { + mustEmbedUnimplementedRemoteReadGatewayServer() } -func RegisterRemoteReadServer(s grpc.ServiceRegistrar, srv RemoteReadServer) { - s.RegisterService(&RemoteRead_ServiceDesc, srv) +func RegisterRemoteReadGatewayServer(s grpc.ServiceRegistrar, srv RemoteReadGatewayServer) { + s.RegisterService(&RemoteReadGateway_ServiceDesc, srv) } -func _RemoteRead_AddTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_AddTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TargetAddRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).AddTarget(ctx, in) + return srv.(RemoteReadGatewayServer).AddTarget(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/AddTarget", + FullMethod: "/remoteread.RemoteReadGateway/AddTarget", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).AddTarget(ctx, req.(*TargetAddRequest)) + return srv.(RemoteReadGatewayServer).AddTarget(ctx, req.(*TargetAddRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteRead_EditTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_EditTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TargetEditRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).EditTarget(ctx, in) + return srv.(RemoteReadGatewayServer).EditTarget(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/EditTarget", + FullMethod: "/remoteread.RemoteReadGateway/EditTarget", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).EditTarget(ctx, req.(*TargetEditRequest)) + return srv.(RemoteReadGatewayServer).EditTarget(ctx, req.(*TargetEditRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteRead_RemoveTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_RemoveTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TargetRemoveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).RemoveTarget(ctx, in) + return srv.(RemoteReadGatewayServer).RemoveTarget(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/RemoveTarget", + FullMethod: "/remoteread.RemoteReadGateway/RemoveTarget", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).RemoveTarget(ctx, req.(*TargetRemoveRequest)) + return srv.(RemoteReadGatewayServer).RemoveTarget(ctx, req.(*TargetRemoveRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteRead_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_ListTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TargetListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).ListTargets(ctx, in) + return srv.(RemoteReadGatewayServer).ListTargets(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/ListTargets", + FullMethod: "/remoteread.RemoteReadGateway/ListTargets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).ListTargets(ctx, req.(*TargetListRequest)) + return srv.(RemoteReadGatewayServer).ListTargets(ctx, req.(*TargetListRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteRead_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartReadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).Start(ctx, in) + return srv.(RemoteReadGatewayServer).Start(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/Start", + FullMethod: "/remoteread.RemoteReadGateway/Start", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).Start(ctx, req.(*StartReadRequest)) + return srv.(RemoteReadGatewayServer).Start(ctx, req.(*StartReadRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteRead_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RemoteReadGateway_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopReadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadServer).Stop(ctx, in) + return srv.(RemoteReadGatewayServer).Stop(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteRead/Stop", + FullMethod: "/remoteread.RemoteReadGateway/Stop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadServer).Stop(ctx, req.(*StopReadRequest)) + return srv.(RemoteReadGatewayServer).Stop(ctx, req.(*StopReadRequest)) } return interceptor(ctx, in, info, handler) } -// RemoteRead_ServiceDesc is the grpc.ServiceDesc for RemoteRead service. +// RemoteReadGateway_ServiceDesc is the grpc.ServiceDesc for RemoteReadGateway service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var RemoteRead_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "remoteread.RemoteRead", - HandlerType: (*RemoteReadServer)(nil), +var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "remoteread.RemoteReadGateway", + HandlerType: (*RemoteReadGatewayServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AddTarget", - Handler: _RemoteRead_AddTarget_Handler, + Handler: _RemoteReadGateway_AddTarget_Handler, }, { MethodName: "EditTarget", - Handler: _RemoteRead_EditTarget_Handler, + Handler: _RemoteReadGateway_EditTarget_Handler, }, { MethodName: "RemoveTarget", - Handler: _RemoteRead_RemoveTarget_Handler, + Handler: _RemoteReadGateway_RemoveTarget_Handler, }, { MethodName: "ListTargets", - Handler: _RemoteRead_ListTargets_Handler, + Handler: _RemoteReadGateway_ListTargets_Handler, }, { MethodName: "Start", - Handler: _RemoteRead_Start_Handler, + Handler: _RemoteReadGateway_Start_Handler, }, { MethodName: "Stop", - Handler: _RemoteRead_Stop_Handler, + Handler: _RemoteReadGateway_Stop_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", +} + +// RemoteReadAgentClient is the client API for RemoteReadAgent 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 RemoteReadAgentClient interface { + Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type remoteReadAgentClient struct { + cc grpc.ClientConnInterface +} + +func NewRemoteReadAgentClient(cc grpc.ClientConnInterface) RemoteReadAgentClient { + return &remoteReadAgentClient{cc} +} + +func (c *remoteReadAgentClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/Start", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadAgentClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/Stop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RemoteReadAgentServer is the server API for RemoteReadAgent service. +// All implementations must embed UnimplementedRemoteReadAgentServer +// for forward compatibility +type RemoteReadAgentServer interface { + Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) + Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedRemoteReadAgentServer() +} + +// UnimplementedRemoteReadAgentServer must be embedded to have forward compatible implementations. +type UnimplementedRemoteReadAgentServer struct { +} + +func (UnimplementedRemoteReadAgentServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedRemoteReadAgentServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") +} +func (UnimplementedRemoteReadAgentServer) mustEmbedUnimplementedRemoteReadAgentServer() {} + +// UnsafeRemoteReadAgentServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RemoteReadAgentServer will +// result in compilation errors. +type UnsafeRemoteReadAgentServer interface { + mustEmbedUnimplementedRemoteReadAgentServer() +} + +func RegisterRemoteReadAgentServer(s grpc.ServiceRegistrar, srv RemoteReadAgentServer) { + s.RegisterService(&RemoteReadAgent_ServiceDesc, srv) +} + +func _RemoteReadAgent_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadAgentServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadAgent/Start", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadAgentServer).Start(ctx, req.(*StartReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteReadAgent_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadAgentServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadAgent/Stop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadAgentServer).Stop(ctx, req.(*StopReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RemoteReadAgent_ServiceDesc is the grpc.ServiceDesc for RemoteReadAgent service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RemoteReadAgent_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "remoteread.RemoteReadAgent", + HandlerType: (*RemoteReadAgentServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Start", + Handler: _RemoteReadAgent_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _RemoteReadAgent_Stop_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 1669af4edd..3427f04611 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -4,15 +4,14 @@ import ( "context" "fmt" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" - "strings" - "sync" - "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" + "strings" + "sync" "github.com/google/go-cmp/cmp" capabilityv1 "github.com/rancher/opni/pkg/apis/capability/v1" @@ -36,7 +35,7 @@ type MetricsBackend struct { capabilityv1.UnsafeBackendServer node.UnsafeNodeMetricsCapabilityServer cortexops.UnsafeCortexOpsServer - remoteread.UnsafeRemoteReadServer + remoteread.UnsafeRemoteReadGatewayServer MetricsBackendConfig nodeStatusMu sync.RWMutex @@ -45,19 +44,22 @@ type MetricsBackend struct { desiredNodeSpecMu sync.RWMutex desiredNodeSpec map[string]*node.MetricsCapabilitySpec + remoteReadTargetMu sync.RWMutex + remoteReadTargets map[string]*remoteread.Target + util.Initializer } var _ node.NodeMetricsCapabilityServer = (*MetricsBackend)(nil) var _ cortexops.CortexOpsServer = (*MetricsBackend)(nil) -var _ remoteread.RemoteReadServer = (*MetricsBackend)(nil) +var _ remoteread.RemoteReadGatewayServer = (*MetricsBackend)(nil) type MetricsBackendConfig struct { Logger *zap.SugaredLogger `validate:"required"` StorageBackend storage.Backend `validate:"required"` MgmtClient managementv1.ManagementClient `validate:"required"` NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` - RemoteReadClient remoteread.RemoteReadClient `validate:"required"` + RemoteReadForwarder RemoteReadForwarder `validate:"required"` UninstallController *task.Controller `validate:"required"` ClusterDriver drivers.ClusterDriver `validate:"required"` } @@ -70,6 +72,7 @@ func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { m.MetricsBackendConfig = conf m.nodeStatus = make(map[string]*capabilityv1.NodeCapabilityStatus) m.desiredNodeSpec = make(map[string]*node.MetricsCapabilitySpec) + m.remoteReadTargets = make(map[string]*remoteread.Target) }) } @@ -414,123 +417,143 @@ func (m *MetricsBackend) UninstallCluster(ctx context.Context, in *emptypb.Empty } // Metrics Remote Read Backend +// todo: handle running targets (disallow all edits / deletes / etc) + +func targetAlreadyExistsError(name string) error { + return fmt.Errorf("target '%s' already exists", name) +} -func (m *MetricsBackend) AddTarget(ctx context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { - _, err := m.RemoteReadClient.AddTarget(ctx, request) +func targetDoesNotExistError(name string) error { + return fmt.Errorf("target '%s' does not exist", name) +} - clusterId := request.ClusterId +func getIdFromTargetMeta(meta *remoteread.TargetMeta) string { + return fmt.Sprintf("%s:%s", meta.Name, meta.ClusterId) +} - if err != nil { - m.Logger.With( - "cluster", clusterId, - "capability", wellknown.CapabilityMetrics, - "target", request.Target.Name, - zap.Error(err), - ).Warn("failed to create target") +func (m *MetricsBackend) AddTarget(_ context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() - return nil, err + targetId := request.Target.Meta.String() + + if _, found := m.remoteReadTargets[targetId]; found { + return nil, targetAlreadyExistsError(targetId) } + if request.Target.Status == nil { + request.Target.Status = &remoteread.TargetStatus{ + LastReadTimestamp: ×tamppb.Timestamp{}, + } + } + + m.remoteReadTargets[targetId] = request.Target + m.Logger.With( - "cluster", clusterId, + "cluster", request.Target.Meta.ClusterId, + "target", request.Target.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.Target.Name, - ).Info("target created") + ).Infof("added new target '%s'", targetId) - return nil, nil + return &emptypb.Empty{}, nil } -func (m *MetricsBackend) EditTarget(ctx context.Context, request *remoteread.TargetEditRequest) (*emptypb.Empty, error) { - _, err := m.RemoteReadClient.EditTarget(ctx, request) +func (m *MetricsBackend) EditTarget(_ context.Context, request *remoteread.TargetEditRequest) (*emptypb.Empty, error) { + m.WaitForInit() - clusterId := request.ClusterId + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() - if err != nil { - m.Logger.With( - "cluster", clusterId, - "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, - zap.Error(err), - ).Warn("failed to edit target") + targetId := request.Meta.String() + diff := request.TargetDiff - return nil, err + target, found := m.remoteReadTargets[targetId] + if !found { + return nil, targetDoesNotExistError(targetId) } - // todo: we might want to display the new name if it was changed + if diff.Name != "" { + target.Meta.Name = diff.Name + newTargetId := target.Meta.String() + + if _, found := m.remoteReadTargets[newTargetId]; found { + return nil, targetAlreadyExistsError(diff.Name) + } + + delete(m.remoteReadTargets, targetId) + m.remoteReadTargets[newTargetId] = target + } + + if diff.Endpoint != "" { + target.Spec.Endpoint = diff.Endpoint + + // todo: probably isn't necessary + m.remoteReadTargets[targetId] = target + } + + // todo: we may want to add the new name if it was changed m.Logger.With( - "cluster", clusterId, + "cluster", request.Meta.ClusterId, + "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, - ).Info("target edited") + ).Infof("edited target '%s'", targetId) - return nil, nil + return &emptypb.Empty{}, nil } -func (m *MetricsBackend) RemoveTarget(ctx context.Context, request *remoteread.TargetRemoveRequest) (*emptypb.Empty, error) { - _, err := m.RemoteReadClient.RemoveTarget(ctx, request) +func (m *MetricsBackend) RemoveTarget(_ context.Context, request *remoteread.TargetRemoveRequest) (*emptypb.Empty, error) { + m.WaitForInit() - clusterId := request.ClusterId + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() - if err != nil { - m.Logger.With( - "cluster", clusterId, - "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, - zap.Error(err), - ).Warn("failed to remove target") + targetId := request.Meta.String() - return nil, err + if _, found := m.remoteReadTargets[targetId]; !found { + return nil, targetDoesNotExistError(request.Meta.Name) } + delete(m.remoteReadTargets, targetId) + m.Logger.With( - "cluster", clusterId, + "cluster", request.Meta.ClusterId, + "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, - ).Info("target remove") + ).Infof("removed target '%s'", targetId) - return nil, nil + return &emptypb.Empty{}, nil } -func (m *MetricsBackend) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { - list, err := m.RemoteReadClient.ListTargets(ctx, request) +func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { + m.WaitForInit() - clusterId := request.ClusterId - if clusterId == "" { - clusterId = "(all)" - } + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() - if err != nil { - m.Logger.With( - "cluster", clusterId, - "capability", wellknown.CapabilityMetrics, - zap.Error(err), - ).Warn("failed to list targets") + // todo: we can probably make this smaller + inner := make([]*remoteread.Target, 0, len(m.remoteReadTargets)) - return nil, err + for _, target := range m.remoteReadTargets { + if request.ClusterId == "" || request.ClusterId == target.Meta.ClusterId { + inner = append(inner, target) + } } - // todo: we might want to display the new name if it was changed - m.Logger.With( - "cluster", clusterId, - "capability", wellknown.CapabilityMetrics, - ).Info("targets listed") + list := &remoteread.TargetList{Targets: inner} return list, nil } func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - _, err := m.RemoteReadClient.Start(ctx, request) + m.WaitForInit() - clusterId := request.TargetName - if clusterId == "" { - clusterId = "(all)" - } + _, err := m.RemoteReadForwarder.Start(ctx, request) if err != nil { m.Logger.With( - "cluster", clusterId, + "cluster", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, + "target", request.Meta.Name, zap.Error(err), ).Warn("failed to start client") @@ -539,27 +562,24 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea // todo: we might want to display the new name if it was changed m.Logger.With( - "cluster", clusterId, - "target", request.TargetName, + "cluster", request.Meta.Name, + "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, ).Info("target started") - return nil, nil + return &emptypb.Empty{}, nil } func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - _, err := m.RemoteReadClient.Stop(ctx, request) + m.WaitForInit() - clusterId := request.TargetName - if clusterId == "" { - clusterId = "(all)" - } + _, err := m.RemoteReadForwarder.Stop(ctx, request) if err != nil { m.Logger.With( - "cluster", clusterId, + "cluster", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.TargetName, + "target", request.Meta.Name, zap.Error(err), ).Warn("failed to stop client") @@ -568,10 +588,10 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR // todo: we might want to display the new name if it was changed m.Logger.With( - "cluster", clusterId, - "target", request.TargetName, + "cluster", request.Meta.Name, + "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, ).Info("target stopped") - return nil, nil + return &emptypb.Empty{}, nil } diff --git a/plugins/metrics/pkg/backend/remoteread.go b/plugins/metrics/pkg/backend/remoteread.go new file mode 100644 index 0000000000..f1f8876f00 --- /dev/null +++ b/plugins/metrics/pkg/backend/remoteread.go @@ -0,0 +1,21 @@ +package backend + +import ( + "context" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "google.golang.org/protobuf/types/known/emptypb" +) + +var _ remoteread.RemoteReadAgentServer = (*RemoteReadForwarder)(nil) + +type RemoteReadForwarder struct { + remoteread.UnsafeRemoteReadAgentServer +} + +func (fwd *RemoteReadForwarder) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { + return &emptypb.Empty{}, nil +} + +func (fwd *RemoteReadForwarder) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { + return &emptypb.Empty{}, nil +} diff --git a/plugins/metrics/pkg/cortex/api.go b/plugins/metrics/pkg/cortex/api.go index 6c76ce7aba..d93f9c32b5 100644 --- a/plugins/metrics/pkg/cortex/api.go +++ b/plugins/metrics/pkg/cortex/api.go @@ -151,13 +151,3 @@ func (p *HttpApiServer) configureQueryFrontend(router *gin.Engine, f *forwarders group.GET("/metadata", f.QueryFrontend) } } - -//func (p *HttpApiServer) configureImport(router *gin.Engine, f *forwarders, m *middlewares) { -// router.POST("/api/remoteread/target/add", f.RemoteRead) -// router.PATCH("/api/remoteread/target/edit", f.RemoteRead) -// router.DELETE("/api/remoteread/target/remove", f.RemoteRead) -// router.GET("/api/remoteread/target/list", f.RemoteRead) -// -// router.POST("/api/remoteread/start", f.RemoteRead) -// router.POST("/api/remoteread/stop", f.RemoteRead) -//} diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index d65abdc5fc..af8e47d330 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -48,7 +48,7 @@ type Plugin struct { mgmtClient future.Future[managementv1.ManagementClient] nodeManagerClient future.Future[capabilityv1.NodeManagerClient] storageBackend future.Future[storage.Backend] - remoteReadClient future.Future[remoteread.RemoteReadClient] + remoteReadClient future.Future[remoteread.RemoteReadGatewayClient] cortexTlsConfig future.Future[*tls.Config] cortexClientSet future.Future[cortex.ClientSet] uninstallController future.Future[*task.Controller] @@ -68,7 +68,6 @@ func NewPlugin(ctx context.Context) *Plugin { mgmtClient: future.New[managementv1.ManagementClient](), nodeManagerClient: future.New[capabilityv1.NodeManagerClient](), storageBackend: future.New[storage.Backend](), - remoteReadClient: future.New[remoteread.RemoteReadClient](), cortexTlsConfig: future.New[*tls.Config](), cortexClientSet: future.New[cortex.ClientSet](), uninstallController: future.New[*task.Controller](), @@ -102,14 +101,13 @@ func NewPlugin(ctx context.Context) *Plugin { }) }) - future.Wait6(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, p.remoteReadClient, + future.Wait5(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, func( storageBackend storage.Backend, mgmtClient managementv1.ManagementClient, nodeManagerClient capabilityv1.NodeManagerClient, uninstallController *task.Controller, clusterDriver drivers.ClusterDriver, - remoteReadClient remoteread.RemoteReadClient, ) { p.metrics.Initialize(backend.MetricsBackendConfig{ Logger: p.logger.Named("metrics-backend"), @@ -118,7 +116,6 @@ func NewPlugin(ctx context.Context) *Plugin { NodeManagerClient: nodeManagerClient, UninstallController: uninstallController, ClusterDriver: clusterDriver, - RemoteReadClient: remoteReadClient, }) }) @@ -154,6 +151,7 @@ func Scheme(ctx context.Context) meta.Scheme { scheme.Add(managementext.ManagementAPIExtensionPluginID, managementext.NewPlugin( util.PackService(&cortexadmin.CortexAdmin_ServiceDesc, &p.cortexAdmin), util.PackService(&cortexops.CortexOps_ServiceDesc, &p.metrics), + util.PackService(&remoteread.RemoteReadGateway_ServiceDesc, &p.metrics), )) scheme.Add(capability.CapabilityBackendPluginID, capability.NewPlugin(&p.metrics)) scheme.Add(metrics.MetricsPluginID, metrics.NewPlugin(p)) diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index b682a41803..53d48235c2 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -16,8 +16,8 @@ func (p *Plugin) StreamServers() []streamext.Server { RequireCapability: wellknown.CapabilityMetrics, }, { - Desc: &remoteread.RemoteRead_ServiceDesc, - Impl: &p.metrics, + Desc: &remoteread.RemoteReadGateway_ServiceDesc, + Impl: nil, // todo: create && set this impl RequireCapability: wellknown.CapabilityMetrics, }, { From 7acccaf21901cc3aa0ce87995df3d6be0c82b702 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:30:29 -0500 Subject: [PATCH 07/43] add support for target status --- pkg/opni/commands/import.go | 22 +- plugins/metrics/pkg/agent/http.go | 15 +- plugins/metrics/pkg/agent/node.go | 19 +- plugins/metrics/pkg/agent/runner.go | 134 +++- plugins/metrics/pkg/agent/stream.go | 4 +- .../pkg/apis/remoteread/remoteread.pb.go | 684 ++++++++++++------ .../pkg/apis/remoteread/remoteread.proto | 40 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 72 ++ plugins/metrics/pkg/backend/metrics.go | 91 ++- plugins/metrics/pkg/backend/remoteread.go | 32 +- plugins/metrics/pkg/gateway/plugin.go | 1 - plugins/metrics/pkg/gateway/stream.go | 2 +- 12 files changed, 829 insertions(+), 287 deletions(-) diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index ed615423a3..1112555331 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -17,7 +17,7 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { split := strings.SplitN(s, "!~", 2) return &remoteread.LabelMatcher{ - Type: remoteread.LabelMatcher_NOT_REGEX_EQUAL, + Type: remoteread.LabelMatcher_NotRegexEqual, Name: split[0], Value: split[1], }, nil @@ -25,7 +25,7 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { split := strings.SplitN(s, "=~", 2) return &remoteread.LabelMatcher{ - Type: remoteread.LabelMatcher_REGEX_EQUAL, + Type: remoteread.LabelMatcher_RegexEqual, Name: split[0], Value: split[1], }, nil @@ -33,7 +33,7 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { split := strings.SplitN(s, "!=", 2) return &remoteread.LabelMatcher{ - Type: remoteread.LabelMatcher_NOT_EQUAL, + Type: remoteread.LabelMatcher_NotEqual, Name: split[0], Value: split[1], }, nil @@ -41,7 +41,7 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { split := strings.SplitN(s, "=", 2) return &remoteread.LabelMatcher{ - Type: remoteread.LabelMatcher_EQUAL, + Type: remoteread.LabelMatcher_Equal, Name: split[0], Value: split[1], }, nil @@ -57,7 +57,7 @@ func BuildImportTargetAddCmd() *cobra.Command { Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] - targetName := args[2] + targetName := args[1] endpoint := args[2] target := &remoteread.Target{ @@ -208,7 +208,7 @@ func BuildImportStartCmd() *cobra.Command { cmd := &cobra.Command{ Use: "start ", Short: "start", - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] targetName := args[1] @@ -231,9 +231,11 @@ func BuildImportStartCmd() *cobra.Command { } request := &remoteread.StartReadRequest{ - Meta: &remoteread.TargetMeta{ - ClusterId: clusterId, - Name: targetName, + Target: &remoteread.Target{ + Meta: &remoteread.TargetMeta{ + ClusterId: clusterId, + Name: targetName, + }, }, Query: query, ForceOverlap: forceOverlap, @@ -267,7 +269,7 @@ func BuildImportStopCmd() *cobra.Command { cmd := &cobra.Command{ Use: "stop ", Short: "stop", - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] targetName := args[1] diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index da3a75d170..2d46009a5d 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -30,6 +30,9 @@ type HttpServer struct { remoteWriteClientMu sync.RWMutex remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] + remoteReadClientMu sync.RWMutex + remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] + targetRunnerMu sync.RWMutex targetRunner clients.Locker[TargetRunner] @@ -61,6 +64,16 @@ func (s *HttpServer) SetRemoteWriteClient(client clients.Locker[remotewrite.Remo s.remoteWriteClient = client } +func (s *HttpServer) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { + s.remoteWriteClientMu.Lock() + defer s.remoteReadClientMu.Unlock() + + s.remoteReadClient = client +} + +// SetTargetRunner sets the runner of the HttpServer. If there is already a +// remotewrite.RemoteWriteClient set for the server, it will be passed to the +// runner using TargetRunner.SetRemoteWriteClient. func (s *HttpServer) SetTargetRunner(runner clients.Locker[TargetRunner]) { s.targetRunnerMu.Lock() defer s.targetRunnerMu.Unlock() @@ -176,7 +189,7 @@ func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { } s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Start(request.Meta.Name, request.Query); err != nil { + if err := runner.Start(request.Target, request.Query); err != nil { c.Status(http.StatusBadRequest) c.Error(err) return diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 0d73d1eae9..4619286053 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -27,7 +27,8 @@ import ( type MetricsNode struct { capabilityv1.UnsafeNodeServer controlv1.UnsafeHealthServer - remoteread.UnsafeRemoteReadAgentServer + //remoteread.UnsafeRemoteReadGatewayServer + remoteread.UnimplementedRemoteReadGatewayServer logger *zap.SugaredLogger @@ -41,7 +42,7 @@ type MetricsNode struct { healthListenerClient controlv1.HealthListenerClient remoteReadClientMu sync.RWMutex - remoteReadClient remoteread.RemoteReadAgentClient + remoteReadClient remoteread.RemoteReadGatewayClient configMu sync.RWMutex config *node.MetricsCapabilityConfig @@ -108,7 +109,7 @@ func (m *MetricsNode) SetHealthListenerClient(client controlv1.HealthListenerCli m.sendHealthUpdate() } -func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadAgentClient) { +func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadGatewayClient) { m.remoteReadClientMu.Lock() defer m.remoteReadClientMu.Unlock() @@ -166,6 +167,18 @@ func (m *MetricsNode) GetHealth(_ context.Context, _ *emptypb.Empty) (*corev1.He // Start Implements remoteread.RemoteReadServer +func (m *MetricsNode) UpdateTargetStatus(ctx context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { + m.remoteReadClientMu.Lock() + defer m.remoteReadClientMu.Unlock() + + if m.remoteReadClient == nil { + m.logger.Errorf("no remote read client doing nothing") + return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + } + + return m.remoteReadClient.UpdateTargetStatus(ctx, request) +} + func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { m.remoteReadClientMu.Lock() defer m.remoteReadClientMu.Unlock() diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 46a6a76c70..27ecc7f947 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -11,13 +11,11 @@ import ( "github.com/rancher/opni/pkg/clients" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "google.golang.org/protobuf/types/known/timestamppb" + "sync" "time" ) -func targetDoesNotExistError(name string) error { - return fmt.Errorf("target '%s' does not exist", name) -} - func targetIsRunningError(name string) error { return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", name) } @@ -34,13 +32,13 @@ func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.Label var matchType prompb.LabelMatcher_Type switch matcher.Type { - case remoteread.LabelMatcher_EQUAL: + case remoteread.LabelMatcher_Equal: matchType = prompb.LabelMatcher_EQ - case remoteread.LabelMatcher_NOT_EQUAL: + case remoteread.LabelMatcher_NotEqual: matchType = prompb.LabelMatcher_NEQ - case remoteread.LabelMatcher_REGEX_EQUAL: + case remoteread.LabelMatcher_RegexEqual: matchType = prompb.LabelMatcher_RE - case remoteread.LabelMatcher_NOT_REGEX_EQUAL: + case remoteread.LabelMatcher_NotRegexEqual: matchType = prompb.LabelMatcher_NRE default: // todo: log something @@ -72,26 +70,73 @@ type Run struct { query *remoteread.Query } +func (run *Run) failed(message string) { + run.target.Status.State = remoteread.TargetStatus_Failed + run.target.Status.Message = message +} + +func (run *Run) running() { + run.target.Status.State = remoteread.TargetStatus_Running + run.target.Status.Message = "" +} + +func (run *Run) complete() { + run.target.Status.State = remoteread.TargetStatus_Complete +} + +func (run *Run) stopped() { + run.target.Status.State = remoteread.TargetStatus_Stopped +} + +func (run *Run) updateLastRead(lastReadSec int64) { + run.target.Status.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) +} + +// todo: add logger +// todo: add context + type TargetRunner interface { - Start(name string, query *remoteread.Query) error + Start(target *remoteread.Target, query *remoteread.Query) error Stop(name string) error SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) + + SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) } func NewTargetRunner() TargetRunner { return &targetRunner{ - targets: make(map[string]*remoteread.Target), - runs: make(map[string]Run), + runs: make(map[string]Run), } } type targetRunner struct { - targets map[string]*remoteread.Target - runs map[string]Run + runsMu sync.RWMutex + runs map[string]Run remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] + remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] +} + +// updateRunStatus notifies the gateway of the status of the Run's target status +func (runner *targetRunner) updateRunStatus(run Run) { + runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { + newStatus := run.target.Status + newStatus.Message = "client field to read response from prometheus remote read endpoint" + newStatus.State = remoteread.TargetStatus_Failed + + request := &remoteread.TargetStatusUpdateRequest{ + Meta: run.target.Meta, + NewStatus: newStatus, + } + + _, err := client.UpdateTargetStatus(context.TODO(), request) + + if err != nil { + // todo: log this + } + }) } func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { @@ -103,7 +148,7 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { nextStart := run.query.StartTimestamp.AsTime().UnixMilli() - for nextStart < importEnd { + for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { nextEnd := nextStart + nextEndDelta if nextEnd > importEnd { nextEnd = importEnd @@ -122,7 +167,8 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { readResponse, err := remoteReadClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) if err != nil { - // todo: log this event + run.failed("failed to read from target endpoint") + runner.updateRunStatus(run) return } @@ -133,8 +179,9 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { uncompressed, err := proto.Marshal(&writeRequest) if err != nil { - // todo: log failure - continue + run.failed("failed to uncompress data from target endpoint") + runner.updateRunStatus(run) + return } compressed := snappy.Encode(nil, uncompressed) @@ -145,28 +192,41 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { - // todo: log this error + run.failed("failed to push to remote write") + runner.updateRunStatus(run) + return } + + run.updateLastRead(nextEnd) + runner.updateRunStatus(run) }) } } -} -func (runner *targetRunner) Start(name string, query *remoteread.Query) error { - if _, found := runner.runs[name]; found { - return targetIsRunningError(name) - } + run.complete() - target, found := runner.targets[name] + runner.runsMu.Lock() + defer runner.runsMu.Unlock() - if !found { - return targetDoesNotExistError(name) - } + delete(runner.runs, run.target.Meta.Name) +} - run := Run{ - stopChan: make(chan interface{}), - target: target, - query: query, +func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Query) error { + // We want to allow for restarting a Failed or Completed. We should not encounter NotRunning, Stopped, or Completed. + run, found := runner.runs[target.Meta.Name] + if found && run.target.Status.State == remoteread.TargetStatus_Running { + switch run.target.Status.State { + case remoteread.TargetStatus_Running: + return targetIsRunningError(target.Meta.Name) + default: + // todo: log restart + } + } else if !found { + run = Run{ + stopChan: make(chan interface{}), + target: target, + query: query, + } } prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Meta.Name), promConfig.WithHTTP2Disabled()) @@ -180,8 +240,11 @@ func (runner *targetRunner) Start(name string, query *remoteread.Query) error { remoteReadClient := NewRemoteReadClient(run.stopChan, prometheusClient) + runner.runsMu.Lock() + runner.runs[run.target.Meta.Name] = run + runner.runsMu.Unlock() + go runner.run(run, remoteReadClient) - runner.runs[name] = run return nil } @@ -193,6 +256,9 @@ func (runner *targetRunner) Stop(name string) error { return targetIsNotRunningError(name) } + run.stopped() + runner.updateRunStatus(run) + close(run.stopChan) delete(runner.runs, name) @@ -202,3 +268,7 @@ func (runner *targetRunner) Stop(name string) error { func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { runner.remoteWriteClient = client } + +func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { + runner.remoteReadClient = client +} diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index 6825a549b2..980c774f13 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -29,12 +29,14 @@ func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { p.httpServer.SetTargetRunner(clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { return NewTargetRunner() })) + p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) + p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) nodeClient := node.NewNodeMetricsCapabilityClient(cc) healthListenerClient := controlv1.NewHealthListenerClient(cc) identityClient := controlv1.NewIdentityClient(cc) - remoteReadClient := remoteread.NewRemoteReadAgentClient(cc) + remoteReadClient := remoteread.NewRemoteReadGatewayClient(cc) p.node.SetNodeClient(nodeClient) p.node.SetHealthListenerClient(healthListenerClient) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 5183eb587b..785879443f 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -24,28 +24,83 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type TargetStatus_State int32 + +const ( + TargetStatus_NotRunning TargetStatus_State = 0 + TargetStatus_Running TargetStatus_State = 1 + TargetStatus_Failed TargetStatus_State = 2 + TargetStatus_Complete TargetStatus_State = 3 + TargetStatus_Stopped TargetStatus_State = 4 +) + +// Enum value maps for TargetStatus_State. +var ( + TargetStatus_State_name = map[int32]string{ + 0: "NotRunning", + 1: "Running", + 2: "Failed", + 3: "Complete", + 4: "Stopped", + } + TargetStatus_State_value = map[string]int32{ + "NotRunning": 0, + "Running": 1, + "Failed": 2, + "Complete": 3, + "Stopped": 4, + } +) + +func (x TargetStatus_State) Enum() *TargetStatus_State { + p := new(TargetStatus_State) + *p = x + return p +} + +func (x TargetStatus_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetStatus_State) Descriptor() protoreflect.EnumDescriptor { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0].Descriptor() +} + +func (TargetStatus_State) Type() protoreflect.EnumType { + return &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0] +} + +func (x TargetStatus_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TargetStatus_State.Descriptor instead. +func (TargetStatus_State) EnumDescriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2, 0} +} + type LabelMatcher_Type int32 const ( - LabelMatcher_EQUAL LabelMatcher_Type = 0 - LabelMatcher_NOT_EQUAL LabelMatcher_Type = 1 - LabelMatcher_REGEX_EQUAL LabelMatcher_Type = 2 - LabelMatcher_NOT_REGEX_EQUAL LabelMatcher_Type = 3 + LabelMatcher_Equal LabelMatcher_Type = 0 + LabelMatcher_NotEqual LabelMatcher_Type = 1 + LabelMatcher_RegexEqual LabelMatcher_Type = 2 + LabelMatcher_NotRegexEqual LabelMatcher_Type = 3 ) // Enum value maps for LabelMatcher_Type. var ( LabelMatcher_Type_name = map[int32]string{ - 0: "EQUAL", - 1: "NOT_EQUAL", - 2: "REGEX_EQUAL", - 3: "NOT_REGEX_EQUAL", + 0: "Equal", + 1: "NotEqual", + 2: "RegexEqual", + 3: "NotRegexEqual", } LabelMatcher_Type_value = map[string]int32{ - "EQUAL": 0, - "NOT_EQUAL": 1, - "REGEX_EQUAL": 2, - "NOT_REGEX_EQUAL": 3, + "Equal": 0, + "NotEqual": 1, + "RegexEqual": 2, + "NotRegexEqual": 3, } ) @@ -60,11 +115,11 @@ func (x LabelMatcher_Type) String() string { } func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0].Descriptor() + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[1].Descriptor() } func (LabelMatcher_Type) Type() protoreflect.EnumType { - return &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[0] + return &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes[1] } func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { @@ -73,7 +128,7 @@ func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { // Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13, 0} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{15, 0} } type Target struct { @@ -199,7 +254,11 @@ type TargetStatus struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` + LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` + EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + State TargetStatus_State `protobuf:"varint,5,opt,name=state,proto3,enum=remoteread.TargetStatus_State" json:"state,omitempty"` } func (x *TargetStatus) Reset() { @@ -234,6 +293,13 @@ func (*TargetStatus) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2} } +func (x *TargetStatus) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp + } + return nil +} + func (x *TargetStatus) GetLastReadTimestamp() *timestamppb.Timestamp { if x != nil { return x.LastReadTimestamp @@ -241,6 +307,27 @@ func (x *TargetStatus) GetLastReadTimestamp() *timestamppb.Timestamp { return nil } +func (x *TargetStatus) GetEndTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.EndTimestamp + } + return nil +} + +func (x *TargetStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *TargetStatus) GetState() TargetStatus_State { + if x != nil { + return x.State + } + return TargetStatus_NotRunning +} + type TargetSpec struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -599,8 +686,8 @@ type StartReadRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` - Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Query *Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp ForceOverlap bool `protobuf:"varint,3,opt,name=forceOverlap,proto3" json:"forceOverlap,omitempty"` } @@ -637,9 +724,9 @@ func (*StartReadRequest) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} } -func (x *StartReadRequest) GetMeta() *TargetMeta { +func (x *StartReadRequest) GetTarget() *Target { if x != nil { - return x.Meta + return x.Target } return nil } @@ -705,6 +792,108 @@ func (x *StopReadRequest) GetMeta() *TargetMeta { return nil } +type TargetStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` +} + +func (x *TargetStatusRequest) Reset() { + *x = TargetStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetStatusRequest) ProtoMessage() {} + +func (x *TargetStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetStatusRequest.ProtoReflect.Descriptor instead. +func (*TargetStatusRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} +} + +func (x *TargetStatusRequest) GetMeta() *TargetMeta { + if x != nil { + return x.Meta + } + return nil +} + +type TargetStatusUpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Meta *TargetMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + NewStatus *TargetStatus `protobuf:"bytes,2,opt,name=newStatus,proto3" json:"newStatus,omitempty"` +} + +func (x *TargetStatusUpdateRequest) Reset() { + *x = TargetStatusUpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetStatusUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetStatusUpdateRequest) ProtoMessage() {} + +func (x *TargetStatusUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetStatusUpdateRequest.ProtoReflect.Descriptor instead. +func (*TargetStatusUpdateRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13} +} + +func (x *TargetStatusUpdateRequest) GetMeta() *TargetMeta { + if x != nil { + return x.Meta + } + return nil +} + +func (x *TargetStatusUpdateRequest) GetNewStatus() *TargetStatus { + if x != nil { + return x.NewStatus + } + return nil +} + // PromQL query type Query struct { state protoimpl.MessageState @@ -719,7 +908,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -732,7 +921,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -745,7 +934,7 @@ func (x *Query) ProtoReflect() protoreflect.Message { // Deprecated: Use Query.ProtoReflect.Descriptor instead. func (*Query) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{14} } func (x *Query) GetStartTimestamp() *timestamppb.Timestamp { @@ -782,7 +971,7 @@ type LabelMatcher struct { func (x *LabelMatcher) Reset() { *x = LabelMatcher{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -795,7 +984,7 @@ func (x *LabelMatcher) String() string { func (*LabelMatcher) ProtoMessage() {} func (x *LabelMatcher) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -808,14 +997,14 @@ func (x *LabelMatcher) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. func (*LabelMatcher) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{15} } func (x *LabelMatcher) GetType() LabelMatcher_Type { if x != nil { return x.Type } - return LabelMatcher_EQUAL + return LabelMatcher_Equal } func (x *LabelMatcher) GetName() string { @@ -845,7 +1034,7 @@ type Progress struct { func (x *Progress) Reset() { *x = Progress{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -858,7 +1047,7 @@ func (x *Progress) String() string { func (*Progress) ProtoMessage() {} func (x *Progress) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -871,7 +1060,7 @@ func (x *Progress) ProtoReflect() protoreflect.Message { // Deprecated: Use Progress.ProtoReflect.Descriptor instead. func (*Progress) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{14} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{16} } func (x *Progress) GetStartTimestamp() *timestamppb.Timestamp { @@ -926,131 +1115,171 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x58, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, - 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x28, 0x0a, 0x0a, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x44, 0x69, 0x66, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, - 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, + 0x49, 0x64, 0x22, 0xf9, 0x02, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, + 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x22, 0x4b, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, + 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, + 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, + 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x04, 0x22, 0x28, + 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x73, 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x77, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, + 0x61, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x8b, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, - 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, + 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x41, 0x0a, 0x13, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, - 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, - 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x01, - 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x27, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, 0x0f, 0x53, - 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, - 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xb3, - 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, - 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x04, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, - 0x0a, 0x0b, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, - 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x5f, 0x45, 0x51, 0x55, - 0x41, 0x4c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, + 0x7f, 0x0a, 0x19, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, + 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, + 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x42, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x71, + 0x75, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, + 0x6c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, + 0x6c, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, + 0x71, 0x75, 0x61, 0x6c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xa6, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, - 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xc9, 0x04, 0x0a, 0x11, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, + 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, + 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, + 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, + 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, + 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, + 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1065,68 +1294,81 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescData } -var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = []interface{}{ - (LabelMatcher_Type)(0), // 0: remoteread.LabelMatcher.Type - (*Target)(nil), // 1: remoteread.Target - (*TargetMeta)(nil), // 2: remoteread.TargetMeta - (*TargetStatus)(nil), // 3: remoteread.TargetStatus - (*TargetSpec)(nil), // 4: remoteread.TargetSpec - (*TargetDiff)(nil), // 5: remoteread.TargetDiff - (*TargetList)(nil), // 6: remoteread.TargetList - (*TargetAddRequest)(nil), // 7: remoteread.TargetAddRequest - (*TargetEditRequest)(nil), // 8: remoteread.TargetEditRequest - (*TargetRemoveRequest)(nil), // 9: remoteread.TargetRemoveRequest - (*TargetListRequest)(nil), // 10: remoteread.TargetListRequest - (*StartReadRequest)(nil), // 11: remoteread.StartReadRequest - (*StopReadRequest)(nil), // 12: remoteread.StopReadRequest - (*Query)(nil), // 13: remoteread.Query - (*LabelMatcher)(nil), // 14: remoteread.LabelMatcher - (*Progress)(nil), // 15: remoteread.Progress - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty + (TargetStatus_State)(0), // 0: remoteread.TargetStatus.State + (LabelMatcher_Type)(0), // 1: remoteread.LabelMatcher.Type + (*Target)(nil), // 2: remoteread.Target + (*TargetMeta)(nil), // 3: remoteread.TargetMeta + (*TargetStatus)(nil), // 4: remoteread.TargetStatus + (*TargetSpec)(nil), // 5: remoteread.TargetSpec + (*TargetDiff)(nil), // 6: remoteread.TargetDiff + (*TargetList)(nil), // 7: remoteread.TargetList + (*TargetAddRequest)(nil), // 8: remoteread.TargetAddRequest + (*TargetEditRequest)(nil), // 9: remoteread.TargetEditRequest + (*TargetRemoveRequest)(nil), // 10: remoteread.TargetRemoveRequest + (*TargetListRequest)(nil), // 11: remoteread.TargetListRequest + (*StartReadRequest)(nil), // 12: remoteread.StartReadRequest + (*StopReadRequest)(nil), // 13: remoteread.StopReadRequest + (*TargetStatusRequest)(nil), // 14: remoteread.TargetStatusRequest + (*TargetStatusUpdateRequest)(nil), // 15: remoteread.TargetStatusUpdateRequest + (*Query)(nil), // 16: remoteread.Query + (*LabelMatcher)(nil), // 17: remoteread.LabelMatcher + (*Progress)(nil), // 18: remoteread.Progress + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 20: google.protobuf.Empty } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = []int32{ - 2, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMeta - 4, // 1: remoteread.Target.spec:type_name -> remoteread.TargetSpec - 3, // 2: remoteread.Target.status:type_name -> remoteread.TargetStatus - 16, // 3: remoteread.TargetStatus.lastReadTimestamp:type_name -> google.protobuf.Timestamp - 1, // 4: remoteread.TargetList.targets:type_name -> remoteread.Target - 1, // 5: remoteread.TargetAddRequest.target:type_name -> remoteread.Target - 2, // 6: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta - 5, // 7: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff - 2, // 8: remoteread.TargetRemoveRequest.meta:type_name -> remoteread.TargetMeta - 2, // 9: remoteread.StartReadRequest.meta:type_name -> remoteread.TargetMeta - 13, // 10: remoteread.StartReadRequest.query:type_name -> remoteread.Query - 2, // 11: remoteread.StopReadRequest.meta:type_name -> remoteread.TargetMeta - 16, // 12: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp - 16, // 13: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp - 14, // 14: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher - 0, // 15: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type - 16, // 16: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp - 16, // 17: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp - 7, // 18: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest - 8, // 19: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest - 9, // 20: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest - 10, // 21: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest - 11, // 22: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest - 12, // 23: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest - 11, // 24: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest - 12, // 25: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest - 17, // 26: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty - 17, // 27: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty - 17, // 28: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty - 6, // 29: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList - 17, // 30: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty - 17, // 31: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty - 17, // 32: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty - 17, // 33: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty - 26, // [26:34] is the sub-list for method output_type - 18, // [18:26] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 3, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMeta + 5, // 1: remoteread.Target.spec:type_name -> remoteread.TargetSpec + 4, // 2: remoteread.Target.status:type_name -> remoteread.TargetStatus + 19, // 3: remoteread.TargetStatus.startTimestamp:type_name -> google.protobuf.Timestamp + 19, // 4: remoteread.TargetStatus.lastReadTimestamp:type_name -> google.protobuf.Timestamp + 19, // 5: remoteread.TargetStatus.endTimestamp:type_name -> google.protobuf.Timestamp + 0, // 6: remoteread.TargetStatus.state:type_name -> remoteread.TargetStatus.State + 2, // 7: remoteread.TargetList.targets:type_name -> remoteread.Target + 2, // 8: remoteread.TargetAddRequest.target:type_name -> remoteread.Target + 3, // 9: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta + 6, // 10: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff + 3, // 11: remoteread.TargetRemoveRequest.meta:type_name -> remoteread.TargetMeta + 2, // 12: remoteread.StartReadRequest.target:type_name -> remoteread.Target + 16, // 13: remoteread.StartReadRequest.query:type_name -> remoteread.Query + 3, // 14: remoteread.StopReadRequest.meta:type_name -> remoteread.TargetMeta + 3, // 15: remoteread.TargetStatusRequest.meta:type_name -> remoteread.TargetMeta + 3, // 16: remoteread.TargetStatusUpdateRequest.meta:type_name -> remoteread.TargetMeta + 4, // 17: remoteread.TargetStatusUpdateRequest.newStatus:type_name -> remoteread.TargetStatus + 19, // 18: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp + 19, // 19: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp + 17, // 20: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher + 1, // 21: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type + 19, // 22: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp + 19, // 23: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp + 8, // 24: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest + 9, // 25: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest + 10, // 26: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest + 11, // 27: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest + 14, // 28: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 15, // 29: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest + 12, // 30: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 13, // 31: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 12, // 32: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest + 13, // 33: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest + 20, // 34: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 20, // 35: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 20, // 36: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 7, // 37: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 4, // 38: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus + 20, // 39: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty + 20, // 40: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty + 20, // 41: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty + 20, // 42: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 20, // 43: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 34, // [34:44] is the sub-list for method output_type + 24, // [24:34] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() } @@ -1280,7 +1522,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { + switch v := v.(*TargetStatusRequest); i { case 0: return &v.state case 1: @@ -1292,7 +1534,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelMatcher); i { + switch v := v.(*TargetStatusUpdateRequest); i { case 0: return &v.state case 1: @@ -1304,6 +1546,30 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Progress); i { case 0: return &v.state @@ -1321,8 +1587,8 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc, - NumEnums: 1, - NumMessages: 15, + NumEnums: 2, + NumMessages: 17, NumExtensions: 0, NumServices: 2, }, diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index b444592c8c..9369a113fe 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -10,20 +10,23 @@ import "google/api/annotations.proto"; package remoteread; // todo: we probably need a new type for Describe and ScanFor +// RemoteReadGateway handles requests from the agent / cli. service RemoteReadGateway { // rpc ScanForTargets(google.protobuf.Empty) returns (stream/ Target); // rpc Describe(Target) returns (Target) -// rpc GetProgress(ProgressRequest) returns (stream Progress); rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); rpc EditTarget(TargetEditRequest) returns (google.protobuf.Empty); rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); rpc ListTargets(TargetListRequest) returns (TargetList); + rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); + rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); + rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); } -// RemoteReadAgent does not need to have the same target methods since those will be store by the gateway +// RemoteReadAgent handles requests to the agent. service RemoteReadAgent { rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); @@ -41,7 +44,19 @@ message TargetMeta { } message TargetStatus { - google.protobuf.Timestamp lastReadTimestamp = 1; + enum State { + NotRunning = 0; + Running = 1; + Failed = 2; + Complete = 3; + Stopped = 4; + } + + google.protobuf.Timestamp startTimestamp = 1; + google.protobuf.Timestamp lastReadTimestamp = 2; + google.protobuf.Timestamp endTimestamp = 3; + string message = 4; + State state = 5; } message TargetSpec { @@ -76,7 +91,7 @@ message TargetListRequest { } message StartReadRequest { - TargetMeta meta = 1; + Target target = 1; Query query = 2; // allow for forcing a remote read when Query.startTimestamp > Target.meta.lastReadTimestamp @@ -87,6 +102,15 @@ message StopReadRequest { TargetMeta meta = 1; } +message TargetStatusRequest { + TargetMeta meta = 1; +} + +message TargetStatusUpdateRequest { + TargetMeta meta = 1; + TargetStatus newStatus = 2; +} + // PromQL query message Query { google.protobuf.Timestamp startTimestamp = 1; @@ -96,10 +120,10 @@ message Query { message LabelMatcher { enum Type { - EQUAL = 0; - NOT_EQUAL = 1; - REGEX_EQUAL = 2; - NOT_REGEX_EQUAL = 3; + Equal = 0; + NotEqual = 1; + RegexEqual = 2; + NotRegexEqual = 3; } Type type = 1; diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index 9f94e2dd89..a7d6f58fa8 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -27,6 +27,8 @@ type RemoteReadGatewayClient interface { EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) + GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) + UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -75,6 +77,24 @@ func (c *remoteReadGatewayClient) ListTargets(ctx context.Context, in *TargetLis return out, nil } +func (c *remoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) { + out := new(TargetStatus) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/GetTargetStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *remoteReadGatewayClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/UpdateTargetStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *remoteReadGatewayClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Start", in, out, opts...) @@ -101,6 +121,8 @@ type RemoteReadGatewayServer interface { EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) + GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) + UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) mustEmbedUnimplementedRemoteReadGatewayServer() @@ -122,6 +144,12 @@ func (UnimplementedRemoteReadGatewayServer) RemoveTarget(context.Context, *Targe func (UnimplementedRemoteReadGatewayServer) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented") } +func (UnimplementedRemoteReadGatewayServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") +} +func (UnimplementedRemoteReadGatewayServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") +} func (UnimplementedRemoteReadGatewayServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } @@ -213,6 +241,42 @@ func _RemoteReadGateway_ListTargets_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _RemoteReadGateway_GetTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadGateway/GetTargetStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, req.(*TargetStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RemoteReadGateway_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadGateway/UpdateTargetStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _RemoteReadGateway_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartReadRequest) if err := dec(in); err != nil { @@ -272,6 +336,14 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListTargets", Handler: _RemoteReadGateway_ListTargets_Handler, }, + { + MethodName: "GetTargetStatus", + Handler: _RemoteReadGateway_GetTargetStatus_Handler, + }, + { + MethodName: "UpdateTargetStatus", + Handler: _RemoteReadGateway_UpdateTargetStatus_Handler, + }, { MethodName: "Start", Handler: _RemoteReadGateway_Start_Handler, diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 3427f04611..0d48318ce1 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -59,7 +59,6 @@ type MetricsBackendConfig struct { StorageBackend storage.Backend `validate:"required"` MgmtClient managementv1.ManagementClient `validate:"required"` NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` - RemoteReadForwarder RemoteReadForwarder `validate:"required"` UninstallController *task.Controller `validate:"required"` ClusterDriver drivers.ClusterDriver `validate:"required"` } @@ -291,6 +290,7 @@ func (m *MetricsBackend) requestNodeSync(ctx context.Context, cluster *corev1.Re } // Implements node.NodeMetricsCapabilityServer + func (m *MetricsBackend) Sync(ctx context.Context, req *node.SyncRequest) (*node.SyncResponse, error) { m.WaitForInit() // todo: validate @@ -419,23 +419,28 @@ func (m *MetricsBackend) UninstallCluster(ctx context.Context, in *emptypb.Empty // Metrics Remote Read Backend // todo: handle running targets (disallow all edits / deletes / etc) -func targetAlreadyExistsError(name string) error { - return fmt.Errorf("target '%s' already exists", name) +func targetAlreadyRunningError(id string) error { + return fmt.Errorf("target '%s' is already running", id) +} + +func targetAlreadyExistsError(id string) error { + return fmt.Errorf("target '%s' already exists", id) } -func targetDoesNotExistError(name string) error { - return fmt.Errorf("target '%s' does not exist", name) +func targetDoesNotExistError(id string) error { + return fmt.Errorf("target '%s' does not exist", id) } func getIdFromTargetMeta(meta *remoteread.TargetMeta) string { - return fmt.Sprintf("%s:%s", meta.Name, meta.ClusterId) + return meta.String() + //return fmt.Sprintf("%s:%s", meta.Name, meta.ClusterId) } func (m *MetricsBackend) AddTarget(_ context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() - targetId := request.Target.Meta.String() + targetId := getIdFromTargetMeta(request.Target.Meta) if _, found := m.remoteReadTargets[targetId]; found { return nil, targetAlreadyExistsError(targetId) @@ -464,7 +469,7 @@ func (m *MetricsBackend) EditTarget(_ context.Context, request *remoteread.Targe m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() - targetId := request.Meta.String() + targetId := getIdFromTargetMeta(request.Meta) diff := request.TargetDiff target, found := m.remoteReadTargets[targetId] @@ -474,7 +479,7 @@ func (m *MetricsBackend) EditTarget(_ context.Context, request *remoteread.Targe if diff.Name != "" { target.Meta.Name = diff.Name - newTargetId := target.Meta.String() + newTargetId := getIdFromTargetMeta(target.Meta) if _, found := m.remoteReadTargets[newTargetId]; found { return nil, targetAlreadyExistsError(diff.Name) @@ -507,7 +512,7 @@ func (m *MetricsBackend) RemoveTarget(_ context.Context, request *remoteread.Tar m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() - targetId := request.Meta.String() + targetId := getIdFromTargetMeta(request.Meta) if _, found := m.remoteReadTargets[targetId]; !found { return nil, targetDoesNotExistError(request.Meta.Name) @@ -530,7 +535,7 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() - // todo: we can probably make this smaller + // todo: we can probably shrink this later inner := make([]*remoteread.Target, 0, len(m.remoteReadTargets)) for _, target := range m.remoteReadTargets { @@ -544,16 +549,67 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ return list, nil } +func (m *MetricsBackend) GetTargetStatus(_ context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { + m.WaitForInit() + + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() + + targetId := getIdFromTargetMeta(request.Meta) + + target, found := m.remoteReadTargets[targetId] + if !found { + return nil, targetDoesNotExistError(targetId) + } + + return target.Status, nil +} + +func (m *MetricsBackend) UpdateTargetStatus(_ context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { + m.WaitForInit() + + m.remoteReadTargetMu.Lock() + defer m.remoteReadTargetMu.Unlock() + + targetId := getIdFromTargetMeta(request.Meta) + + target, found := m.remoteReadTargets[targetId] + if !found { + return nil, targetDoesNotExistError(targetId) + } + + target.Status = request.NewStatus + + return &emptypb.Empty{}, nil +} + func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - _, err := m.RemoteReadForwarder.Start(ctx, request) + targetId := getIdFromTargetMeta(request.Target.Meta) + + m.remoteReadTargetMu.Lock() + target, found := m.remoteReadTargets[targetId] + m.remoteReadTargetMu.Unlock() + + if !found { + return nil, targetDoesNotExistError(targetId) + } + + request.Target = target + + if target.Status.State == remoteread.TargetStatus_Running { + return nil, targetAlreadyRunningError(targetId) + } + + // todo: send start request to appropriate agent + _, err := 0, fmt.Errorf("not yet implemented") if err != nil { m.Logger.With( - "cluster", request.Meta.Name, + "cluster", request.Target.Meta.Name, "capability", wellknown.CapabilityMetrics, - "target", request.Meta.Name, + "target", request.Target.Meta.Name, zap.Error(err), ).Warn("failed to start client") @@ -562,8 +618,8 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea // todo: we might want to display the new name if it was changed m.Logger.With( - "cluster", request.Meta.Name, - "target", request.Meta.Name, + "cluster", request.Target.Meta.Name, + "target", request.Target.Meta.Name, "capability", wellknown.CapabilityMetrics, ).Info("target started") @@ -573,7 +629,8 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - _, err := m.RemoteReadForwarder.Stop(ctx, request) + // todo: send start request to appropriate agent + _, err := 0, fmt.Errorf("not yet implemented") if err != nil { m.Logger.With( diff --git a/plugins/metrics/pkg/backend/remoteread.go b/plugins/metrics/pkg/backend/remoteread.go index f1f8876f00..df923fa10e 100644 --- a/plugins/metrics/pkg/backend/remoteread.go +++ b/plugins/metrics/pkg/backend/remoteread.go @@ -2,20 +2,44 @@ package backend import ( "context" + "github.com/rancher/opni/pkg/util" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + metricsutil "github.com/rancher/opni/plugins/metrics/pkg/util" "google.golang.org/protobuf/types/known/emptypb" ) -var _ remoteread.RemoteReadAgentServer = (*RemoteReadForwarder)(nil) +var _ remoteread.RemoteReadGatewayServer = (*RemoteReadForwarder)(nil) + +type RemoteReadForwarderConfig struct { + client remoteread.RemoteReadGatewayClient +} type RemoteReadForwarder struct { - remoteread.UnsafeRemoteReadAgentServer + // todo: add missing functions (add, edit, rm, etc) this is fine for testing but bad for production + remoteread.UnimplementedRemoteReadGatewayServer + RemoteReadForwarderConfig + util.Initializer +} + +func (fwd *RemoteReadForwarder) Initialize(conf RemoteReadForwarderConfig) { + fwd.InitOnce(func() { + if err := metricsutil.Validate.Struct(conf); err != nil { + panic(err) + } + fwd.RemoteReadForwarderConfig = conf + }) } func (fwd *RemoteReadForwarder) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - return &emptypb.Empty{}, nil + panic("not yet implemented") + //return &emptypb.Empty{}, nil } func (fwd *RemoteReadForwarder) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - return &emptypb.Empty{}, nil + panic("not yet implemented") + //return &emptypb.Empty{}, nil +} + +func (fwd *RemoteReadForwarder) UpdateTargetStatus(ctx context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { + return fwd.client.UpdateTargetStatus(ctx, request) } diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index af8e47d330..cf186cb662 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -48,7 +48,6 @@ type Plugin struct { mgmtClient future.Future[managementv1.ManagementClient] nodeManagerClient future.Future[capabilityv1.NodeManagerClient] storageBackend future.Future[storage.Backend] - remoteReadClient future.Future[remoteread.RemoteReadGatewayClient] cortexTlsConfig future.Future[*tls.Config] cortexClientSet future.Future[cortex.ClientSet] uninstallController future.Future[*task.Controller] diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index 53d48235c2..905b387b7a 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -17,7 +17,7 @@ func (p *Plugin) StreamServers() []streamext.Server { }, { Desc: &remoteread.RemoteReadGateway_ServiceDesc, - Impl: nil, // todo: create && set this impl + Impl: &p.metrics, RequireCapability: wellknown.CapabilityMetrics, }, { From 3ffebd3dc729a5203c5683d42369a796ad2f9c5b Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:30:53 -0500 Subject: [PATCH 08/43] ready for demo --- pkg/opni/commands/import.go | 15 +- plugins/metrics/pkg/agent/runner.go | 8 +- plugins/metrics/pkg/backend/metrics.go | 28 +- plugins/metrics/pkg/backend/remoteread.go | 45 --- plugins/metrics/pkg/cortex/remotewrite.go | 10 +- .../metrics/pkg/gateway/demo/remoteread.go | 87 ++++++ plugins/metrics/pkg/gateway/demo/runner.go | 292 ++++++++++++++++++ plugins/metrics/pkg/gateway/plugin.go | 1 + 8 files changed, 417 insertions(+), 69 deletions(-) delete mode 100644 plugins/metrics/pkg/backend/remoteread.go create mode 100644 plugins/metrics/pkg/gateway/demo/remoteread.go create mode 100644 plugins/metrics/pkg/gateway/demo/runner.go diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 1112555331..c90bd370ed 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -201,8 +201,8 @@ func BuildImportTargetCmd() *cobra.Command { func BuildImportStartCmd() *cobra.Command { var labelFilters []string - var startTimestamp int64 - var endTimestamp int64 + var startTimestampSecs int64 + var endTimestampSecs int64 var forceOverlap bool cmd := &cobra.Command{ @@ -225,8 +225,8 @@ func BuildImportStartCmd() *cobra.Command { } query := &remoteread.Query{ - StartTimestamp: ×tamppb.Timestamp{Seconds: startTimestamp}, - EndTimestamp: ×tamppb.Timestamp{Seconds: endTimestamp}, + StartTimestamp: ×tamppb.Timestamp{Seconds: startTimestampSecs}, + EndTimestamp: ×tamppb.Timestamp{Seconds: endTimestampSecs}, Matchers: labelMatchers, } @@ -253,9 +253,10 @@ func BuildImportStartCmd() *cobra.Command { cmd.Flags().StringSliceVar(&labelFilters, "filters", []string{"__name__=~\".+\""}, "promql query for the thing") - // todo: we probably want to allow for more human readable timestamps here - cmd.Flags().Int64Var(&startTimestamp, "start", 0, "start time for the remote read") - cmd.Flags().Int64Var(&endTimestamp, "end", time.Now().Unix(), "start time for the remote read") + // todo: we probably want to allow for more human-readable timestamps here + //cmd.Flags().Int64Var(&startTimestampSecs, "start", 0, "start time for the remote read") + cmd.Flags().Int64Var(&startTimestampSecs, "start", time.Now().Unix()-int64(time.Hour.Seconds())*2, "start time for the remote read in seconds since epoch") + cmd.Flags().Int64Var(&endTimestampSecs, "end", time.Now().Unix(), "start time for the remote read") cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 27ecc7f947..d111a098a8 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -139,7 +139,7 @@ func (runner *targetRunner) updateRunStatus(run Run) { }) } -func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { +func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { labelMatchers := toLabelMatchers(run.query.Matchers) // todo: this should probably be a lot more sophisticated than this @@ -164,7 +164,7 @@ func (runner *targetRunner) run(run Run, remoteReadClient *RemoteReaderClient) { }, } - readResponse, err := remoteReadClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) + readResponse, err := remoteReaderClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) if err != nil { run.failed("failed to read from target endpoint") @@ -238,13 +238,13 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q RoundTripper: prometheusClient.Transport, } - remoteReadClient := NewRemoteReadClient(run.stopChan, prometheusClient) + remoteReaderClient := NewRemoteReadClient(run.stopChan, prometheusClient) runner.runsMu.Lock() runner.runs[run.target.Meta.Name] = run runner.runsMu.Unlock() - go runner.run(run, remoteReadClient) + go runner.run(run, remoteReaderClient) return nil } diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 0d48318ce1..72197cf596 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/rancher/opni/plugins/metrics/pkg/cortex" + "github.com/rancher/opni/plugins/metrics/pkg/gateway/demo" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -47,6 +49,8 @@ type MetricsBackend struct { remoteReadTargetMu sync.RWMutex remoteReadTargets map[string]*remoteread.Target + runner demo.TargetRunner + util.Initializer } @@ -61,6 +65,8 @@ type MetricsBackendConfig struct { NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` UninstallController *task.Controller `validate:"required"` ClusterDriver drivers.ClusterDriver `validate:"required"` + + RemoteWriteClient *cortex.RemoteWriteForwarder `validate:"required"` } func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { @@ -72,6 +78,10 @@ func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { m.nodeStatus = make(map[string]*capabilityv1.NodeCapabilityStatus) m.desiredNodeSpec = make(map[string]*node.MetricsCapabilitySpec) m.remoteReadTargets = make(map[string]*remoteread.Target) + + m.runner = demo.NewTargetRunner(m.Logger.Named("target-runner")) + m.runner.SetRemoteWriteForwarder(m.RemoteWriteClient) + m.runner.SetRemoteReadServer(m) }) } @@ -458,7 +468,7 @@ func (m *MetricsBackend) AddTarget(_ context.Context, request *remoteread.Target "cluster", request.Target.Meta.ClusterId, "target", request.Target.Meta.Name, "capability", wellknown.CapabilityMetrics, - ).Infof("added new target '%s'", targetId) + ).Infof("added new target") return &emptypb.Empty{}, nil } @@ -501,7 +511,7 @@ func (m *MetricsBackend) EditTarget(_ context.Context, request *remoteread.Targe "cluster", request.Meta.ClusterId, "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - ).Infof("edited target '%s'", targetId) + ).Infof("edited target") return &emptypb.Empty{}, nil } @@ -524,7 +534,7 @@ func (m *MetricsBackend) RemoveTarget(_ context.Context, request *remoteread.Tar "cluster", request.Meta.ClusterId, "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, - ).Infof("removed target '%s'", targetId) + ).Infof("removed target") return &emptypb.Empty{}, nil } @@ -602,8 +612,7 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea return nil, targetAlreadyRunningError(targetId) } - // todo: send start request to appropriate agent - _, err := 0, fmt.Errorf("not yet implemented") + err := m.runner.Start(request.Target, request.Query) if err != nil { m.Logger.With( @@ -611,12 +620,11 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea "capability", wellknown.CapabilityMetrics, "target", request.Target.Meta.Name, zap.Error(err), - ).Warn("failed to start client") + ).Warn("failed to start target") return nil, err } - // todo: we might want to display the new name if it was changed m.Logger.With( "cluster", request.Target.Meta.Name, "target", request.Target.Meta.Name, @@ -629,8 +637,10 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { m.WaitForInit() + err := m.runner.Stop(request.Meta.Name) + // todo: send start request to appropriate agent - _, err := 0, fmt.Errorf("not yet implemented") + //_, err := 0, fmt.Errorf("not yet implemented") if err != nil { m.Logger.With( @@ -638,7 +648,7 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR "capability", wellknown.CapabilityMetrics, "target", request.Meta.Name, zap.Error(err), - ).Warn("failed to stop client") + ).Warn("failed to stop target") return nil, err } diff --git a/plugins/metrics/pkg/backend/remoteread.go b/plugins/metrics/pkg/backend/remoteread.go deleted file mode 100644 index df923fa10e..0000000000 --- a/plugins/metrics/pkg/backend/remoteread.go +++ /dev/null @@ -1,45 +0,0 @@ -package backend - -import ( - "context" - "github.com/rancher/opni/pkg/util" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" - metricsutil "github.com/rancher/opni/plugins/metrics/pkg/util" - "google.golang.org/protobuf/types/known/emptypb" -) - -var _ remoteread.RemoteReadGatewayServer = (*RemoteReadForwarder)(nil) - -type RemoteReadForwarderConfig struct { - client remoteread.RemoteReadGatewayClient -} - -type RemoteReadForwarder struct { - // todo: add missing functions (add, edit, rm, etc) this is fine for testing but bad for production - remoteread.UnimplementedRemoteReadGatewayServer - RemoteReadForwarderConfig - util.Initializer -} - -func (fwd *RemoteReadForwarder) Initialize(conf RemoteReadForwarderConfig) { - fwd.InitOnce(func() { - if err := metricsutil.Validate.Struct(conf); err != nil { - panic(err) - } - fwd.RemoteReadForwarderConfig = conf - }) -} - -func (fwd *RemoteReadForwarder) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - panic("not yet implemented") - //return &emptypb.Empty{}, nil -} - -func (fwd *RemoteReadForwarder) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - panic("not yet implemented") - //return &emptypb.Empty{}, nil -} - -func (fwd *RemoteReadForwarder) UpdateTargetStatus(ctx context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { - return fwd.client.UpdateTargetStatus(ctx, request) -} diff --git a/plugins/metrics/pkg/cortex/remotewrite.go b/plugins/metrics/pkg/cortex/remotewrite.go index 2e207f76d2..3f6eab0a21 100644 --- a/plugins/metrics/pkg/cortex/remotewrite.go +++ b/plugins/metrics/pkg/cortex/remotewrite.go @@ -50,10 +50,12 @@ func (f *RemoteWriteForwarder) Push(ctx context.Context, payload *remotewrite.Pa if !f.Initialized() { return nil, util.StatusError(codes.Unavailable) } - clusterId, ok := cluster.AuthorizedIDFromIncomingContext(ctx) - if !ok { - return nil, status.Error(codes.Unauthenticated, "no cluster ID found in context") - } + //clusterId, ok := cluster.AuthorizedIDFromIncomingContext(ctx) + //if !ok { + // return nil, status.Error(codes.Unauthenticated, "no cluster ID found in context") + //} + + clusterId := "cluster-0" defer func() { code := status.Code(pushErr) diff --git a/plugins/metrics/pkg/gateway/demo/remoteread.go b/plugins/metrics/pkg/gateway/demo/remoteread.go new file mode 100644 index 0000000000..16b2ced0d6 --- /dev/null +++ b/plugins/metrics/pkg/gateway/demo/remoteread.go @@ -0,0 +1,87 @@ +package demo + +import ( + "bytes" + "context" + "fmt" + "github.com/golang/protobuf/proto" + "github.com/golang/snappy" + "github.com/prometheus/common/version" + "github.com/prometheus/prometheus/prompb" + "io" + "net/http" + "time" +) + +type RemoteReaderClient struct { + stopChan chan interface{} + prometheusClient *http.Client +} + +func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { + return &RemoteReaderClient{ + stopChan: stopChan, + prometheusClient: prometheusClient, + } +} + +func (client *RemoteReaderClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { + uncompressedData, err := proto.Marshal(readRequest) + if err != nil { + return nil, fmt.Errorf("unable to marshal remote read readRequest: %w", err) + } + + compressedData := snappy.Encode(nil, uncompressedData) + + request, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewReader(compressedData)) + if err != nil { + return nil, fmt.Errorf("unable to crete remote read http readRequest: %w", err) + } + + request.Header.Add("Content-Encoding", "snappy") + request.Header.Add("Accept-Encoding", "snappy") + request.Header.Set("Content-Type", "application/x-protobuf") + request.Header.Set("User-Agent", "Prometheus/xx") + request.Header.Set("X-Prometheus-Remote-Read-Version", fmt.Sprintf("Prometheus/%s", version.Version)) + + // todo: timeout should be configurable + ctx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + + request = request.WithContext(ctx) + + response, err := client.prometheusClient.Do(request) + if err != nil { + return nil, fmt.Errorf("could not get response from rmeote read: %w", err) + } + + defer func() { + _, _ = io.Copy(io.Discard, response.Body) + _ = response.Body.Close() + }() + + var reader bytes.Buffer + _, _ = io.Copy(&reader, response.Body) + + compressedData, err = io.ReadAll(bytes.NewReader(reader.Bytes())) + if err != nil { + return nil, fmt.Errorf("error reading http response: %w", err) + } + + if response.StatusCode/100 != 2 { + return nil, fmt.Errorf("endpoint '%s' responded with status code '%d'", endpoint, response.StatusCode) + } + + uncompressedData, err = snappy.Decode(nil, compressedData) + if err != nil { + return nil, fmt.Errorf("unabled to uncompress reponse: %w", err) + } + + var readResponse prompb.ReadResponse + err = proto.Unmarshal(uncompressedData, &readResponse) + if err != nil { + return nil, fmt.Errorf("could not unmarshal remote read reponse: %w", err) + } + + return &readResponse, nil +} diff --git a/plugins/metrics/pkg/gateway/demo/runner.go b/plugins/metrics/pkg/gateway/demo/runner.go new file mode 100644 index 0000000000..3b04f7b1f6 --- /dev/null +++ b/plugins/metrics/pkg/gateway/demo/runner.go @@ -0,0 +1,292 @@ +package demo + +import ( + "context" + "fmt" + "github.com/golang/protobuf/proto" + "github.com/golang/snappy" + "github.com/opentracing-contrib/go-stdlib/nethttp" + promConfig "github.com/prometheus/common/config" + "github.com/prometheus/prometheus/prompb" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "github.com/rancher/opni/plugins/metrics/pkg/cortex" + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/timestamppb" + "sync" + "time" +) + +func targetIsRunningError(name string) error { + return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", name) +} + +func targetIsNotRunningError(name string) error { + return fmt.Errorf("target '%s' is not running", name) +} + +// todo: import prometheus LabelMatcher into plugins/metrics/pkg/apis/remoteread.proto to remove this +func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { + pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) + + for _, matcher := range rrLabelMatchers { + var matchType prompb.LabelMatcher_Type + + switch matcher.Type { + case remoteread.LabelMatcher_Equal: + matchType = prompb.LabelMatcher_EQ + case remoteread.LabelMatcher_NotEqual: + matchType = prompb.LabelMatcher_NEQ + case remoteread.LabelMatcher_RegexEqual: + matchType = prompb.LabelMatcher_RE + case remoteread.LabelMatcher_NotRegexEqual: + matchType = prompb.LabelMatcher_NRE + default: + // todo: log something + } + + pbLabelMatchers = append(pbLabelMatchers, &prompb.LabelMatcher{ + Type: matchType, + Name: matcher.Name, + Value: matcher.Value, + }) + } + + return pbLabelMatchers +} + +func dereferenceResultTimeseries(in []*prompb.TimeSeries) []prompb.TimeSeries { + dereferenced := make([]prompb.TimeSeries, 0, len(in)) + + for _, ref := range in { + dereferenced = append(dereferenced, *ref) + } + + return dereferenced +} + +type Run struct { + stopChan chan interface{} + target *remoteread.Target + query *remoteread.Query +} + +func (run *Run) failed(message string) { + run.target.Status.State = remoteread.TargetStatus_Failed + run.target.Status.Message = message +} + +func (run *Run) running() { + run.target.Status.State = remoteread.TargetStatus_Running + run.target.Status.Message = "" +} + +func (run *Run) complete() { + run.target.Status.State = remoteread.TargetStatus_Complete +} + +func (run *Run) stopped() { + run.target.Status.State = remoteread.TargetStatus_Stopped +} + +func (run *Run) updateLastRead(lastReadSec int64) { + run.target.Status.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) +} + +// todo: add logger +// todo: add context + +type TargetRunner interface { + Start(target *remoteread.Target, query *remoteread.Query) error + + Stop(name string) error + + SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) + + SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) +} + +func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { + return &targetRunner{ + logger: logger, + runs: make(map[string]Run), + } +} + +type targetRunner struct { + logger *zap.SugaredLogger + + runsMu sync.RWMutex + runs map[string]Run + + remoteWriteClientMu sync.RWMutex + RemoteWriteClient *cortex.RemoteWriteForwarder + + remoteReadServerMu sync.RWMutex + RemoteReadServer remoteread.RemoteReadGatewayServer +} + +func (runner *targetRunner) SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) { + runner.RemoteWriteClient = forwarder +} + +func (runner *targetRunner) SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) { + runner.RemoteReadServer = server +} + +// updateRunStatus notifies the gateway of the status of the Run's target status +func (runner *targetRunner) updateRunStatus(run Run) { + runner.remoteReadServerMu.Lock() + defer runner.remoteReadServerMu.Unlock() + + newStatus := run.target.Status + + request := &remoteread.TargetStatusUpdateRequest{ + Meta: run.target.Meta, + NewStatus: newStatus, + } + + _, err := runner.RemoteReadServer.UpdateTargetStatus(context.TODO(), request) + + if err != nil { + runner.logger.Errorf("failed to push status to server: %s", err) + } +} + +func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { + runner.runsMu.Lock() + runner.runs[run.target.Meta.Name] = run + runner.runsMu.Unlock() + + labelMatchers := toLabelMatchers(run.query.Matchers) + + // todo: this should probably be a lot more sophisticated than this + importEnd := run.query.EndTimestamp.AsTime().UnixMilli() + nextEndDelta := time.Minute.Milliseconds() * 5 + + nextStart := run.query.StartTimestamp.AsTime().UnixMilli() + nextEnd := nextStart + + run.running() + go runner.updateRunStatus(run) + + for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { + nextStart = nextEnd + nextEnd = nextStart + nextEndDelta + if nextEnd > importEnd { + nextEnd = importEnd + } + + readRequest := &prompb.ReadRequest{ + Queries: []*prompb.Query{ + { + StartTimestampMs: nextStart, + EndTimestampMs: nextEnd, + Matchers: labelMatchers, + }, + }, + } + + readResponse, err := remoteReaderClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) + + if err != nil { + run.failed(fmt.Sprintf("failed to read from target endpoint: %s", err.Error())) + runner.updateRunStatus(run) + return + } + + for _, result := range readResponse.Results { + if len(result.Timeseries) == 0 { + continue + } + + writeRequest := prompb.WriteRequest{ + Timeseries: dereferenceResultTimeseries(result.Timeseries), + } + + uncompressed, err := proto.Marshal(&writeRequest) + if err != nil { + run.failed("failed to uncompress data from target endpoint") + runner.updateRunStatus(run) + return + } + + compressed := snappy.Encode(nil, uncompressed) + + payload := &remotewrite.Payload{ + Contents: compressed, + } + + runner.remoteWriteClientMu.Lock() + if _, err := runner.RemoteWriteClient.Push(context.TODO(), payload); err != nil { + run.failed(fmt.Sprintf("failed to push to remote write: %s", err.Error())) + runner.updateRunStatus(run) + return + } + runner.remoteWriteClientMu.Unlock() + } + + run.updateLastRead(nextEnd) + runner.updateRunStatus(run) + } + + if run.target.Status.State == remoteread.TargetStatus_Running { + run.complete() + runner.updateRunStatus(run) + } + + runner.runsMu.Lock() + defer runner.runsMu.Unlock() + + delete(runner.runs, run.target.Meta.Name) +} + +func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Query) error { + // We want to allow for restarting a Failed or Completed. We should not encounter NotRunning, Stopped, or Completed. + run, found := runner.runs[target.Meta.Name] + if found && run.target.Status.State == remoteread.TargetStatus_Running { + switch run.target.Status.State { + case remoteread.TargetStatus_Running: + return targetIsRunningError(target.Meta.Name) + default: + runner.logger.With("target", target.Meta.Name, "old state", target.Status.State).Warnf("restarting target") + } + } else if !found { + run = Run{ + stopChan: make(chan interface{}), + target: target, + query: query, + } + } + + prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Meta.Name), promConfig.WithHTTP2Disabled()) + if err != nil { + return fmt.Errorf("could not start import: %w", err) + } + + prometheusClient.Transport = &nethttp.Transport{ + RoundTripper: prometheusClient.Transport, + } + + remoteReaderClient := NewRemoteReadClient(run.stopChan, prometheusClient) + + go runner.run(run, remoteReaderClient) + + return nil +} + +func (runner *targetRunner) Stop(name string) error { + run, found := runner.runs[name] + + if !found { + return targetIsNotRunningError(name) + } + + run.stopped() + runner.updateRunStatus(run) + + close(run.stopChan) + delete(runner.runs, name) + + return nil +} diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index cf186cb662..bc768901c0 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -115,6 +115,7 @@ func NewPlugin(ctx context.Context) *Plugin { NodeManagerClient: nodeManagerClient, UninstallController: uninstallController, ClusterDriver: clusterDriver, + RemoteWriteClient: &p.cortexRemoteWrite, }) }) From 93ac04201f864c93f222c673907d9ee35f069180 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Mon, 19 Dec 2022 16:33:25 -0500 Subject: [PATCH 09/43] code cleanup after demo --- pkg/opni/commands/import.go | 49 +-- plugins/metrics/pkg/agent/remoteread.go | 2 +- plugins/metrics/pkg/agent/runner.go | 175 ++++++++--- plugins/metrics/pkg/agent/stream.go | 2 +- .../pkg/apis/remoteread/remoteread.proto | 2 +- plugins/metrics/pkg/backend/metrics.go | 6 +- plugins/metrics/pkg/cortex/remotewrite.go | 4 +- .../metrics/pkg/gateway/demo/remoteread.go | 87 ------ plugins/metrics/pkg/gateway/demo/runner.go | 292 ------------------ 9 files changed, 152 insertions(+), 467 deletions(-) delete mode 100644 plugins/metrics/pkg/gateway/demo/remoteread.go delete mode 100644 plugins/metrics/pkg/gateway/demo/runner.go diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index c90bd370ed..3f72ce9a62 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -10,8 +10,6 @@ import ( "time" ) -// todo: add cluster id as a positional arg where appropriate - func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { if strings.Contains(s, "!~") { split := strings.SplitN(s, "!~", 2) @@ -50,10 +48,10 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { return &remoteread.LabelMatcher{}, fmt.Errorf("label matcher must contain one of =, !=, =~, or !~") } -func BuildImportTargetAddCmd() *cobra.Command { +func BuildImportAddCmd() *cobra.Command { cmd := &cobra.Command{ Use: "add ", - Short: "Add a new target", + Short: "Add a new import target", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] @@ -88,13 +86,13 @@ func BuildImportTargetAddCmd() *cobra.Command { return cmd } -func BuildImportTargetEditCmd() *cobra.Command { +func BuildImportEditCmd() *cobra.Command { var newEndpoint string var newName string cmd := &cobra.Command{ Use: "edit", - Short: "Edit an existing target", + Short: "Edit an existing import target", RunE: func(cmd *cobra.Command, args []string) error { if newEndpoint == "" && newName == "" { lg.Infof("no edits specified, doing nothing") @@ -129,10 +127,10 @@ func BuildImportTargetEditCmd() *cobra.Command { return cmd } -func BuildImportTargetRemoveCmd() *cobra.Command { +func BuildImportRemoveCmd() *cobra.Command { cmd := &cobra.Command{ Use: "remove ", - Short: "Remove a target", + Short: "Remove an import target", Aliases: []string{"rm"}, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -157,10 +155,10 @@ func BuildImportTargetRemoveCmd() *cobra.Command { return cmd } -func BuildImportTargetListCmd() *cobra.Command { +func BuildImportListCmd() *cobra.Command { cmd := &cobra.Command{ Use: "list", - Short: "List available targets", + Short: "List available import targets", Aliases: []string{"ls"}, RunE: func(cmd *cobra.Command, args []string) error { request := &remoteread.TargetListRequest{ClusterId: ""} @@ -183,22 +181,6 @@ func BuildImportTargetListCmd() *cobra.Command { return cmd } -func BuildImportTargetCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "target", - Short: "target", - Aliases: []string{"targets"}, - } - - // todo: scan && describe - cmd.AddCommand(BuildImportTargetAddCmd()) - cmd.AddCommand(BuildImportTargetEditCmd()) - cmd.AddCommand(BuildImportTargetRemoveCmd()) - cmd.AddCommand(BuildImportTargetListCmd()) - - return cmd -} - func BuildImportStartCmd() *cobra.Command { var labelFilters []string var startTimestampSecs int64 @@ -207,7 +189,7 @@ func BuildImportStartCmd() *cobra.Command { cmd := &cobra.Command{ Use: "start ", - Short: "start", + Short: "start an import", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] @@ -251,11 +233,11 @@ func BuildImportStartCmd() *cobra.Command { }, } - cmd.Flags().StringSliceVar(&labelFilters, "filters", []string{"__name__=~\".+\""}, "promql query for the thing") + // todo: this default does not pull anything, but job=prometheus-poc did + cmd.Flags().StringSliceVar(&labelFilters, "filters", []string{"__name__=~\".+\""}, "label matchers to use for the import") // todo: we probably want to allow for more human-readable timestamps here - //cmd.Flags().Int64Var(&startTimestampSecs, "start", 0, "start time for the remote read") - cmd.Flags().Int64Var(&startTimestampSecs, "start", time.Now().Unix()-int64(time.Hour.Seconds())*2, "start time for the remote read in seconds since epoch") + cmd.Flags().Int64Var(&startTimestampSecs, "start", time.Now().Unix()-int64(time.Hour.Seconds())*3, "start time for the remote read in seconds since epoch") cmd.Flags().Int64Var(&endTimestampSecs, "end", time.Now().Unix(), "start time for the remote read") cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") @@ -269,7 +251,7 @@ func BuildImportStartCmd() *cobra.Command { func BuildImportStopCmd() *cobra.Command { cmd := &cobra.Command{ Use: "stop ", - Short: "stop", + Short: "stop an import (will not remove already imported data)", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clusterId := args[0] @@ -304,7 +286,10 @@ func BuildImportCmd() *cobra.Command { Short: "Interact with metrics import plugin APIs", } - cmd.AddCommand(BuildImportTargetCmd()) + cmd.AddCommand(BuildImportAddCmd()) + cmd.AddCommand(BuildImportEditCmd()) + cmd.AddCommand(BuildImportRemoveCmd()) + cmd.AddCommand(BuildImportListCmd()) cmd.AddCommand(BuildImportStartCmd()) cmd.AddCommand(BuildImportStopCmd()) diff --git a/plugins/metrics/pkg/agent/remoteread.go b/plugins/metrics/pkg/agent/remoteread.go index b258fcee34..15164f5424 100644 --- a/plugins/metrics/pkg/agent/remoteread.go +++ b/plugins/metrics/pkg/agent/remoteread.go @@ -18,7 +18,7 @@ type RemoteReaderClient struct { prometheusClient *http.Client } -func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { +func NewRemoteReaderClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { return &RemoteReaderClient{ stopChan: stopChan, prometheusClient: prometheusClient, diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index d111a098a8..624cc3ebae 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -8,9 +8,12 @@ import ( "github.com/opentracing-contrib/go-stdlib/nethttp" promConfig "github.com/prometheus/common/config" "github.com/prometheus/prometheus/prompb" + "github.com/rancher/opni/pkg/auth/cluster" "github.com/rancher/opni/pkg/clients" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "github.com/rancher/opni/plugins/metrics/pkg/cortex" + "go.uber.org/zap" "google.golang.org/protobuf/types/known/timestamppb" "sync" "time" @@ -92,7 +95,6 @@ func (run *Run) updateLastRead(lastReadSec int64) { run.target.Status.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) } -// todo: add logger // todo: add context type TargetRunner interface { @@ -103,43 +105,90 @@ type TargetRunner interface { SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) + + SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) + + SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) } -func NewTargetRunner() TargetRunner { +func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { return &targetRunner{ - runs: make(map[string]Run), + logger: logger, + runs: make(map[string]Run), } } type targetRunner struct { + logger *zap.SugaredLogger + runsMu sync.RWMutex runs map[string]Run - remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] - remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] + //remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] + //remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] + + remoteWriteClientMu sync.RWMutex + RemoteWriteClient *cortex.RemoteWriteForwarder + + remoteReadServerMu sync.RWMutex + RemoteReadServer remoteread.RemoteReadGatewayServer +} + +func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { + //runner.remoteWriteClient = client +} + +func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { + //runner.remoteReadClient = client +} + +func (runner *targetRunner) SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) { + runner.RemoteWriteClient = forwarder +} + +func (runner *targetRunner) SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) { + runner.RemoteReadServer = server } // updateRunStatus notifies the gateway of the status of the Run's target status func (runner *targetRunner) updateRunStatus(run Run) { - runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { - newStatus := run.target.Status - newStatus.Message = "client field to read response from prometheus remote read endpoint" - newStatus.State = remoteread.TargetStatus_Failed - - request := &remoteread.TargetStatusUpdateRequest{ - Meta: run.target.Meta, - NewStatus: newStatus, - } + //runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { + // newStatus := run.target.Status + // + // request := &remoteread.TargetStatusUpdateRequest{ + // Meta: run.target.Meta, + // NewStatus: newStatus, + // } + // + // _, err := client.UpdateTargetStatus(context.TODO(), request) + // + // if err != nil { + // // todo: log this + // } + //}) + + runner.remoteReadServerMu.Lock() + defer runner.remoteReadServerMu.Unlock() + + newStatus := run.target.Status + + request := &remoteread.TargetStatusUpdateRequest{ + Meta: run.target.Meta, + NewStatus: newStatus, + } - _, err := client.UpdateTargetStatus(context.TODO(), request) + _, err := runner.RemoteReadServer.UpdateTargetStatus(context.TODO(), request) - if err != nil { - // todo: log this - } - }) + if err != nil { + runner.logger.Errorf("failed to push status to server: %s", err) + } } func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { + runner.runsMu.Lock() + runner.runs[run.target.Meta.Name] = run + runner.runsMu.Unlock() + labelMatchers := toLabelMatchers(run.query.Matchers) // todo: this should probably be a lot more sophisticated than this @@ -147,9 +196,14 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) nextEndDelta := time.Minute.Milliseconds() * 5 nextStart := run.query.StartTimestamp.AsTime().UnixMilli() + nextEnd := nextStart + + run.running() + runner.updateRunStatus(run) for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { - nextEnd := nextStart + nextEndDelta + nextStart = nextEnd + nextEnd = nextStart + nextEndDelta if nextEnd > importEnd { nextEnd = importEnd } @@ -167,19 +221,23 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) readResponse, err := remoteReaderClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) if err != nil { - run.failed("failed to read from target endpoint") + run.failed(fmt.Sprintf("failed to read from target endpoint: %s", err.Error())) runner.updateRunStatus(run) return } for _, result := range readResponse.Results { + if len(result.Timeseries) == 0 { + continue + } + writeRequest := prompb.WriteRequest{ Timeseries: dereferenceResultTimeseries(result.Timeseries), } uncompressed, err := proto.Marshal(&writeRequest) if err != nil { - run.failed("failed to uncompress data from target endpoint") + run.failed(fmt.Sprintf("failed to uncompress data from target endpoint: %s", err.Error())) runner.updateRunStatus(run) return } @@ -190,20 +248,47 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) Contents: compressed, } - runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { - if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { - run.failed("failed to push to remote write") - runner.updateRunStatus(run) - return - } - - run.updateLastRead(nextEnd) + // todo: allows for testing without direct to cluster communication streams + ctx := context.WithValue(context.TODO(), cluster.ClusterIDKey, run.target.Meta.ClusterId) + + //runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { + // if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { + // run.failed("failed to push to remote write") + // runner.updateRunStatus(run) + // return + // } + // + // run.updateLastRead(nextEnd) + // runner.updateRunStatus(run) + //}) + + runner.remoteWriteClientMu.Lock() + if _, err := runner.RemoteWriteClient.Push(ctx, payload); err != nil { + run.failed(fmt.Sprintf("failed to push to remote write: %s", err.Error())) runner.updateRunStatus(run) - }) + return + } + runner.remoteWriteClientMu.Unlock() + + runner.logger.With( + "cluster", run.target.Meta.ClusterId, + "target", run.target.Meta.Name, + ).Infof("pushed remote write payload: %s", payload.String()) } + + run.updateLastRead(nextEnd) + runner.updateRunStatus(run) } - run.complete() + if run.target.Status.State == remoteread.TargetStatus_Running { + runner.logger.With( + "cluster", run.target.Meta.ClusterId, + "target", run.target.Meta.Name, + ).Infof("run completed") + + run.complete() + runner.updateRunStatus(run) + } runner.runsMu.Lock() defer runner.runsMu.Unlock() @@ -219,7 +304,11 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q case remoteread.TargetStatus_Running: return targetIsRunningError(target.Meta.Name) default: - // todo: log restart + runner.logger.With( + "cluster", target.Meta.ClusterId, + "target", target.Meta.Name, + "old state", target.Status.State, + ).Warnf("restarting target") } } else if !found { run = Run{ @@ -238,11 +327,7 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q RoundTripper: prometheusClient.Transport, } - remoteReaderClient := NewRemoteReadClient(run.stopChan, prometheusClient) - - runner.runsMu.Lock() - runner.runs[run.target.Meta.Name] = run - runner.runsMu.Unlock() + remoteReaderClient := NewRemoteReaderClient(run.stopChan, prometheusClient) go runner.run(run, remoteReaderClient) @@ -256,19 +341,11 @@ func (runner *targetRunner) Stop(name string) error { return targetIsNotRunningError(name) } - run.stopped() - runner.updateRunStatus(run) - close(run.stopChan) delete(runner.runs, name) - return nil -} - -func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { - runner.remoteWriteClient = client -} + run.stopped() + runner.updateRunStatus(run) -func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { - runner.remoteReadClient = client + return nil } diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index 980c774f13..93c86764fd 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -27,7 +27,7 @@ func (p *Plugin) StreamServers() []streamext.Server { func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) p.httpServer.SetTargetRunner(clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { - return NewTargetRunner() + return NewTargetRunner(p.logger.Named("remote-read")) })) p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index 9369a113fe..c9e6290c2f 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -12,7 +12,7 @@ package remoteread; // todo: we probably need a new type for Describe and ScanFor // RemoteReadGateway handles requests from the agent / cli. service RemoteReadGateway { -// rpc ScanForTargets(google.protobuf.Empty) returns (stream/ Target); +// rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); // rpc Describe(Target) returns (Target) rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 72197cf596..dd0c52d303 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,9 +3,9 @@ package backend import ( "context" "fmt" + "github.com/rancher/opni/plugins/metrics/pkg/agent" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" - "github.com/rancher/opni/plugins/metrics/pkg/gateway/demo" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -49,7 +49,7 @@ type MetricsBackend struct { remoteReadTargetMu sync.RWMutex remoteReadTargets map[string]*remoteread.Target - runner demo.TargetRunner + runner agent.TargetRunner util.Initializer } @@ -79,7 +79,7 @@ func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { m.desiredNodeSpec = make(map[string]*node.MetricsCapabilitySpec) m.remoteReadTargets = make(map[string]*remoteread.Target) - m.runner = demo.NewTargetRunner(m.Logger.Named("target-runner")) + m.runner = agent.NewTargetRunner(m.Logger.Named("target-runner")) m.runner.SetRemoteWriteForwarder(m.RemoteWriteClient) m.runner.SetRemoteReadServer(m) }) diff --git a/plugins/metrics/pkg/cortex/remotewrite.go b/plugins/metrics/pkg/cortex/remotewrite.go index 3f6eab0a21..2998d32ac6 100644 --- a/plugins/metrics/pkg/cortex/remotewrite.go +++ b/plugins/metrics/pkg/cortex/remotewrite.go @@ -50,12 +50,14 @@ func (f *RemoteWriteForwarder) Push(ctx context.Context, payload *remotewrite.Pa if !f.Initialized() { return nil, util.StatusError(codes.Unavailable) } + + // todo: allows for testing without direct to cluster communication streams //clusterId, ok := cluster.AuthorizedIDFromIncomingContext(ctx) //if !ok { // return nil, status.Error(codes.Unauthenticated, "no cluster ID found in context") //} - clusterId := "cluster-0" + clusterId := ctx.Value(cluster.ClusterIDKey).(string) defer func() { code := status.Code(pushErr) diff --git a/plugins/metrics/pkg/gateway/demo/remoteread.go b/plugins/metrics/pkg/gateway/demo/remoteread.go deleted file mode 100644 index 16b2ced0d6..0000000000 --- a/plugins/metrics/pkg/gateway/demo/remoteread.go +++ /dev/null @@ -1,87 +0,0 @@ -package demo - -import ( - "bytes" - "context" - "fmt" - "github.com/golang/protobuf/proto" - "github.com/golang/snappy" - "github.com/prometheus/common/version" - "github.com/prometheus/prometheus/prompb" - "io" - "net/http" - "time" -) - -type RemoteReaderClient struct { - stopChan chan interface{} - prometheusClient *http.Client -} - -func NewRemoteReadClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { - return &RemoteReaderClient{ - stopChan: stopChan, - prometheusClient: prometheusClient, - } -} - -func (client *RemoteReaderClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { - uncompressedData, err := proto.Marshal(readRequest) - if err != nil { - return nil, fmt.Errorf("unable to marshal remote read readRequest: %w", err) - } - - compressedData := snappy.Encode(nil, uncompressedData) - - request, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewReader(compressedData)) - if err != nil { - return nil, fmt.Errorf("unable to crete remote read http readRequest: %w", err) - } - - request.Header.Add("Content-Encoding", "snappy") - request.Header.Add("Accept-Encoding", "snappy") - request.Header.Set("Content-Type", "application/x-protobuf") - request.Header.Set("User-Agent", "Prometheus/xx") - request.Header.Set("X-Prometheus-Remote-Read-Version", fmt.Sprintf("Prometheus/%s", version.Version)) - - // todo: timeout should be configurable - ctx, cancel := context.WithTimeout(ctx, time.Second*10) - defer cancel() - - request = request.WithContext(ctx) - - response, err := client.prometheusClient.Do(request) - if err != nil { - return nil, fmt.Errorf("could not get response from rmeote read: %w", err) - } - - defer func() { - _, _ = io.Copy(io.Discard, response.Body) - _ = response.Body.Close() - }() - - var reader bytes.Buffer - _, _ = io.Copy(&reader, response.Body) - - compressedData, err = io.ReadAll(bytes.NewReader(reader.Bytes())) - if err != nil { - return nil, fmt.Errorf("error reading http response: %w", err) - } - - if response.StatusCode/100 != 2 { - return nil, fmt.Errorf("endpoint '%s' responded with status code '%d'", endpoint, response.StatusCode) - } - - uncompressedData, err = snappy.Decode(nil, compressedData) - if err != nil { - return nil, fmt.Errorf("unabled to uncompress reponse: %w", err) - } - - var readResponse prompb.ReadResponse - err = proto.Unmarshal(uncompressedData, &readResponse) - if err != nil { - return nil, fmt.Errorf("could not unmarshal remote read reponse: %w", err) - } - - return &readResponse, nil -} diff --git a/plugins/metrics/pkg/gateway/demo/runner.go b/plugins/metrics/pkg/gateway/demo/runner.go deleted file mode 100644 index 3b04f7b1f6..0000000000 --- a/plugins/metrics/pkg/gateway/demo/runner.go +++ /dev/null @@ -1,292 +0,0 @@ -package demo - -import ( - "context" - "fmt" - "github.com/golang/protobuf/proto" - "github.com/golang/snappy" - "github.com/opentracing-contrib/go-stdlib/nethttp" - promConfig "github.com/prometheus/common/config" - "github.com/prometheus/prometheus/prompb" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" - "github.com/rancher/opni/plugins/metrics/pkg/cortex" - "go.uber.org/zap" - "google.golang.org/protobuf/types/known/timestamppb" - "sync" - "time" -) - -func targetIsRunningError(name string) error { - return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", name) -} - -func targetIsNotRunningError(name string) error { - return fmt.Errorf("target '%s' is not running", name) -} - -// todo: import prometheus LabelMatcher into plugins/metrics/pkg/apis/remoteread.proto to remove this -func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { - pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) - - for _, matcher := range rrLabelMatchers { - var matchType prompb.LabelMatcher_Type - - switch matcher.Type { - case remoteread.LabelMatcher_Equal: - matchType = prompb.LabelMatcher_EQ - case remoteread.LabelMatcher_NotEqual: - matchType = prompb.LabelMatcher_NEQ - case remoteread.LabelMatcher_RegexEqual: - matchType = prompb.LabelMatcher_RE - case remoteread.LabelMatcher_NotRegexEqual: - matchType = prompb.LabelMatcher_NRE - default: - // todo: log something - } - - pbLabelMatchers = append(pbLabelMatchers, &prompb.LabelMatcher{ - Type: matchType, - Name: matcher.Name, - Value: matcher.Value, - }) - } - - return pbLabelMatchers -} - -func dereferenceResultTimeseries(in []*prompb.TimeSeries) []prompb.TimeSeries { - dereferenced := make([]prompb.TimeSeries, 0, len(in)) - - for _, ref := range in { - dereferenced = append(dereferenced, *ref) - } - - return dereferenced -} - -type Run struct { - stopChan chan interface{} - target *remoteread.Target - query *remoteread.Query -} - -func (run *Run) failed(message string) { - run.target.Status.State = remoteread.TargetStatus_Failed - run.target.Status.Message = message -} - -func (run *Run) running() { - run.target.Status.State = remoteread.TargetStatus_Running - run.target.Status.Message = "" -} - -func (run *Run) complete() { - run.target.Status.State = remoteread.TargetStatus_Complete -} - -func (run *Run) stopped() { - run.target.Status.State = remoteread.TargetStatus_Stopped -} - -func (run *Run) updateLastRead(lastReadSec int64) { - run.target.Status.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) -} - -// todo: add logger -// todo: add context - -type TargetRunner interface { - Start(target *remoteread.Target, query *remoteread.Query) error - - Stop(name string) error - - SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) - - SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) -} - -func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { - return &targetRunner{ - logger: logger, - runs: make(map[string]Run), - } -} - -type targetRunner struct { - logger *zap.SugaredLogger - - runsMu sync.RWMutex - runs map[string]Run - - remoteWriteClientMu sync.RWMutex - RemoteWriteClient *cortex.RemoteWriteForwarder - - remoteReadServerMu sync.RWMutex - RemoteReadServer remoteread.RemoteReadGatewayServer -} - -func (runner *targetRunner) SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) { - runner.RemoteWriteClient = forwarder -} - -func (runner *targetRunner) SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) { - runner.RemoteReadServer = server -} - -// updateRunStatus notifies the gateway of the status of the Run's target status -func (runner *targetRunner) updateRunStatus(run Run) { - runner.remoteReadServerMu.Lock() - defer runner.remoteReadServerMu.Unlock() - - newStatus := run.target.Status - - request := &remoteread.TargetStatusUpdateRequest{ - Meta: run.target.Meta, - NewStatus: newStatus, - } - - _, err := runner.RemoteReadServer.UpdateTargetStatus(context.TODO(), request) - - if err != nil { - runner.logger.Errorf("failed to push status to server: %s", err) - } -} - -func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { - runner.runsMu.Lock() - runner.runs[run.target.Meta.Name] = run - runner.runsMu.Unlock() - - labelMatchers := toLabelMatchers(run.query.Matchers) - - // todo: this should probably be a lot more sophisticated than this - importEnd := run.query.EndTimestamp.AsTime().UnixMilli() - nextEndDelta := time.Minute.Milliseconds() * 5 - - nextStart := run.query.StartTimestamp.AsTime().UnixMilli() - nextEnd := nextStart - - run.running() - go runner.updateRunStatus(run) - - for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { - nextStart = nextEnd - nextEnd = nextStart + nextEndDelta - if nextEnd > importEnd { - nextEnd = importEnd - } - - readRequest := &prompb.ReadRequest{ - Queries: []*prompb.Query{ - { - StartTimestampMs: nextStart, - EndTimestampMs: nextEnd, - Matchers: labelMatchers, - }, - }, - } - - readResponse, err := remoteReaderClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) - - if err != nil { - run.failed(fmt.Sprintf("failed to read from target endpoint: %s", err.Error())) - runner.updateRunStatus(run) - return - } - - for _, result := range readResponse.Results { - if len(result.Timeseries) == 0 { - continue - } - - writeRequest := prompb.WriteRequest{ - Timeseries: dereferenceResultTimeseries(result.Timeseries), - } - - uncompressed, err := proto.Marshal(&writeRequest) - if err != nil { - run.failed("failed to uncompress data from target endpoint") - runner.updateRunStatus(run) - return - } - - compressed := snappy.Encode(nil, uncompressed) - - payload := &remotewrite.Payload{ - Contents: compressed, - } - - runner.remoteWriteClientMu.Lock() - if _, err := runner.RemoteWriteClient.Push(context.TODO(), payload); err != nil { - run.failed(fmt.Sprintf("failed to push to remote write: %s", err.Error())) - runner.updateRunStatus(run) - return - } - runner.remoteWriteClientMu.Unlock() - } - - run.updateLastRead(nextEnd) - runner.updateRunStatus(run) - } - - if run.target.Status.State == remoteread.TargetStatus_Running { - run.complete() - runner.updateRunStatus(run) - } - - runner.runsMu.Lock() - defer runner.runsMu.Unlock() - - delete(runner.runs, run.target.Meta.Name) -} - -func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Query) error { - // We want to allow for restarting a Failed or Completed. We should not encounter NotRunning, Stopped, or Completed. - run, found := runner.runs[target.Meta.Name] - if found && run.target.Status.State == remoteread.TargetStatus_Running { - switch run.target.Status.State { - case remoteread.TargetStatus_Running: - return targetIsRunningError(target.Meta.Name) - default: - runner.logger.With("target", target.Meta.Name, "old state", target.Status.State).Warnf("restarting target") - } - } else if !found { - run = Run{ - stopChan: make(chan interface{}), - target: target, - query: query, - } - } - - prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Meta.Name), promConfig.WithHTTP2Disabled()) - if err != nil { - return fmt.Errorf("could not start import: %w", err) - } - - prometheusClient.Transport = &nethttp.Transport{ - RoundTripper: prometheusClient.Transport, - } - - remoteReaderClient := NewRemoteReadClient(run.stopChan, prometheusClient) - - go runner.run(run, remoteReaderClient) - - return nil -} - -func (runner *targetRunner) Stop(name string) error { - run, found := runner.runs[name] - - if !found { - return targetIsNotRunningError(name) - } - - run.stopped() - runner.updateRunStatus(run) - - close(run.stopChan) - delete(runner.runs, name) - - return nil -} From dfddd3e9e4a347d1849ee0108f14e1d09b131e42 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:31:30 -0500 Subject: [PATCH 10/43] better progress typing --- pkg/opni/util/render_cortex.go | 14 - plugins/metrics/pkg/agent/runner.go | 7 +- .../pkg/apis/remoteread/remoteread.pb.go | 637 ++++++++++-------- .../pkg/apis/remoteread/remoteread.proto | 15 +- plugins/metrics/pkg/backend/metrics.go | 4 +- 5 files changed, 371 insertions(+), 306 deletions(-) diff --git a/pkg/opni/util/render_cortex.go b/pkg/opni/util/render_cortex.go index 90259d8e50..7db0385d4b 100644 --- a/pkg/opni/util/render_cortex.go +++ b/pkg/opni/util/render_cortex.go @@ -4,7 +4,6 @@ package cliutil import ( "fmt" - "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "strings" "github.com/jedib0t/go-pretty/v6/table" @@ -203,16 +202,3 @@ func servicesByName[T interface { } return services } - -func RenderTargetList(list *remoteread.TargetList) string { - writer := table.NewWriter() - writer.SetStyle(table.StyleColoredDark) - writer.AppendHeader(table.Row{"NAME", "ENDPOINT", "LAST READ"}) - - for _, target := range list.Targets { - row := table.Row{target.Name, target.Endpoint, target.Meta.LastReadTimestamp} - writer.AppendRow(row) - } - - return writer.Render() -} diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 624cc3ebae..20e3737086 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -92,7 +92,7 @@ func (run *Run) stopped() { } func (run *Run) updateLastRead(lastReadSec int64) { - run.target.Status.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) + run.target.Status.Progress.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) } // todo: add context @@ -189,6 +189,11 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) runner.runs[run.target.Meta.Name] = run runner.runsMu.Unlock() + run.target.Status.Progress = &remoteread.TargetProgress{ + StartTimestamp: run.query.StartTimestamp, + EndTimestamp: run.query.EndTimestamp, + } + labelMatchers := toLabelMatchers(run.query.Matchers) // todo: this should probably be a lot more sophisticated than this diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 785879443f..266504e9f0 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -128,7 +128,7 @@ func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { // Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{15, 0} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{16, 0} } type Target struct { @@ -254,11 +254,10 @@ type TargetStatus struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` - LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` - EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - State TargetStatus_State `protobuf:"varint,5,opt,name=state,proto3,enum=remoteread.TargetStatus_State" json:"state,omitempty"` + // this is the progress of the last known import + Progress *TargetProgress `protobuf:"bytes,1,opt,name=progress,proto3" json:"progress,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + State TargetStatus_State `protobuf:"varint,3,opt,name=state,proto3,enum=remoteread.TargetStatus_State" json:"state,omitempty"` } func (x *TargetStatus) Reset() { @@ -293,23 +292,9 @@ func (*TargetStatus) Descriptor() ([]byte, []int) { return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{2} } -func (x *TargetStatus) GetStartTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.StartTimestamp - } - return nil -} - -func (x *TargetStatus) GetLastReadTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.LastReadTimestamp - } - return nil -} - -func (x *TargetStatus) GetEndTimestamp() *timestamppb.Timestamp { +func (x *TargetStatus) GetProgress() *TargetProgress { if x != nil { - return x.EndTimestamp + return x.Progress } return nil } @@ -477,6 +462,69 @@ func (x *TargetList) GetTargets() []*Target { return nil } +type TargetProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startTimestamp,proto3" json:"startTimestamp,omitempty"` + LastReadTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lastReadTimestamp,proto3" json:"lastReadTimestamp,omitempty"` + EndTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=endTimestamp,proto3" json:"endTimestamp,omitempty"` +} + +func (x *TargetProgress) Reset() { + *x = TargetProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetProgress) ProtoMessage() {} + +func (x *TargetProgress) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TargetProgress.ProtoReflect.Descriptor instead. +func (*TargetProgress) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{6} +} + +func (x *TargetProgress) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp + } + return nil +} + +func (x *TargetProgress) GetLastReadTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.LastReadTimestamp + } + return nil +} + +func (x *TargetProgress) GetEndTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.EndTimestamp + } + return nil +} + type TargetAddRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -489,7 +537,7 @@ type TargetAddRequest struct { func (x *TargetAddRequest) Reset() { *x = TargetAddRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +550,7 @@ func (x *TargetAddRequest) String() string { func (*TargetAddRequest) ProtoMessage() {} func (x *TargetAddRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +563,7 @@ func (x *TargetAddRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetAddRequest.ProtoReflect.Descriptor instead. func (*TargetAddRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{6} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} } func (x *TargetAddRequest) GetTarget() *Target { @@ -544,7 +592,7 @@ type TargetEditRequest struct { func (x *TargetEditRequest) Reset() { *x = TargetEditRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -557,7 +605,7 @@ func (x *TargetEditRequest) String() string { func (*TargetEditRequest) ProtoMessage() {} func (x *TargetEditRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -570,7 +618,7 @@ func (x *TargetEditRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetEditRequest.ProtoReflect.Descriptor instead. func (*TargetEditRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{7} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} } func (x *TargetEditRequest) GetMeta() *TargetMeta { @@ -598,7 +646,7 @@ type TargetRemoveRequest struct { func (x *TargetRemoveRequest) Reset() { *x = TargetRemoveRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -611,7 +659,7 @@ func (x *TargetRemoveRequest) String() string { func (*TargetRemoveRequest) ProtoMessage() {} func (x *TargetRemoveRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -624,7 +672,7 @@ func (x *TargetRemoveRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetRemoveRequest.ProtoReflect.Descriptor instead. func (*TargetRemoveRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{8} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{9} } func (x *TargetRemoveRequest) GetMeta() *TargetMeta { @@ -645,7 +693,7 @@ type TargetListRequest struct { func (x *TargetListRequest) Reset() { *x = TargetListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -658,7 +706,7 @@ func (x *TargetListRequest) String() string { func (*TargetListRequest) ProtoMessage() {} func (x *TargetListRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -671,7 +719,7 @@ func (x *TargetListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetListRequest.ProtoReflect.Descriptor instead. func (*TargetListRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{9} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} } func (x *TargetListRequest) GetClusterId() string { @@ -695,7 +743,7 @@ type StartReadRequest struct { func (x *StartReadRequest) Reset() { *x = StartReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -708,7 +756,7 @@ func (x *StartReadRequest) String() string { func (*StartReadRequest) ProtoMessage() {} func (x *StartReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -721,7 +769,7 @@ func (x *StartReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartReadRequest.ProtoReflect.Descriptor instead. func (*StartReadRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{10} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11} } func (x *StartReadRequest) GetTarget() *Target { @@ -756,7 +804,7 @@ type StopReadRequest struct { func (x *StopReadRequest) Reset() { *x = StopReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -769,7 +817,7 @@ func (x *StopReadRequest) String() string { func (*StopReadRequest) ProtoMessage() {} func (x *StopReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -782,7 +830,7 @@ func (x *StopReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReadRequest.ProtoReflect.Descriptor instead. func (*StopReadRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{11} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} } func (x *StopReadRequest) GetMeta() *TargetMeta { @@ -803,7 +851,7 @@ type TargetStatusRequest struct { func (x *TargetStatusRequest) Reset() { *x = TargetStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -816,7 +864,7 @@ func (x *TargetStatusRequest) String() string { func (*TargetStatusRequest) ProtoMessage() {} func (x *TargetStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -829,7 +877,7 @@ func (x *TargetStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetStatusRequest.ProtoReflect.Descriptor instead. func (*TargetStatusRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{12} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13} } func (x *TargetStatusRequest) GetMeta() *TargetMeta { @@ -851,7 +899,7 @@ type TargetStatusUpdateRequest struct { func (x *TargetStatusUpdateRequest) Reset() { *x = TargetStatusUpdateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -864,7 +912,7 @@ func (x *TargetStatusUpdateRequest) String() string { func (*TargetStatusUpdateRequest) ProtoMessage() {} func (x *TargetStatusUpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -877,7 +925,7 @@ func (x *TargetStatusUpdateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetStatusUpdateRequest.ProtoReflect.Descriptor instead. func (*TargetStatusUpdateRequest) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{13} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{14} } func (x *TargetStatusUpdateRequest) GetMeta() *TargetMeta { @@ -908,7 +956,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -921,7 +969,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -934,7 +982,7 @@ func (x *Query) ProtoReflect() protoreflect.Message { // Deprecated: Use Query.ProtoReflect.Descriptor instead. func (*Query) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{14} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{15} } func (x *Query) GetStartTimestamp() *timestamppb.Timestamp { @@ -971,7 +1019,7 @@ type LabelMatcher struct { func (x *LabelMatcher) Reset() { *x = LabelMatcher{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -984,7 +1032,7 @@ func (x *LabelMatcher) String() string { func (*LabelMatcher) ProtoMessage() {} func (x *LabelMatcher) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -997,7 +1045,7 @@ func (x *LabelMatcher) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. func (*LabelMatcher) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{15} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{16} } func (x *LabelMatcher) GetType() LabelMatcher_Type { @@ -1034,7 +1082,7 @@ type Progress struct { func (x *Progress) Reset() { *x = Progress{} if protoimpl.UnsafeEnabled { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1047,7 +1095,7 @@ func (x *Progress) String() string { func (*Progress) ProtoMessage() {} func (x *Progress) ProtoReflect() protoreflect.Message { - mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16] + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,7 +1108,7 @@ func (x *Progress) ProtoReflect() protoreflect.Message { // Deprecated: Use Progress.ProtoReflect.Descriptor instead. func (*Progress) Descriptor() ([]byte, []int) { - return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{16} + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{17} } func (x *Progress) GetStartTimestamp() *timestamppb.Timestamp { @@ -1115,171 +1163,176 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x22, 0xf9, 0x02, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, - 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, - 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x22, 0x4b, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, - 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, - 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x04, 0x22, 0x28, - 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x49, 0x64, 0x22, 0xe3, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4b, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, + 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x04, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x73, 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x77, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, - 0x61, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x8b, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, - 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0xde, 0x01, 0x0a, + 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, + 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x5c, 0x0a, + 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x11, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x41, 0x0a, 0x13, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, - 0x7f, 0x0a, 0x19, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, - 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, - 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, - 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, - 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x42, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x71, - 0x75, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, - 0x6c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, - 0x6c, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x10, 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, - 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xc9, 0x04, 0x0a, 0x11, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, - 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x0a, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x10, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, + 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x7f, 0x0a, 0x19, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, + 0xaf, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x42, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x0e, + 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, 0x11, + 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, + 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, + 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xc9, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, + 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, + 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, + 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0b, 0x4c, + 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, - 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, - 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, - 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, - 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, - 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1295,7 +1348,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = []interface{}{ (TargetStatus_State)(0), // 0: remoteread.TargetStatus.State (LabelMatcher_Type)(0), // 1: remoteread.LabelMatcher.Type @@ -1305,70 +1358,72 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ (*TargetSpec)(nil), // 5: remoteread.TargetSpec (*TargetDiff)(nil), // 6: remoteread.TargetDiff (*TargetList)(nil), // 7: remoteread.TargetList - (*TargetAddRequest)(nil), // 8: remoteread.TargetAddRequest - (*TargetEditRequest)(nil), // 9: remoteread.TargetEditRequest - (*TargetRemoveRequest)(nil), // 10: remoteread.TargetRemoveRequest - (*TargetListRequest)(nil), // 11: remoteread.TargetListRequest - (*StartReadRequest)(nil), // 12: remoteread.StartReadRequest - (*StopReadRequest)(nil), // 13: remoteread.StopReadRequest - (*TargetStatusRequest)(nil), // 14: remoteread.TargetStatusRequest - (*TargetStatusUpdateRequest)(nil), // 15: remoteread.TargetStatusUpdateRequest - (*Query)(nil), // 16: remoteread.Query - (*LabelMatcher)(nil), // 17: remoteread.LabelMatcher - (*Progress)(nil), // 18: remoteread.Progress - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 20: google.protobuf.Empty + (*TargetProgress)(nil), // 8: remoteread.TargetProgress + (*TargetAddRequest)(nil), // 9: remoteread.TargetAddRequest + (*TargetEditRequest)(nil), // 10: remoteread.TargetEditRequest + (*TargetRemoveRequest)(nil), // 11: remoteread.TargetRemoveRequest + (*TargetListRequest)(nil), // 12: remoteread.TargetListRequest + (*StartReadRequest)(nil), // 13: remoteread.StartReadRequest + (*StopReadRequest)(nil), // 14: remoteread.StopReadRequest + (*TargetStatusRequest)(nil), // 15: remoteread.TargetStatusRequest + (*TargetStatusUpdateRequest)(nil), // 16: remoteread.TargetStatusUpdateRequest + (*Query)(nil), // 17: remoteread.Query + (*LabelMatcher)(nil), // 18: remoteread.LabelMatcher + (*Progress)(nil), // 19: remoteread.Progress + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 21: google.protobuf.Empty } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = []int32{ 3, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMeta 5, // 1: remoteread.Target.spec:type_name -> remoteread.TargetSpec 4, // 2: remoteread.Target.status:type_name -> remoteread.TargetStatus - 19, // 3: remoteread.TargetStatus.startTimestamp:type_name -> google.protobuf.Timestamp - 19, // 4: remoteread.TargetStatus.lastReadTimestamp:type_name -> google.protobuf.Timestamp - 19, // 5: remoteread.TargetStatus.endTimestamp:type_name -> google.protobuf.Timestamp - 0, // 6: remoteread.TargetStatus.state:type_name -> remoteread.TargetStatus.State - 2, // 7: remoteread.TargetList.targets:type_name -> remoteread.Target - 2, // 8: remoteread.TargetAddRequest.target:type_name -> remoteread.Target - 3, // 9: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta - 6, // 10: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff - 3, // 11: remoteread.TargetRemoveRequest.meta:type_name -> remoteread.TargetMeta - 2, // 12: remoteread.StartReadRequest.target:type_name -> remoteread.Target - 16, // 13: remoteread.StartReadRequest.query:type_name -> remoteread.Query - 3, // 14: remoteread.StopReadRequest.meta:type_name -> remoteread.TargetMeta - 3, // 15: remoteread.TargetStatusRequest.meta:type_name -> remoteread.TargetMeta - 3, // 16: remoteread.TargetStatusUpdateRequest.meta:type_name -> remoteread.TargetMeta - 4, // 17: remoteread.TargetStatusUpdateRequest.newStatus:type_name -> remoteread.TargetStatus - 19, // 18: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp - 19, // 19: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp - 17, // 20: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher - 1, // 21: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type - 19, // 22: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp - 19, // 23: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp - 8, // 24: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest - 9, // 25: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest - 10, // 26: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest - 11, // 27: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest - 14, // 28: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest - 15, // 29: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest - 12, // 30: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest - 13, // 31: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest - 12, // 32: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest - 13, // 33: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest - 20, // 34: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty - 20, // 35: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty - 20, // 36: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty - 7, // 37: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList - 4, // 38: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus - 20, // 39: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty - 20, // 40: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty - 20, // 41: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty - 20, // 42: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty - 20, // 43: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty - 34, // [34:44] is the sub-list for method output_type - 24, // [24:34] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 8, // 3: remoteread.TargetStatus.progress:type_name -> remoteread.TargetProgress + 0, // 4: remoteread.TargetStatus.state:type_name -> remoteread.TargetStatus.State + 2, // 5: remoteread.TargetList.targets:type_name -> remoteread.Target + 20, // 6: remoteread.TargetProgress.startTimestamp:type_name -> google.protobuf.Timestamp + 20, // 7: remoteread.TargetProgress.lastReadTimestamp:type_name -> google.protobuf.Timestamp + 20, // 8: remoteread.TargetProgress.endTimestamp:type_name -> google.protobuf.Timestamp + 2, // 9: remoteread.TargetAddRequest.target:type_name -> remoteread.Target + 3, // 10: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta + 6, // 11: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff + 3, // 12: remoteread.TargetRemoveRequest.meta:type_name -> remoteread.TargetMeta + 2, // 13: remoteread.StartReadRequest.target:type_name -> remoteread.Target + 17, // 14: remoteread.StartReadRequest.query:type_name -> remoteread.Query + 3, // 15: remoteread.StopReadRequest.meta:type_name -> remoteread.TargetMeta + 3, // 16: remoteread.TargetStatusRequest.meta:type_name -> remoteread.TargetMeta + 3, // 17: remoteread.TargetStatusUpdateRequest.meta:type_name -> remoteread.TargetMeta + 4, // 18: remoteread.TargetStatusUpdateRequest.newStatus:type_name -> remoteread.TargetStatus + 20, // 19: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp + 20, // 20: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp + 18, // 21: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher + 1, // 22: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type + 20, // 23: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp + 20, // 24: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp + 9, // 25: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest + 10, // 26: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest + 11, // 27: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest + 12, // 28: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest + 15, // 29: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 16, // 30: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest + 13, // 31: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 14, // 32: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 13, // 33: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest + 14, // 34: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest + 21, // 35: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 21, // 36: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 21, // 37: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 7, // 38: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 4, // 39: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus + 21, // 40: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty + 21, // 41: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty + 21, // 42: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty + 21, // 43: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 21, // 44: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 35, // [35:45] is the sub-list for method output_type + 25, // [25:35] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() } @@ -1450,7 +1505,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetAddRequest); i { + switch v := v.(*TargetProgress); i { case 0: return &v.state case 1: @@ -1462,7 +1517,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetEditRequest); i { + switch v := v.(*TargetAddRequest); i { case 0: return &v.state case 1: @@ -1474,7 +1529,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetRemoveRequest); i { + switch v := v.(*TargetEditRequest); i { case 0: return &v.state case 1: @@ -1486,7 +1541,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetListRequest); i { + switch v := v.(*TargetRemoveRequest); i { case 0: return &v.state case 1: @@ -1498,7 +1553,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReadRequest); i { + switch v := v.(*TargetListRequest); i { case 0: return &v.state case 1: @@ -1510,7 +1565,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReadRequest); i { + switch v := v.(*StartReadRequest); i { case 0: return &v.state case 1: @@ -1522,7 +1577,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetStatusRequest); i { + switch v := v.(*StopReadRequest); i { case 0: return &v.state case 1: @@ -1534,7 +1589,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TargetStatusUpdateRequest); i { + switch v := v.(*TargetStatusRequest); i { case 0: return &v.state case 1: @@ -1546,7 +1601,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { + switch v := v.(*TargetStatusUpdateRequest); i { case 0: return &v.state case 1: @@ -1558,7 +1613,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelMatcher); i { + switch v := v.(*Query); i { case 0: return &v.state case 1: @@ -1570,6 +1625,18 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } } file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Progress); i { case 0: return &v.state @@ -1588,7 +1655,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc, NumEnums: 2, - NumMessages: 17, + NumMessages: 18, NumExtensions: 0, NumServices: 2, }, diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index c9e6290c2f..3084c162eb 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -52,11 +52,10 @@ message TargetStatus { Stopped = 4; } - google.protobuf.Timestamp startTimestamp = 1; - google.protobuf.Timestamp lastReadTimestamp = 2; - google.protobuf.Timestamp endTimestamp = 3; - string message = 4; - State state = 5; + // this is the progress of the last known import + TargetProgress progress = 1; + string message = 2; + State state = 3; } message TargetSpec { @@ -72,6 +71,12 @@ message TargetList { repeated Target targets = 1; } +message TargetProgress { + google.protobuf.Timestamp startTimestamp = 1; + google.protobuf.Timestamp lastReadTimestamp = 2; + google.protobuf.Timestamp endTimestamp = 3; +} + message TargetAddRequest { Target target = 1; string clusterId = 2; diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index dd0c52d303..953ab4de5e 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -458,7 +458,9 @@ func (m *MetricsBackend) AddTarget(_ context.Context, request *remoteread.Target if request.Target.Status == nil { request.Target.Status = &remoteread.TargetStatus{ - LastReadTimestamp: ×tamppb.Timestamp{}, + Progress: &remoteread.TargetProgress{}, + Message: "", + State: remoteread.TargetStatus_NotRunning, } } From cacec5c3d5a2e74f5796a0287f84a6af9b3cfbb1 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:32:58 -0500 Subject: [PATCH 11/43] add progress monitoring to import cli --- go.mod | 1 + go.sum | 9 ++ pkg/opni/commands/import.go | 46 ++++++++ pkg/opni/commands/import_progress.go | 164 +++++++++++++++++++++++++++ 4 files changed, 220 insertions(+) create mode 100644 pkg/opni/commands/import_progress.go diff --git a/go.mod b/go.mod index 563d9bc79d..cda2facc98 100644 --- a/go.mod +++ b/go.mod @@ -209,6 +209,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect + github.com/charmbracelet/harmonica v0.2.0 // indirect github.com/cheggaaa/pb v1.0.29 // indirect github.com/cockroachdb/apd/v2 v2.0.1 // indirect github.com/containerd/console v1.0.3 // indirect diff --git a/go.sum b/go.sum index 9191e4f0cd..d024422d88 100644 --- a/go.sum +++ b/go.sum @@ -422,10 +422,19 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= +<<<<<<< HEAD github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= github.com/charmbracelet/bubbletea v0.23.1 h1:CYdteX1wCiCzKNUlwm25ZHBIc1GXlYFyUIte8WPvhck= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= +======= +github.com/charmbracelet/bubbles v0.14.0 h1:DJfCwnARfWjZLvMglhSQzo76UZ2gucuHPy9jLWX45Og= +github.com/charmbracelet/bubbles v0.14.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= +github.com/charmbracelet/bubbletea v0.21.0/go.mod h1:GgmJMec61d08zXsOhqRC/AiOx4K4pmz+VIcRIm1FKr4= +github.com/charmbracelet/bubbletea v0.22.1 h1:z66q0LWdJNOWEH9zadiAIXp2GN1AWrwNXU8obVY9X24= +github.com/charmbracelet/bubbletea v0.22.1/go.mod h1:8/7hVvbPN6ZZPkczLiB8YpLkLJ0n7DMho5Wvfd2X1C0= +github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= +>>>>>>> 70f57529 (add progress monitoring to import cli) github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 3f72ce9a62..bf00b38eb2 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -1,7 +1,9 @@ package commands import ( + "context" "fmt" + tea "github.com/charmbracelet/bubbletea" cliutil "github.com/rancher/opni/pkg/opni/util" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/spf13/cobra" @@ -48,6 +50,23 @@ func parseLabelMatcher(s string) (*remoteread.LabelMatcher, error) { return &remoteread.LabelMatcher{}, fmt.Errorf("label matcher must contain one of =, !=, =~, or !~") } +func followProgress(ctx context.Context, name string, cluster string) error { + request := &remoteread.TargetStatusRequest{ + Meta: &remoteread.TargetMeta{ + Name: name, + ClusterId: cluster, + }, + } + + model := NewProgressModel(ctx, request) + + if err := tea.NewProgram(model).Start(); err != nil { + return fmt.Errorf("could not render progress: %w", err) + } + + return nil +} + func BuildImportAddCmd() *cobra.Command { cmd := &cobra.Command{ Use: "add ", @@ -186,6 +205,7 @@ func BuildImportStartCmd() *cobra.Command { var startTimestampSecs int64 var endTimestampSecs int64 var forceOverlap bool + var follow bool cmd := &cobra.Command{ Use: "start ", @@ -229,6 +249,10 @@ func BuildImportStartCmd() *cobra.Command { lg.Infof("import started") + if follow { + return followProgress(cmd.Context(), targetName, clusterId) + } + return nil }, } @@ -240,6 +264,8 @@ func BuildImportStartCmd() *cobra.Command { cmd.Flags().Int64Var(&startTimestampSecs, "start", time.Now().Unix()-int64(time.Hour.Seconds())*3, "start time for the remote read in seconds since epoch") cmd.Flags().Int64Var(&endTimestampSecs, "end", time.Now().Unix(), "start time for the remote read") + cmd.Flags().BoolVar(&follow, "follow", false, "follow import progress (the same as calling start then progress immediately)") + cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") ConfigureManagementCommand(cmd) @@ -280,6 +306,25 @@ func BuildImportStopCmd() *cobra.Command { return cmd } +func BuildProgressCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "progress ", + Short: "follow import progress until finished", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clusterId := args[0] + targetName := args[1] + + return followProgress(cmd.Context(), targetName, clusterId) + }, + } + + ConfigureManagementCommand(cmd) + ConfigureImportCommand(cmd) + + return cmd +} + func BuildImportCmd() *cobra.Command { cmd := &cobra.Command{ Use: "import", @@ -292,6 +337,7 @@ func BuildImportCmd() *cobra.Command { cmd.AddCommand(BuildImportListCmd()) cmd.AddCommand(BuildImportStartCmd()) cmd.AddCommand(BuildImportStopCmd()) + cmd.AddCommand(BuildProgressCmd()) ConfigureManagementCommand(cmd) ConfigureImportCommand(cmd) diff --git a/pkg/opni/commands/import_progress.go b/pkg/opni/commands/import_progress.go new file mode 100644 index 0000000000..2a9135f124 --- /dev/null +++ b/pkg/opni/commands/import_progress.go @@ -0,0 +1,164 @@ +package commands + +import ( + "context" + "fmt" + "github.com/charmbracelet/bubbles/progress" + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" + "github.com/muesli/termenv" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "google.golang.org/protobuf/types/known/timestamppb" + "math" + "strings" + "time" +) + +const ( + padding = 2 + maxWidth = 80 +) + +var ( + progressStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("4")).String() +) + +func getNextStatus(ctx context.Context, request *remoteread.TargetStatusRequest) tea.Cmd { + return tea.Tick(500*time.Millisecond, func(_ time.Time) tea.Msg { + status, err := remoteReadClient.GetTargetStatus(ctx, request) + + if err != nil { + return err + } + + return status + }) +} + +func getProgressAsPercent(progress *remoteread.TargetProgress) float64 { + if progress.LastReadTimestamp == nil { + return 0 + } + + percent := float64(progress.LastReadTimestamp.Seconds-progress.StartTimestamp.Seconds) / + float64(progress.EndTimestamp.Seconds-progress.StartTimestamp.Seconds) + + return math.Min(1, percent) +} + +type ProgressModel struct { + ctx context.Context + request *remoteread.TargetStatusRequest + + percent float64 + progress progress.Model + + err error + lastRead *timestamppb.Timestamp + state string +} + +func NewProgressModel(ctx context.Context, statusRequest *remoteread.TargetStatusRequest) ProgressModel { + return ProgressModel{ + ctx: ctx, + request: statusRequest, + + progress: progress.New(progress.WithColorProfile(termenv.TrueColor), progress.WithSolidFill(progressStyle)), + + state: "running", + } +} + +func (model ProgressModel) Init() tea.Cmd { + return getNextStatus(model.ctx, model.request) +} + +func (model ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case tea.KeyMsg: + if msg.Type == tea.KeyCtrlC { + return model, tea.Quit + } + + return model, nil + + case tea.WindowSizeMsg: + model.progress.Width = msg.Width - padding*2 - 4 + + if model.progress.Width > maxWidth { + model.progress.Width = maxWidth + } + + return model, nil + + case error: + model.err = msg + return model, tea.Quit + + case *remoteread.TargetStatus: + if msg.Message != "" { + model.err = fmt.Errorf(msg.Message) + } + + importDone := false + + switch msg.State { + case remoteread.TargetStatus_Running: + model.state = "running" + case remoteread.TargetStatus_Failed: + model.state = "failed" + importDone = true + + case remoteread.TargetStatus_Stopped: + model.state = "stopped" + importDone = true + + case remoteread.TargetStatus_Complete: + model.state = "complete" + importDone = true + + case remoteread.TargetStatus_NotRunning: + model.state = "not running" + default: + model.state = "unknown" + } + + model.percent = getProgressAsPercent(msg.Progress) + model.lastRead = msg.Progress.LastReadTimestamp + + if model.percent >= 1 { + importDone = true + } + + if importDone { + return model, tea.Quit + } + + return model, tea.Batch(getNextStatus(model.ctx, model.request)) + default: + return model, nil + } +} + +func (model ProgressModel) View() string { + builder := strings.Builder{} + paddingStr := strings.Repeat(" ", padding) + + builder.WriteString("\n") + + builder.WriteString(paddingStr + model.progress.ViewAs(model.percent) + "\n\n") + + builder.WriteString(paddingStr + "State: " + model.state + "\n") + + if model.lastRead == nil { + builder.WriteString(paddingStr + "Last Read Timestamp: nil \n") + } else { + builder.WriteString(paddingStr + "Last Read Timestamp: " + model.lastRead.AsTime().String() + "\n") + } + + if model.err != nil { + builder.WriteString(paddingStr + "Error: " + model.err.Error() + "\n\n") + } + + return builder.String() +} From 37c1e65dc8671c247e47eb86e567aa8cf7b235cb Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 14:59:56 -0500 Subject: [PATCH 12/43] Added new stream delegate api to enable direct requests to specific agents # Conflicts: # go.mod # go.sum --- go.mod | 6 +- go.sum | 130 +------ pkg/agent/clientset.go | 7 + pkg/apis/core/v1/metadata.go | 13 + pkg/apis/stream/v1/stream.pb.go | 330 ++++++++++++++++-- pkg/apis/stream/v1/stream.proto | 34 +- pkg/apis/stream/v1/stream_grpc.pb.go | 128 +++++++ pkg/gateway/delegate.go | 143 ++++++++ pkg/gateway/gateway.go | 7 +- .../apis/apiextensions/stream/delegate.go | 109 ++++++ pkg/storage/conformance/cluster_store.go | 4 +- pkg/storage/etcd/cluster_store.go | 2 +- pkg/storage/jetstream/cluster_store.go | 2 +- pkg/storage/selection.go | 14 +- pkg/storage/selection_test.go | 2 +- pkg/test/mock_helpers.go | 2 +- plugins/metrics/pkg/gateway/stream.go | 8 + 17 files changed, 762 insertions(+), 179 deletions(-) create mode 100644 pkg/gateway/delegate.go create mode 100644 pkg/plugins/apis/apiextensions/stream/delegate.go diff --git a/go.mod b/go.mod index cda2facc98..64c744931f 100644 --- a/go.mod +++ b/go.mod @@ -66,6 +66,7 @@ require ( github.com/mattn/go-tty v0.0.4 github.com/mikefarah/yq/v4 v4.30.8 github.com/mitchellh/mapstructure v1.5.0 + github.com/muesli/termenv v0.13.0 github.com/nats-io/nats-server/v2 v2.9.12 github.com/nats-io/nats.go v1.23.0 github.com/nats-io/nkeys v0.3.0 @@ -153,9 +154,11 @@ require ( require ( cloud.google.com/go v0.105.0 // indirect + cloud.google.com/go/bigtable v1.3.0 // indirect cloud.google.com/go/compute v1.14.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.8.0 // indirect + cloud.google.com/go/longrunning v0.3.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect github.com/AlekSi/pointer v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect @@ -217,6 +220,7 @@ require ( github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.4.0 // indirect github.com/cppforlife/go-patch v0.2.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect @@ -378,7 +382,6 @@ require ( github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.13.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nats-io/jwt/v2 v2.3.0 // indirect @@ -445,6 +448,7 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/ulikunitz/xz v0.5.10 // indirect + github.com/urfave/cli v1.22.5 // indirect github.com/vimeo/galaxycache v0.0.0-20210323154928-b7e5d71c067a // indirect github.com/wayneashleyberry/terminal-dimensions v1.0.0 // indirect github.com/weaveworks/promrus v1.2.0 // indirect diff --git a/go.sum b/go.sum index d024422d88..b17a729f3f 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,7 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= +cloud.google.com/go/bigtable v1.3.0/go.mod h1:z5EyKrPE8OQmeg4h5MNdKvuSnI9CCT49Ki3f23aBzio= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -63,6 +64,7 @@ cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -422,19 +424,11 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -<<<<<<< HEAD github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= github.com/charmbracelet/bubbletea v0.23.1 h1:CYdteX1wCiCzKNUlwm25ZHBIc1GXlYFyUIte8WPvhck= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= -======= -github.com/charmbracelet/bubbles v0.14.0 h1:DJfCwnARfWjZLvMglhSQzo76UZ2gucuHPy9jLWX45Og= -github.com/charmbracelet/bubbles v0.14.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= -github.com/charmbracelet/bubbletea v0.21.0/go.mod h1:GgmJMec61d08zXsOhqRC/AiOx4K4pmz+VIcRIm1FKr4= -github.com/charmbracelet/bubbletea v0.22.1 h1:z66q0LWdJNOWEH9zadiAIXp2GN1AWrwNXU8obVY9X24= -github.com/charmbracelet/bubbletea v0.22.1/go.mod h1:8/7hVvbPN6ZZPkczLiB8YpLkLJ0n7DMho5Wvfd2X1C0= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= ->>>>>>> 70f57529 (add progress monitoring to import cli) github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= @@ -442,7 +436,6 @@ github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOo github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.18/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -456,7 +449,6 @@ github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= @@ -470,8 +462,6 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.1 h1:y1Rh3tEU89D+7Tgbw+lp52T6p/GJLpDmNvr10UWqLTE= github.com/cockroachdb/apd/v2 v2.0.1/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= @@ -480,11 +470,8 @@ github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1 github.com/cockroachdb/cockroach-go v0.0.0-20200312223839-f565e4789405/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4 h1:Lap807SXTH5tri2TivECb/4abUkMZC9zRoLarvcKDqs= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= @@ -503,7 +490,6 @@ github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4S github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= @@ -616,14 +602,15 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cppforlife/go-patch v0.2.0 h1:Y14MnCQjDlbw7WXT4k+u6DPAA9XnygN4BfrSpI/19RU= github.com/cppforlife/go-patch v0.2.0/go.mod h1:67a7aIi94FHDZdoeGSJRRFDp66l9MhaAG1yGxpUoFD8= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= @@ -666,22 +653,15 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= -github.com/digitalocean/godo v1.91.1 h1:1o30VOCu1aC6488qBd0SkQiBeAZ35RSTvLwCA1pQMhc= -github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/distribution/distribution/v3 v3.0.0-20220526142353-ffbd94cbe269 h1:hbCT8ZPPMqefiAWD2ZKjn7ypokIGViTvBBg/ExLSdCk= github.com/djherbis/times v1.2.0/go.mod h1:CGMZlo255K5r4Yw0b9RRfFQpM2y7uOmxg4jm9HsaVf8= -github.com/djherbis/times v1.5.0 h1:79myA211VwPhFTqUk8xehWrsEO+zcIZj0zT8mXPVARU= github.com/djherbis/times v1.5.0/go.mod h1:5q7FDLvbNg1L/KaBmPcWlVR9NmoKo3+ucqUA3ijQhA0= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= @@ -704,7 +684,6 @@ github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -713,7 +692,6 @@ github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -736,13 +714,10 @@ github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/efficientgo/core v1.0.0-rc.2 h1:7j62qHLnrZqO3V3UA0AqOGd5d5aXV3AX6m/NZBHp78I= github.com/efficientgo/core v1.0.0-rc.2/go.mod h1:FfGdkzWarkuzOlY04VY+bGfb1lWrjaL6x/GLcQ4vJps= -github.com/efficientgo/e2e v0.14.1-0.20230119090947-fa7ceb0197c5 h1:N1fHVcNEPMJNB93sxT6icl5yvoFxa2sp3/1NnVlrAFc= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5 h1:LCoguo7Zd0MByKMbQbTvcZw7HiBcbvew+MOcwsJVwrY= github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elliotchance/orderedmap v1.5.0 h1:1IsExUsjv5XNBD3ZdC7jkAAqLWOOKdbPTmkHx63OsBg= github.com/elliotchance/orderedmap v1.5.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -764,10 +739,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGYvecuLB1HtdexY= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -806,7 +779,6 @@ github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -820,7 +792,6 @@ github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmx github.com/gabstv/go-bsdiff v1.0.5 h1:g29MC/38Eaig+iAobW10/CiFvPtin8U3Jj4yNLcNG9k= github.com/gabstv/go-bsdiff v1.0.5/go.mod h1:/Zz6GK+/f/TMylRtVaW3uwZlb0FZITILfA0q12XKGwg= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -833,7 +804,6 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY= github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8nfB398= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -853,7 +823,6 @@ github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= @@ -982,7 +951,6 @@ github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbN github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y= github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -997,18 +965,13 @@ github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyh github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= @@ -1076,7 +1039,6 @@ github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.1/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= -github.com/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk= github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= github.com/gobuffalo/genny v0.0.0-20180924032338-7af3a40f2252/go.mod h1:tUTQOogrr7tAQnhajMSH6rv1BVev34H2sa1xNHMy94g= github.com/gobuffalo/genny v0.0.0-20181003150629-3786a0744c5d/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM= @@ -1143,7 +1105,6 @@ github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw5 github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= -github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/makr v1.1.5/go.mod h1:Y+o0btAH1kYAMDJW/TX3+oAXEu0bmSLLoC9mIFxtzOw= github.com/gobuffalo/mapi v1.0.0/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= @@ -1183,7 +1144,6 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packd v0.2.0/go.mod h1:k2CkHP3bjbqL2GwxwhxUy1DgnlbW644hkLC9iIUvZwY= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= -github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= github.com/gobuffalo/packr v1.13.7/go.mod h1:KkinLIn/n6+3tVXMwg6KkNvWwVsrRAz4ph+jgpk3Z24= github.com/gobuffalo/packr v1.15.0/go.mod h1:t5gXzEhIviQwVlNx/+3SfS07GS+cZ2hn76WLzPp6MGI= @@ -1191,7 +1151,6 @@ github.com/gobuffalo/packr v1.15.1/go.mod h1:IeqicJ7jm8182yrVmNbM6PR4g79SjN9tZLH github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= github.com/gobuffalo/packr v1.20.0/go.mod h1:JDytk1t2gP+my1ig7iI4NcVaXr886+N0ecUga6884zw= github.com/gobuffalo/packr v1.21.0/go.mod h1:H00jGfj1qFKxscFJSw8wcL4hpQtPe1PfU2wa6sg/SR0= -github.com/gobuffalo/packr v1.22.0 h1:/YVd/GRGsu0QuoCJtlcWSVllobs4q3Xvx3nqxTvPyN0= github.com/gobuffalo/packr v1.22.0/go.mod h1:Qr3Wtxr3+HuQEwWqlLnNW4t1oTvK+7Gc/Rnoi/lDFvA= github.com/gobuffalo/packr/v2 v2.0.0-rc.8/go.mod h1:y60QCdzwuMwO2R49fdQhsjCPv7tLQFR0ayzxxla9zes= github.com/gobuffalo/packr/v2 v2.0.0-rc.9/go.mod h1:fQqADRfZpEsgkc7c/K7aMew3n4aF1Kji7+lIZeR98Fc= @@ -1207,7 +1166,6 @@ github.com/gobuffalo/packr/v2 v2.4.0/go.mod h1:ra341gygw9/61nSjAbfwcwh8IrYL4WmR4 github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobuffalo/packr/v2 v2.8.0/go.mod h1:PDk2k3vGevNE3SwVyVRgQCCXETC9SaONCNSXT1Q8M1g= -github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= github.com/gobuffalo/plush v3.7.16+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.20+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= @@ -1272,7 +1230,6 @@ github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGF github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= -github.com/goccy/go-yaml v1.9.8 h1:5gMyLUeU1/6zl+WFfR1hN7D2kf+1/eRGa7DFtToiBvQ= github.com/goccy/go-yaml v1.9.8/go.mod h1:JubOolP3gh0HpiBc4BLRD4YmjEjHAmIIB2aaXKkTfoE= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= @@ -1284,7 +1241,6 @@ github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVH github.com/godror/godror v0.24.2/go.mod h1:wZv/9vPiUib6tkoDl+AZ/QLf5YZgMravZ7jxH2eQWAE= github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1367,7 +1323,6 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= -github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= @@ -1398,17 +1353,14 @@ github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt github.com/google/go-jsonnet v0.19.1 h1:MORxkrG0elylUqh36R4AcSPX0oZQa9hvI3lroN+kDhs= github.com/google/go-jsonnet v0.19.1/go.mod h1:5JVT33JVCoehdTj5Z2KJq1eIdt3Nb8PCmZ+W5D8U350= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -1460,13 +1412,11 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e h1:XmA6L9IPRdUr28a+SK/oMchGgQy159wvzXA5tJ7l+40= github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e/go.mod h1:AFIo+02s+12CEg8Gzz9kzhCbmbq6JcKNrhHffCGA9z4= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v1.1.1 h1:MuGyqbSxiuVBqkPZ3+Nhbytk1xZxhmfCB2Rg1cJWFWM= github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -1508,7 +1458,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1 h1:/sDbPb60SusIXjiJGYLUoS/rAQurQmvGWmwn2bBPM9c= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1/go.mod h1:G+WkljZi4mflcqVxYSgvt8MNctRQHjEH8ubKtt1Ka3w= -github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -1519,9 +1468,7 @@ github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4N github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= -github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -1550,7 +1497,6 @@ github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJ github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -1561,7 +1507,6 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -1579,7 +1524,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/nomad/api v0.0.0-20221214074818-7dbbf6bc584d h1:kEWrUx7mld3c6HRcO2KhfD1MYBkofuZfEfDwCRQ9aMU= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= @@ -1587,8 +1531,6 @@ github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hetznercloud/hcloud-go v1.38.0 h1:K6Pd/mMdcLfBhvwG39qyAaacp4pCS3dKa8gChmLKxLg= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -1625,7 +1567,6 @@ github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mq github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8/go.mod h1:KrtyD5PFj++GKkFS/7/RRrfnRhAMGQwy75GLCHWrCNs= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/ionos-cloud/sdk-go/v6 v6.0.4 h1:4LoWeM7WtcDqYDjlntqQ3fD6XaENlCw2YqiVWkHQbNA= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -1681,7 +1622,6 @@ github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= -github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc= github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jaypipes/ghw v0.10.0 h1:UHu9UX08Py315iPojADFPOkmjTsNzHj4g4adsNKKteY= github.com/jaypipes/ghw v0.10.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= @@ -1700,7 +1640,6 @@ github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7 github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= github.com/jhump/protoreflect v1.14.1 h1:N88q7JkxTHWFEqReuTsYH1dPIwXxA0ITNQp7avLY10s= github.com/jhump/protoreflect v1.14.1/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= @@ -1709,7 +1648,6 @@ github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= @@ -1760,7 +1698,6 @@ github.com/karrick/godirwalk v1.10.9/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.15.3/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/karrick/godirwalk v1.15.5/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= -github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= @@ -1792,7 +1729,6 @@ github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH6 github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec/go.mod h1:H5mEFsTeWizwFXHKtsITL5ipsLTuAMQoGuQpp+1JL9U= -github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1804,13 +1740,11 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kralicky/cortex v1.14.1-opni.0 h1:+XrmnpjKlAwyMUOgSDgWVVd7uRM6Vrk/2691uRpGnRM= github.com/kralicky/cortex v1.14.1-opni.0/go.mod h1:/EKcnQHqRrx1MyPp2LDJ7tKSHlr+f+A1hrisqyOVFZw= @@ -1822,7 +1756,6 @@ github.com/kralicky/grafana-operator/v4 v4.2.1-0.20221115225851-0b4fc0307089 h1: github.com/kralicky/grafana-operator/v4 v4.2.1-0.20221115225851-0b4fc0307089/go.mod h1:bNBl/NkTje9KiKAD4qKvwSRvdX2Xn+AjO6uu3DSam5k= github.com/kralicky/grpc-gateway/v2 v2.11.3 h1:vLLe/VPWWJmtQwuQ0rlL2cU0L/VpL5UKfk6IkM3Zak0= github.com/kralicky/grpc-gateway/v2 v2.11.3/go.mod h1:REy8s1IlkKMQFqp5QJaO0qvcfY5gRjXetqwqfb0iiMY= -github.com/kralicky/kmatch v0.0.0-20220713045459-85a252b9275e h1:0HTOxNxXnJy4EV0zRWr37D/N6xWLdQ1GjtgLpts30jw= github.com/kralicky/kmatch v0.0.0-20220713045459-85a252b9275e/go.mod h1:GIlN+uSFeISHISm+32UmNce20rNVC5q1Jyz5Wg05cEw= github.com/kralicky/logging-operator v0.0.0-20230206225216-304d63447c1f h1:OLXJYDCBLimsDZooGryznY+TQqm47RrwSRONvTr0RRg= github.com/kralicky/logging-operator v0.0.0-20230206225216-304d63447c1f/go.mod h1:5sTY/rz7ybmF7izsy9JvyJB4TvfOqeffRNhkK9q9lq4= @@ -1849,7 +1782,6 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= @@ -1878,7 +1810,6 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linode/linodego v1.9.3 h1:+lxNZw4avRxhCqGjwfPgQ2PvMT+vOL0OMsTdzixR7hQ= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/longhorn/upgrade-responder v0.1.5 h1:d1GksWjckahzFruqmeHyWwOEt8+P6H5gAET3Ojmm/ms= @@ -1911,7 +1842,6 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/markbates/deplist v1.0.4/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.0.5/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.1.3/go.mod h1:BF7ioVzAJYEtzQN/os4rt8H8Ti3h0T7EoN+7eyALktE= -github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= github.com/markbates/going v1.0.2/go.mod h1:UWCk3zm0UKefHZ7l8BNqi26UyiEMniznk8naLdTcy6c= github.com/markbates/grift v1.0.4/go.mod h1:wbmtW74veyx+cgfwFhlnnMWqhoz55rnHR47oMXzsyVs= @@ -1924,18 +1854,15 @@ github.com/markbates/oncer v0.0.0-20180924031910-e862a676800b/go.mod h1:Ld9puTsI github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/refresh v1.4.10/go.mod h1:NDPHvotuZmTmesXxr95C9bjlw1/0frJwtME2dzcVKhc= github.com/markbates/safe v1.0.0/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/markbates/sigtx v1.0.0/go.mod h1:QF1Hv6Ic6Ca6W+T+DL0Y/ypborFKyvUY9HmuCD4VeTc= github.com/markbates/willie v1.0.9/go.mod h1:fsrFVWl91+gXpx/6dv715j7i11fYPfZ9ZGfH0DQzY7w= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -1985,7 +1912,6 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E= @@ -1997,7 +1923,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mholt/archiver/v4 v4.0.0-alpha.3 h1:cSPJX8PnksNrhSQUyKLW6kd6iuLg37GaRJUIpSmqRlw= @@ -2010,7 +1935,6 @@ github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJys github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mikefarah/yq/v4 v4.30.8 h1:EHovseqMJs9kvE25/2k6VnDs4CrBZN+DFbybUhpPAGM= github.com/mikefarah/yq/v4 v4.30.8/go.mod h1:8D30GDxhu3+KXll0aFV5msGcdgYRZSPOPVBTbgUQ7Dc= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= @@ -2030,7 +1954,6 @@ github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HK github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -2064,7 +1987,6 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/mountinfo v0.6.0 h1:gUDhXQx58YNrpHlK4nSL+7y2pxFZkUcXqzFDKWdC0Oo= github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= @@ -2093,7 +2015,6 @@ github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/moul/http2curl v0.0.0-20170919181001-9ac6cf4d929b/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de h1:D5x39vF5KCwKQaw+OC9ZPiLVHXz3UFw2+psEX+gYcto= github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de/go.mod h1:kJun4WP5gFuHZgRjZUWWuH1DTxCtxbHDOIJsudS8jzY= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -2142,7 +2063,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk= github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -2153,7 +2073,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olebedev/when v0.0.0-20221205223600-4d190b02b8d8 h1:0uFGkScHef2Xd8g74BMHU1jFcnKEm0PzrPn4CluQ9FI= github.com/olebedev/when v0.0.0-20221205223600-4d190b02b8d8/go.mod h1:T0THb4kP9D3NNqlvCwIG4GyUioTAzEhB4RNVzig/43E= github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= -github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -2174,7 +2093,6 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.8.0 h1:pAM+oBNPrpXRs+E/8spkeGx9QgekbRVyr74EUvRVOUI= github.com/onsi/ginkgo/v2 v2.8.0/go.mod h1:6JsQiECmxCa3V5st74AL/AmsV482EDdVrGaVW6z3oYU= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -2239,7 +2157,6 @@ github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.m github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0= github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS69fQMD+MNP1mRs6mBQc= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -2250,7 +2167,6 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk/v65 v65.13.0 h1:0+9ea5goYfhI3/MPfbIQU6yzHYWE6sCk6VuUepxk5Nk= github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.5.4/go.mod h1:J8ZUbNB2FOhm1cFZW9xBpDsODqsSWcyYgtJYVPcnF70= @@ -2281,11 +2197,9 @@ github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M= github.com/ory/x v0.0.214 h1:nz5ijvm5MVhYxWsQSuUrW1hj9F5QLZvPn/nLo5s06T4= github.com/ory/x v0.0.214/go.mod h1:aRl57gzyD4GF0HQCekovXhv0xTZgAgiht3o8eVhsm9Q= github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis= -github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -2324,7 +2238,6 @@ github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqgg github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -2336,7 +2249,6 @@ github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdL github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -2344,7 +2256,6 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/poy/onpar v0.0.0-20190519213022-ee068f8ea4d1/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU= -github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0 h1:55138zTXw/yRYizPxZ672I/aDD7Yte3uYRAfUjWUu2M= github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0/go.mod h1:j51242bf6LQwvJ1JPKWApzTnifmCwcQq0i1p29ylWiM= @@ -2419,25 +2330,18 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc h1:gSVONBi2HWMFXCa9jFdYvYk7IwW/mTLxWOF7rXS4LO0= github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc/go.mod h1:KbKfKPy2I6ecOIGA9apfheFv14+P3RSmmQvshofQyMY= github.com/pulumi/pulumi-aws/sdk/v5 v5.1.2/go.mod h1:5Bl3enkEyJD5oDkNZYfduZP7aP3xFjCf7yaBdNuifEo= -github.com/pulumi/pulumi-aws/sdk/v5 v5.29.1 h1:uD6oJckjP9lcMGvw0FSXLz5DwweEyCJ2N0XudRSBSM0= github.com/pulumi/pulumi-aws/sdk/v5 v5.29.1/go.mod h1:axXtUAYEclH+SVqr/QmWFzMfJchxrrPiyMrywCcMF9A= -github.com/pulumi/pulumi-awsx/sdk v1.0.1 h1:Hz5TQ3XAnHQge2F+ydNL1DKxMRXTZY1gk/MSou/2nls= github.com/pulumi/pulumi-awsx/sdk v1.0.1/go.mod h1:jwPmIPvPTVYkq+n6Nz/QfMhNZ1cHvBSORdRYvljV9Xo= -github.com/pulumi/pulumi-docker/sdk/v3 v3.2.0 h1:7liqzpMLCmk7BIO7w6f6JCh9IdtwCp0a//jA12i6eyo= github.com/pulumi/pulumi-docker/sdk/v3 v3.2.0/go.mod h1:TACDfD6SWGyaHmWLrtHAuGiZ+pTBD4OYYFb5kTyxdtQ= -github.com/pulumi/pulumi-eks/sdk v1.0.1 h1:/QstsE+ETWhx3hYVDWHhn4GT7V9aVWrPtyCjKckxB8o= github.com/pulumi/pulumi-eks/sdk v1.0.1/go.mod h1:H1+qy3r+WqP4Bw/zSd6vb+ZoY3zjDkCq0B1IScAcxhk= github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.17.0/go.mod h1:w+Y1d8uqc+gv7JYWLF4rfzvTsIIHR1SCL+GG6sX1xMM= -github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.23.1 h1:/80MhL18CCRdDbN1Ed87vf1dCi6F6/YDetOMXldozJg= github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.23.1/go.mod h1:NOCrmeTmR12varCHZXBnGUj3OzqTPQuOh1CspxjwgRs= -github.com/pulumi/pulumi-random/sdk/v4 v4.10.0 h1:F2GFmP8oxD0BUHV9E9yyWBO8u2MLHM51O45++zmmgB8= github.com/pulumi/pulumi-random/sdk/v4 v4.10.0/go.mod h1:czSwj+jZnn/VWovMpTLUs/RL/ZS4PFHRdmlXrkvHqeI= github.com/pulumi/pulumi/sdk/v3 v3.16.0/go.mod h1:252ou/zAU1g6E8iTwe2Y9ht7pb5BDl2fJlOuAgZCHiA= github.com/pulumi/pulumi/sdk/v3 v3.25.0/go.mod h1:VsxW+TGv2VBLe/MeqsAr9r0zKzK/gbAhFT9QxYr24cY= github.com/pulumi/pulumi/sdk/v3 v3.27.0/go.mod h1:VsxW+TGv2VBLe/MeqsAr9r0zKzK/gbAhFT9QxYr24cY= github.com/pulumi/pulumi/sdk/v3 v3.36.0/go.mod h1:e1xuPnh9aKzCesrFf96DEzcybLdRWRMhKeKVBmb2lm0= github.com/pulumi/pulumi/sdk/v3 v3.49.0/go.mod h1:58NOiU6vEdA0S8KFiFt4/eqH7vKtWhDFsEGCUFRBovw= -github.com/pulumi/pulumi/sdk/v3 v3.53.1 h1:fTYqe0fQiGshlOuHwpjOqQOb2SW3CSqXteeGcAuO+Bk= github.com/pulumi/pulumi/sdk/v3 v3.53.1/go.mod h1:IYcBrkAwKEGRVq7R1ne3XJKB5bcux5eL3M/zqco7d6Y= github.com/qmuntal/stateless v1.6.2 h1:HZq+/PxrJtGX7mF4pvbu6uuVuqQ/tWQoDZWbo6878ao= github.com/qmuntal/stateless v1.6.2/go.mod h1:/HWN2w30OtWL2VT9EUZxMsnz26iIbzuE8R0HOEcMaBY= @@ -2464,7 +2368,6 @@ github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= @@ -2488,7 +2391,6 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= -github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= @@ -2499,10 +2401,8 @@ github.com/samber/lo v1.37.0/go.mod h1:9vaz2O4o8oOnK23pd2TrXufcbdbJIa3b6cstBWKpo github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= github.com/santhosh-tekuri/jsonschema/v2 v2.1.0/go.mod h1:yzJzKUGV4RbWqWIBBP4wSOBqavX5saE02yirLS0OTyg= -github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10 h1:wsfMs0iv+MJiViM37qh5VEKISi3/ZUq2nNKNdqmumAs= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= @@ -2574,7 +2474,6 @@ github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -2660,9 +2559,7 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tencentyun/cos-go-sdk-v5 v0.7.34 h1:xm+Pg+6m486y4eugRI7/E4WasbVmpY1hp9QBSRErgp8= github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= -github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1Zsv7OAU9iQhZwigp50Yl38W10g/vd5NC8Rdk1Jzng= github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM= @@ -2704,7 +2601,6 @@ github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvF github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= -github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 h1:X9dsIWPuuEJlPX//UmRKophhOKCGXc46RVIGuttks68= github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7/go.mod h1:UxoP3EypF8JfGEjAII8jx1q8rQyDnX8qdTCs/UQBVIE= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -2732,6 +2628,7 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -2745,7 +2642,6 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/wayneashleyberry/terminal-dimensions v1.0.0 h1:LawtS1nqKjAfqrmKOzkcrDLAjSzh38lEhC401JPjQVA= github.com/wayneashleyberry/terminal-dimensions v1.0.0/go.mod h1:PW2XrtV6KmKOPhuf7wbtcmw1/IFnC39mryRET2XbxeE= github.com/weaveworks/common v0.0.0-20221201103051-7c2720a9024d h1:9Z/HiqeGN+LOnmotAMpFEQjuXZ4AGAVFG0rC1laP5Go= @@ -2792,12 +2688,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= @@ -3063,7 +2955,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -3821,7 +3712,6 @@ gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= @@ -3845,7 +3735,6 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -3860,7 +3749,6 @@ gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzW gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/telebot.v3 v3.1.2 h1:uw3zobPBnexytTsIPyxsS10xHRLXCf5f2GQhBxp6NaU= gopkg.in/telebot.v3 v3.1.2/go.mod h1:GJKwwWqp9nSkIVN51eRKU78aB5f5OnQuWdwiIZfPbko= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19/go.mod h1:o4V0GXN9/CAmCsvJ0oXYZvrZOe7syiDZSN1GWGZTGzc= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -3887,11 +3775,9 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= helm.sh/helm/v3 v3.4.2/go.mod h1:O4USJi4CwjSHEPPYmw2NpA1omXiaKu8ePA3cbxk66RQ= helm.sh/helm/v3 v3.10.3 h1:wL7IUZ7Zyukm5Kz0OUmIFZgKHuAgByCrUcJBtY0kDyw= @@ -4011,7 +3897,6 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230202215443-34013725500c h1:YVqDar2X7YiQa/DVAXFMDIfGF8uGrHQemlrwRU5NlVI= k8s.io/utils v0.0.0-20230202215443-34013725500c/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw= lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s= modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= @@ -4043,7 +3928,6 @@ modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= oras.land/oras-go v1.2.0 h1:yoKosVIbsPoFMqAIFHTnrmOuafHal+J/r+I5bdbVWu4= oras.land/oras-go v1.2.0/go.mod h1:pFNs7oHp2dYsYMSS82HaX5l4mpnGO7hbpPN6EWH2ltc= -pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= @@ -4058,7 +3942,6 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyz sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M= sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= -sigs.k8s.io/controller-tools v0.11.3 h1:T1xzLkog9saiyQSLz1XOImu4OcbdXWytc5cmYsBeBiE= sigs.k8s.io/controller-tools v0.11.3/go.mod h1:qcfX7jfcfYD/b7lAhvqAyTbt/px4GpvN88WKLFFv7p8= sigs.k8s.io/gateway-api v0.6.0 h1:v2FqrN2ROWZLrSnI2o91taHR8Sj3s+Eh3QU7gLNWIqA= sigs.k8s.io/gateway-api v0.6.0/go.mod h1:EYJT+jlPWTeNskjV0JTki/03WX1cyAnBhwBJfYHpV/0= @@ -4067,9 +3950,7 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h6 sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/cmd/config v0.10.9 h1:LV8AUwZPuvqhGfia50uNwsPwNg1xOy9koEf5hyBnYs4= sigs.k8s.io/kustomize/cmd/config v0.10.9/go.mod h1:T0s850zPV3wKfBALA0dyeP/K74jlJcoP8Pr9ZWwE3MQ= -sigs.k8s.io/kustomize/kustomize/v4 v4.5.7 h1:cDW6AVMl6t/SLuQaezMET8hgnadZGIAr8tUrxFVOrpg= sigs.k8s.io/kustomize/kustomize/v4 v4.5.7/go.mod h1:VSNKEH9D9d9bLiWEGbS6Xbg/Ih0tgQalmPvntzRxZ/Q= sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= @@ -4088,6 +3969,5 @@ sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 h1:hfyJ5ku9yFtLVOiSxa3IN+dx5eBQT9mPmKFypAmg8XM= sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/pkg/agent/clientset.go b/pkg/agent/clientset.go index b961546a56..af5389437a 100644 --- a/pkg/agent/clientset.go +++ b/pkg/agent/clientset.go @@ -10,15 +10,22 @@ import ( type ClientSet interface { controlv1.HealthClient capabilityv1.NodeClient + ClientConn() grpc.ClientConnInterface } type clientSet struct { + cc grpc.ClientConnInterface controlv1.HealthClient capabilityv1.NodeClient } +func (c *clientSet) ClientConn() grpc.ClientConnInterface { + return c.cc +} + func NewClientSet(cc grpc.ClientConnInterface) ClientSet { return &clientSet{ + cc: cc, HealthClient: controlv1.NewHealthClient(cc), NodeClient: capabilityv1.NewNodeClient(cc), } diff --git a/pkg/apis/core/v1/metadata.go b/pkg/apis/core/v1/metadata.go index bff0ae02f9..2bc3d4cce1 100644 --- a/pkg/apis/core/v1/metadata.go +++ b/pkg/apis/core/v1/metadata.go @@ -22,6 +22,19 @@ type MetadataAccessor[T Capability[T]] interface { SetResourceVersion(version string) } +type IdReader interface { + GetId() string +} + +type LabelReader interface { + GetLabels() map[string]string +} + +type IdLabelReader interface { + IdReader + LabelReader +} + func (t *BootstrapToken) GetCapabilities() []*TokenCapability { return t.GetMetadata().GetCapabilities() } diff --git a/pkg/apis/stream/v1/stream.pb.go b/pkg/apis/stream/v1/stream.pb.go index 4824652558..a8a4642f4a 100644 --- a/pkg/apis/stream/v1/stream.pb.go +++ b/pkg/apis/stream/v1/stream.pb.go @@ -8,8 +8,11 @@ package v1 import ( totem "github.com/kralicky/totem" + v1 "github.com/rancher/opni/pkg/apis/core/v1" + status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/anypb" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" @@ -115,6 +118,171 @@ func (x *StreamEvent) GetType() EventType { return EventType_Unknown } +type DelegatedMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *totem.RPC `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + Target *v1.Reference `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *DelegatedMessage) Reset() { + *x = DelegatedMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DelegatedMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DelegatedMessage) ProtoMessage() {} + +func (x *DelegatedMessage) ProtoReflect() protoreflect.Message { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DelegatedMessage.ProtoReflect.Descriptor instead. +func (*DelegatedMessage) Descriptor() ([]byte, []int) { + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{1} +} + +func (x *DelegatedMessage) GetRequest() *totem.RPC { + if x != nil { + return x.Request + } + return nil +} + +func (x *DelegatedMessage) GetTarget() *v1.Reference { + if x != nil { + return x.Target + } + return nil +} + +type DelegatedMessageReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reply *totem.RPC `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"` + Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *DelegatedMessageReply) Reset() { + *x = DelegatedMessageReply{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DelegatedMessageReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DelegatedMessageReply) ProtoMessage() {} + +func (x *DelegatedMessageReply) ProtoReflect() protoreflect.Message { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DelegatedMessageReply.ProtoReflect.Descriptor instead. +func (*DelegatedMessageReply) Descriptor() ([]byte, []int) { + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{2} +} + +func (x *DelegatedMessageReply) GetReply() *totem.RPC { + if x != nil { + return x.Reply + } + return nil +} + +func (x *DelegatedMessageReply) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +type BroadcastMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *totem.RPC `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + TargetSelector *v1.ClusterSelector `protobuf:"bytes,2,opt,name=targetSelector,proto3" json:"targetSelector,omitempty"` +} + +func (x *BroadcastMessage) Reset() { + *x = BroadcastMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BroadcastMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BroadcastMessage) ProtoMessage() {} + +func (x *BroadcastMessage) ProtoReflect() protoreflect.Message { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BroadcastMessage.ProtoReflect.Descriptor instead. +func (*BroadcastMessage) Descriptor() ([]byte, []int) { + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{3} +} + +func (x *BroadcastMessage) GetRequest() *totem.RPC { + if x != nil { + return x.Request + } + return nil +} + +func (x *BroadcastMessage) GetTargetSelector() *v1.ClusterSelector { + if x != nil { + return x.TargetSelector + } + return nil +} + var File_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto protoreflect.FileDescriptor var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byte{ @@ -124,25 +292,63 @@ var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byt 0x65, 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x1a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x72, 0x61, 0x6c, 0x69, 0x63, 0x6b, 0x79, 0x2f, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2f, 0x74, 0x6f, 0x74, - 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0x2f, 0x0a, 0x09, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, - 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x32, 0x66, 0x0a, 0x06, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x1a, 0x0a, 0x2e, - 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, - 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, - 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x72, 0x61, 0x6c, 0x69, 0x63, 0x6b, 0x79, 0x2f, 0x74, 0x6f, + 0x74, 0x65, 0x6d, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x0b, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x61, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, + 0x43, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x22, 0x65, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x05, + 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x6f, + 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x10, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x52, 0x07, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2a, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, + 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x65, 0x10, 0x01, 0x32, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, + 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, + 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, + 0x43, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, + 0x13, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x82, 0x01, 0x0a, + 0x08, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, + 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x12, 0x45, 0x0a, 0x09, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0x8a, 0xf1, 0x04, 0x02, 0x08, + 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -158,24 +364,40 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP() } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_goTypes = []interface{}{ - (EventType)(0), // 0: stream.EventType - (*StreamEvent)(nil), // 1: stream.StreamEvent - (*totem.RPC)(nil), // 2: totem.RPC - (*emptypb.Empty)(nil), // 3: google.protobuf.Empty + (EventType)(0), // 0: stream.EventType + (*StreamEvent)(nil), // 1: stream.StreamEvent + (*DelegatedMessage)(nil), // 2: stream.DelegatedMessage + (*DelegatedMessageReply)(nil), // 3: stream.DelegatedMessageReply + (*BroadcastMessage)(nil), // 4: stream.BroadcastMessage + (*totem.RPC)(nil), // 5: totem.RPC + (*v1.Reference)(nil), // 6: core.Reference + (*status.Status)(nil), // 7: google.rpc.Status + (*v1.ClusterSelector)(nil), // 8: core.ClusterSelector + (*emptypb.Empty)(nil), // 9: google.protobuf.Empty } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_depIdxs = []int32{ - 0, // 0: stream.StreamEvent.type:type_name -> stream.EventType - 2, // 1: stream.Stream.Connect:input_type -> totem.RPC - 1, // 2: stream.Stream.Notify:input_type -> stream.StreamEvent - 2, // 3: stream.Stream.Connect:output_type -> totem.RPC - 3, // 4: stream.Stream.Notify:output_type -> google.protobuf.Empty - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // 0: stream.StreamEvent.type:type_name -> stream.EventType + 5, // 1: stream.DelegatedMessage.request:type_name -> totem.RPC + 6, // 2: stream.DelegatedMessage.target:type_name -> core.Reference + 5, // 3: stream.DelegatedMessageReply.reply:type_name -> totem.RPC + 7, // 4: stream.DelegatedMessageReply.status:type_name -> google.rpc.Status + 5, // 5: stream.BroadcastMessage.request:type_name -> totem.RPC + 8, // 6: stream.BroadcastMessage.targetSelector:type_name -> core.ClusterSelector + 5, // 7: stream.Stream.Connect:input_type -> totem.RPC + 1, // 8: stream.Stream.Notify:input_type -> stream.StreamEvent + 2, // 9: stream.Delegate.Request:input_type -> stream.DelegatedMessage + 4, // 10: stream.Delegate.Broadcast:input_type -> stream.BroadcastMessage + 5, // 11: stream.Stream.Connect:output_type -> totem.RPC + 9, // 12: stream.Stream.Notify:output_type -> google.protobuf.Empty + 5, // 13: stream.Delegate.Request:output_type -> totem.RPC + 9, // 14: stream.Delegate.Broadcast:output_type -> google.protobuf.Empty + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() } @@ -196,6 +418,42 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { return nil } } + file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelegatedMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelegatedMessageReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BroadcastMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -203,9 +461,9 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc, NumEnums: 1, - NumMessages: 1, + NumMessages: 4, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_goTypes, DependencyIndexes: file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_depIdxs, diff --git a/pkg/apis/stream/v1/stream.proto b/pkg/apis/stream/v1/stream.proto index 762d2da8f5..8ac87b7ccf 100644 --- a/pkg/apis/stream/v1/stream.proto +++ b/pkg/apis/stream/v1/stream.proto @@ -1,7 +1,11 @@ syntax = "proto3"; option go_package = "github.com/rancher/opni/pkg/apis/stream/v1"; import "github.com/kralicky/totem/totem.proto"; +import "github.com/kralicky/totem/extensions.proto"; import "google/protobuf/empty.proto"; +import "google/rpc/status.proto"; +import "google/protobuf/any.proto"; +import "github.com/rancher/opni/pkg/apis/core/v1/core.proto"; package stream; service Stream { @@ -19,4 +23,32 @@ enum EventType { message StreamEvent { EventType type = 1; -} \ No newline at end of file +} + +service Delegate { + // A synchronous request-response RPC sent to a single client. + rpc Request(DelegatedMessage) returns (totem.RPC); + + // A best-effort broadcast sent to all connected clients, with an + // optional target filter. + rpc Broadcast(BroadcastMessage) returns (google.protobuf.Empty) { + option (totem.qos) = { + replicationStrategy: Broadcast + }; + } +} + +message DelegatedMessage { + totem.RPC request = 1; + core.Reference target = 2; +} + +message DelegatedMessageReply { + totem.RPC reply = 1; + google.rpc.Status status = 2; +} + +message BroadcastMessage { + totem.RPC request = 1; + core.ClusterSelector targetSelector = 2; +} diff --git a/pkg/apis/stream/v1/stream_grpc.pb.go b/pkg/apis/stream/v1/stream_grpc.pb.go index 2832d68be8..d5cd8f3593 100644 --- a/pkg/apis/stream/v1/stream_grpc.pb.go +++ b/pkg/apis/stream/v1/stream_grpc.pb.go @@ -178,3 +178,131 @@ var Stream_ServiceDesc = grpc.ServiceDesc{ }, Metadata: "github.com/rancher/opni/pkg/apis/stream/v1/stream.proto", } + +// DelegateClient is the client API for Delegate 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 DelegateClient interface { + // A synchronous request-response RPC sent to a single client. + Request(ctx context.Context, in *DelegatedMessage, opts ...grpc.CallOption) (*totem.RPC, error) + // A best-effort broadcast sent to all connected clients, with an + // optional target filter. + Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type delegateClient struct { + cc grpc.ClientConnInterface +} + +func NewDelegateClient(cc grpc.ClientConnInterface) DelegateClient { + return &delegateClient{cc} +} + +func (c *delegateClient) Request(ctx context.Context, in *DelegatedMessage, opts ...grpc.CallOption) (*totem.RPC, error) { + out := new(totem.RPC) + err := c.cc.Invoke(ctx, "/stream.Delegate/Request", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *delegateClient) Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/stream.Delegate/Broadcast", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DelegateServer is the server API for Delegate service. +// All implementations must embed UnimplementedDelegateServer +// for forward compatibility +type DelegateServer interface { + // A synchronous request-response RPC sent to a single client. + Request(context.Context, *DelegatedMessage) (*totem.RPC, error) + // A best-effort broadcast sent to all connected clients, with an + // optional target filter. + Broadcast(context.Context, *BroadcastMessage) (*emptypb.Empty, error) + mustEmbedUnimplementedDelegateServer() +} + +// UnimplementedDelegateServer must be embedded to have forward compatible implementations. +type UnimplementedDelegateServer struct { +} + +func (UnimplementedDelegateServer) Request(context.Context, *DelegatedMessage) (*totem.RPC, error) { + return nil, status.Errorf(codes.Unimplemented, "method Request not implemented") +} +func (UnimplementedDelegateServer) Broadcast(context.Context, *BroadcastMessage) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") +} +func (UnimplementedDelegateServer) mustEmbedUnimplementedDelegateServer() {} + +// UnsafeDelegateServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DelegateServer will +// result in compilation errors. +type UnsafeDelegateServer interface { + mustEmbedUnimplementedDelegateServer() +} + +func RegisterDelegateServer(s grpc.ServiceRegistrar, srv DelegateServer) { + s.RegisterService(&Delegate_ServiceDesc, srv) +} + +func _Delegate_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DelegatedMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DelegateServer).Request(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stream.Delegate/Request", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DelegateServer).Request(ctx, req.(*DelegatedMessage)) + } + return interceptor(ctx, in, info, handler) +} + +func _Delegate_Broadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BroadcastMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DelegateServer).Broadcast(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stream.Delegate/Broadcast", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DelegateServer).Broadcast(ctx, req.(*BroadcastMessage)) + } + return interceptor(ctx, in, info, handler) +} + +// Delegate_ServiceDesc is the grpc.ServiceDesc for Delegate service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Delegate_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "stream.Delegate", + HandlerType: (*DelegateServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Request", + Handler: _Delegate_Request_Handler, + }, + { + MethodName: "Broadcast", + Handler: _Delegate_Broadcast_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/rancher/opni/pkg/apis/stream/v1/stream.proto", +} diff --git a/pkg/gateway/delegate.go b/pkg/gateway/delegate.go new file mode 100644 index 0000000000..f0850fcaa9 --- /dev/null +++ b/pkg/gateway/delegate.go @@ -0,0 +1,143 @@ +package gateway + +import ( + "context" + "sync" + + "github.com/kralicky/totem" + agentv1 "github.com/rancher/opni/pkg/agent" + corev1 "github.com/rancher/opni/pkg/apis/core/v1" + streamv1 "github.com/rancher/opni/pkg/apis/stream/v1" + "github.com/rancher/opni/pkg/auth/cluster" + "github.com/rancher/opni/pkg/storage" + "go.uber.org/zap" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" +) + +type agentInfo struct { + grpc.ClientConnInterface + + labels map[string]string + id string +} + +func (a agentInfo) GetLabels() map[string]string { + return a.labels +} + +func (a agentInfo) GetId() string { + return a.id +} + +type DelegateServer struct { + streamv1.UnsafeDelegateServer + mu sync.RWMutex + activeAgents map[string]agentInfo + logger *zap.SugaredLogger + clusterStore storage.ClusterStore +} + +func NewDelegateServer(clusterStore storage.ClusterStore, lg *zap.SugaredLogger) *DelegateServer { + return &DelegateServer{ + activeAgents: make(map[string]agentInfo), + clusterStore: clusterStore, + logger: lg.Named("delegate"), + } +} + +func (d *DelegateServer) HandleAgentConnection(ctx context.Context, clientSet agentv1.ClientSet) { + d.mu.Lock() + id := cluster.StreamAuthorizedID(ctx) + + cluster, err := d.clusterStore.GetCluster(ctx, &corev1.Reference{Id: id}) + if err != nil { + d.logger.With( + "id", id, + zap.Error(err), + ).Error("internal error: failed to look up connecting agent") + return + } + + d.activeAgents[id] = agentInfo{ + ClientConnInterface: clientSet.ClientConn(), + labels: cluster.GetLabels(), + id: id, + } + d.logger.With("id", id).Debug("agent connected") + d.mu.Unlock() + + <-ctx.Done() + + d.mu.Lock() + delete(d.activeAgents, id) + d.logger.With("id", id).Debug("agent disconnected") + d.mu.Unlock() +} + +func (d *DelegateServer) Request(ctx context.Context, req *streamv1.DelegatedMessage) (*totem.RPC, error) { + d.mu.RLock() + defer d.mu.RUnlock() + + targetId := req.GetTarget().GetId() + lg := d.logger.With( + "target", targetId, + "request", req.GetRequest().QualifiedMethodName(), + ) + lg.Debug("delegating rpc request") + if target, ok := d.activeAgents[targetId]; ok { + resp := &totem.RPC{} + err := target.Invoke(ctx, totem.Forward, req.GetRequest(), resp) + if err != nil { + d.logger.With( + zap.Error(err), + ).Error("delegating rpc request failed") + return nil, err + } + return resp, nil + } else { + err := status.Error(codes.NotFound, "target not found") + lg.With( + zap.Error(err), + ).Warn("delegating rpc request failed") + return nil, err + } +} + +func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastMessage) (*emptypb.Empty, error) { + d.mu.RLock() + defer d.mu.RUnlock() + + sp := storage.NewSelectorPredicate[agentInfo](req.GetTargetSelector()) + + var targets []grpc.ClientConnInterface + for _, aa := range d.activeAgents { + if sp(aa) { + targets = append(targets, aa) + } + } + + if len(targets) == 0 { + return nil, status.Error(codes.NotFound, "no targets found") + } + + eg, ctx := errgroup.WithContext(ctx) + + for _, target := range targets { + target := target + eg.Go(func() error { + reply := &emptypb.Empty{} + return target.Invoke(ctx, totem.Forward, req.GetRequest(), reply) + }) + } + + err := eg.Wait() + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/pkg/gateway/gateway.go b/pkg/gateway/gateway.go index a5c2c5ef52..f4470fd8bc 100644 --- a/pkg/gateway/gateway.go +++ b/pkg/gateway/gateway.go @@ -199,14 +199,15 @@ func NewGateway(ctx context.Context, conf *config.GatewayConfig, pl plugins.Load listener := health.NewListener() monitor := health.NewMonitor(health.WithLogger(lg.Named("monitor"))) sync := NewSyncRequester(lg) + delegate := NewDelegateServer(storageBackend, lg) // set up agent connection handlers - agentHandler := MultiConnectionHandler(listener, sync) - //// set up ref count to health listener - //versionHandler := MultiConnectionHandler(listener, ) + agentHandler := MultiConnectionHandler(listener, sync, delegate) + go monitor.Run(ctx, listener) streamSvc := NewStreamServer(agentHandler, storageBackend, lg) controlv1.RegisterHealthListenerServer(streamSvc, listener) + streamv1.RegisterDelegateServer(grpcServer, delegate) streamv1.RegisterStreamServer(grpcServer, streamSvc) controlv1.RegisterPluginSyncServer(grpcServer, syncServer) diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go new file mode 100644 index 0000000000..69470a362f --- /dev/null +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -0,0 +1,109 @@ +package stream + +import ( + "context" + "fmt" + "strings" + + "github.com/kralicky/totem" + corev1 "github.com/rancher/opni/pkg/apis/core/v1" + streamv1 "github.com/rancher/opni/pkg/apis/stream/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +type StreamDelegate[T any] interface { + WithTarget(*corev1.Reference) T + WithBroadcastSelector(*corev1.ClusterSelector) T +} + +func NewDelegate[T any](cc grpc.ClientConnInterface, newClientFunc func(grpc.ClientConnInterface) T) StreamDelegate[T] { + return &delegatingClient[T]{ + streamClientIntf: cc, + newClientFunc: newClientFunc, + } +} + +type delegatingClient[T any] struct { + streamClientIntf grpc.ClientConnInterface + newClientFunc func(grpc.ClientConnInterface) T +} + +func (w *delegatingClient[T]) WithTarget(target *corev1.Reference) T { + return w.newClientFunc(&targetedDelegatingClient[T]{ + target: target, + delegateClient: streamv1.NewDelegateClient(w.streamClientIntf), + }) +} + +func (w *delegatingClient[T]) WithBroadcastSelector(selector *corev1.ClusterSelector) T { + return w.newClientFunc(&targetedDelegatingClient[T]{ + selector: selector, + delegateClient: streamv1.NewDelegateClient(w.streamClientIntf), + }) +} + +type targetedDelegatingClient[T any] struct { + target *corev1.Reference + selector *corev1.ClusterSelector + delegateClient streamv1.DelegateClient +} + +// parses a method name of the form "/service/method" +func parseQualifiedMethod(method string) (string, string, error) { + parts := strings.Split(method, "/") + if len(parts) != 3 { + return "", "", fmt.Errorf("invalid method name: %s", method) + } + return parts[1], parts[2], nil +} + +func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error { + svcName, methodName, err := parseQualifiedMethod(method) + if err != nil { + return err + } + requestBytes, err := proto.Marshal(args.(proto.Message)) + if err != nil { + return err + } + rpc := &totem.RPC{ + ServiceName: svcName, + MethodName: methodName, + Content: &totem.RPC_Request{ + Request: requestBytes, + }, + } + if w.target != nil { + respMsg, err := w.delegateClient.Request(ctx, &streamv1.DelegatedMessage{ + Request: rpc, + Target: w.target, + }) + if err != nil { + return err + } + resp := respMsg.GetResponse() + stat := resp.GetStatus() + if stat.Code() != codes.OK { + return stat.Err() + } + if err := proto.Unmarshal(resp.Response, reply.(proto.Message)); err != nil { + return status.Errorf(codes.Internal, "failed to unmarshal response: %v", err) + } + } else if w.selector != nil { + _, err := w.delegateClient.Broadcast(ctx, &streamv1.BroadcastMessage{ + Request: rpc, + TargetSelector: w.selector, + }) + if err != nil { + return err + } + } + panic("bug: no target or selector given") +} + +func (w *targetedDelegatingClient[T]) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { + panic("not implemented") +} diff --git a/pkg/storage/conformance/cluster_store.go b/pkg/storage/conformance/cluster_store.go index 9465ac9c7f..c3ee5131e8 100644 --- a/pkg/storage/conformance/cluster_store.go +++ b/pkg/storage/conformance/cluster_store.go @@ -138,7 +138,7 @@ func ClusterStoreTestSuite[T storage.ClusterStore]( Expect(err).NotTo(HaveOccurred()) Expect(clusters.Items).To(HaveLen(5)) for _, cluster := range clusters.Items { - Expect(storage.NewSelectorPredicate(sel)(cluster)).To(BeTrue()) + Expect(storage.NewSelectorPredicate[*corev1.Cluster](sel)(cluster)).To(BeTrue()) } sel = &corev1.ClusterSelector{ LabelSelector: &corev1.LabelSelector{ @@ -151,7 +151,7 @@ func ClusterStoreTestSuite[T storage.ClusterStore]( Expect(err).NotTo(HaveOccurred()) Expect(clusters.Items).To(HaveLen(5)) for _, cluster := range clusters.Items { - Expect(storage.NewSelectorPredicate(sel)(cluster)).To(BeTrue()) + Expect(storage.NewSelectorPredicate[*corev1.Cluster](sel)(cluster)).To(BeTrue()) } }) It("should respect match options", func() { diff --git a/pkg/storage/etcd/cluster_store.go b/pkg/storage/etcd/cluster_store.go index 062858bdb6..cf99eb5154 100644 --- a/pkg/storage/etcd/cluster_store.go +++ b/pkg/storage/etcd/cluster_store.go @@ -70,7 +70,7 @@ func (e *EtcdStore) ListClusters( clusters := &corev1.ClusterList{ Items: []*corev1.Cluster{}, } - selectorPredicate := storage.NewSelectorPredicate(&corev1.ClusterSelector{ + selectorPredicate := storage.NewSelectorPredicate[*corev1.Cluster](&corev1.ClusterSelector{ LabelSelector: matchLabels, MatchOptions: matchOptions, }) diff --git a/pkg/storage/jetstream/cluster_store.go b/pkg/storage/jetstream/cluster_store.go index 95de88ed9e..609bc474d5 100644 --- a/pkg/storage/jetstream/cluster_store.go +++ b/pkg/storage/jetstream/cluster_store.go @@ -280,7 +280,7 @@ func (s *JetStreamStore) ListClusters(ctx context.Context, matchLabels *corev1.L } defer watcher.Stop() - selectorPredicate := storage.NewSelectorPredicate(&corev1.ClusterSelector{ + selectorPredicate := storage.NewSelectorPredicate[*corev1.Cluster](&corev1.ClusterSelector{ LabelSelector: matchLabels, MatchOptions: matchOptions, }) diff --git a/pkg/storage/selection.go b/pkg/storage/selection.go index 85a585a84e..059fda41a4 100644 --- a/pkg/storage/selection.go +++ b/pkg/storage/selection.go @@ -2,31 +2,31 @@ package storage import corev1 "github.com/rancher/opni/pkg/apis/core/v1" -type SelectorPredicate func(*corev1.Cluster) bool +type SelectorPredicate[T corev1.IdLabelReader] func(T) bool -func NewSelectorPredicate(s *corev1.ClusterSelector) SelectorPredicate { +func NewSelectorPredicate[T corev1.IdLabelReader](s *corev1.ClusterSelector) SelectorPredicate[T] { emptyLabelSelector := s.LabelSelector.IsEmpty() if emptyLabelSelector && len(s.ClusterIDs) == 0 { switch { case s.MatchOptions&corev1.MatchOptions_EmptySelectorMatchesNone != 0: - return func(cluster *corev1.Cluster) bool { return false } + return func(T) bool { return false } default: - return func(c *corev1.Cluster) bool { return true } + return func(T) bool { return true } } } idSet := map[string]struct{}{} for _, id := range s.ClusterIDs { idSet[id] = struct{}{} } - return func(c *corev1.Cluster) bool { - id := c.Id + return func(c T) bool { + id := c.GetId() if _, ok := idSet[id]; ok { return true } if emptyLabelSelector { return false } - return labelSelectorMatches(s.LabelSelector, c.GetMetadata().GetLabels()) + return labelSelectorMatches(s.LabelSelector, c.GetLabels()) } } diff --git a/pkg/storage/selection_test.go b/pkg/storage/selection_test.go index 4ab1e751bd..7c4a4ba743 100644 --- a/pkg/storage/selection_test.go +++ b/pkg/storage/selection_test.go @@ -42,6 +42,6 @@ var _ = Describe("Selection", Label("unit"), func() { Entry(nil, selector(matchExprs("bar DoesNotExist", "bar Exists")), cluster("c1", "foo", "quux"), false), } DescribeTable("Label Selector", func(selector *corev1.ClusterSelector, c *corev1.Cluster, expected bool) { - Expect(storage.NewSelectorPredicate(selector)(c)).To(Equal(expected)) + Expect(storage.NewSelectorPredicate[*corev1.Cluster](selector)(c)).To(Equal(expected)) }, entries) }) diff --git a/pkg/test/mock_helpers.go b/pkg/test/mock_helpers.go index f220a3bce9..6b4859ce40 100644 --- a/pkg/test/mock_helpers.go +++ b/pkg/test/mock_helpers.go @@ -198,7 +198,7 @@ func NewTestClusterStore(ctrl *gomock.Controller) storage.ClusterStore { return nil, err } clusterList := &corev1.ClusterList{} - selectorPredicate := storage.NewSelectorPredicate(&corev1.ClusterSelector{ + selectorPredicate := storage.NewSelectorPredicate[*corev1.Cluster](&corev1.ClusterSelector{ LabelSelector: matchLabels, MatchOptions: matchOptions, }) diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index 905b387b7a..ef645f946b 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -6,6 +6,7 @@ import ( "github.com/rancher/opni/plugins/metrics/pkg/apis/node" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "google.golang.org/grpc" ) func (p *Plugin) StreamServers() []streamext.Server { @@ -27,3 +28,10 @@ func (p *Plugin) StreamServers() []streamext.Server { }, } } + +func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { + // example delegate usage + // syncDelegate := streamext.NewDelegate(cc, capabilityv1.NewNodeClient) + // target := &corev1.Reference{Id: "foo"} + // syncDelegate.WithTarget(target).SyncNow(context.Background(), &capabilityv1.Filter{}) +} From 88a0309f12af86236e672b26de34e3bce4d17077 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 21 Dec 2022 12:25:38 -0500 Subject: [PATCH 13/43] initial stream delegate integration --- .../apis/apiextensions/stream/plugin.go | 23 +++- plugins/metrics/pkg/agent/http.go | 13 +-- plugins/metrics/pkg/agent/node.go | 5 +- plugins/metrics/pkg/agent/runner.go | 105 ++++++------------ plugins/metrics/pkg/agent/stream.go | 15 ++- .../pkg/apis/remoteread/remoteread.pb.go | 69 ++++++------ .../pkg/apis/remoteread/remoteread.proto | 5 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 96 +++++++++++----- plugins/metrics/pkg/backend/metrics.go | 60 ++++------ plugins/metrics/pkg/cortex/remotewrite.go | 11 +- plugins/metrics/pkg/gateway/plugin.go | 6 +- plugins/metrics/pkg/gateway/stream.go | 5 +- 12 files changed, 210 insertions(+), 203 deletions(-) diff --git a/pkg/plugins/apis/apiextensions/stream/plugin.go b/pkg/plugins/apis/apiextensions/stream/plugin.go index bbc4e55b9d..1db61c4ab0 100644 --- a/pkg/plugins/apis/apiextensions/stream/plugin.go +++ b/pkg/plugins/apis/apiextensions/stream/plugin.go @@ -68,6 +68,7 @@ func (p *streamApiExtensionPlugin) GRPCServer( ) error { apiextensions.RegisterStreamAPIExtensionServer(s, p.extensionSrv) streamv1.RegisterStreamServer(s, p.extensionSrv) + streamv1.RegisterDelegateServer(s, p.extensionSrv) return nil } @@ -125,6 +126,8 @@ func NewPlugin(p StreamAPIExtension) plugin.Plugin { type streamExtensionServerImpl struct { streamv1.UnsafeStreamServer + streamv1.UnsafeDelegateServer + name string apiextensions.UnimplementedStreamAPIExtensionServer servers []*richServer @@ -182,6 +185,13 @@ func (e *streamExtensionServerImpl) Connect(stream streamv1.Stream_ConnectServer e.streamClientCond.Broadcast() e.streamClientCond.L.Unlock() + // todo: necessary for gateway but redundant for clients (will cause UseStreamClient to run twice) + if e.clientHandler != nil { + if _, err := e.Notify(context.TODO(), &streamv1.StreamEvent{Type: streamv1.EventType_DiscoveryComplete}); err != nil { + e.logger.Infof("failed to notify server of new connection") + } + } + defer func() { e.streamClientCond.L.Lock() if e.clientDisconnectHandler != nil { @@ -202,7 +212,7 @@ func (e *streamExtensionServerImpl) Connect(stream streamv1.Stream_ConnectServer func (e *streamExtensionServerImpl) Notify(ctx context.Context, event *streamv1.StreamEvent) (*emptypb.Empty, error) { e.logger.With( "type", event.Type.String(), - ).Debug("received notify event") + ).Debugf("received notify event for '%s'", e.name) returned := make(chan struct{}) defer close(returned) go func() { @@ -238,6 +248,17 @@ func (e *streamExtensionServerImpl) Notify(ctx context.Context, event *streamv1. return &emptypb.Empty{}, nil } +// Implements streamv1.DelegateServer +func (e *streamExtensionServerImpl) Request(ctx context.Context, message *streamv1.DelegatedMessage) (*totem.RPC, error) { + //TODO implement me + panic("implement me") +} + +func (e *streamExtensionServerImpl) Broadcast(ctx context.Context, message *streamv1.BroadcastMessage) (*emptypb.Empty, error) { + //TODO implement me + panic("implement me") +} + // func (e *mgmtExtensionServerImpl) Services(context.Context, *emptypb.Empty) (*apiextensions.ServiceDescriptorList, error) { // list := []*apiextensions.ServiceDescriptor{} // for _, srv := range e.servers { diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index 2d46009a5d..6b288ddba4 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -65,26 +65,16 @@ func (s *HttpServer) SetRemoteWriteClient(client clients.Locker[remotewrite.Remo } func (s *HttpServer) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { - s.remoteWriteClientMu.Lock() + s.remoteReadClientMu.Lock() defer s.remoteReadClientMu.Unlock() s.remoteReadClient = client } -// SetTargetRunner sets the runner of the HttpServer. If there is already a -// remotewrite.RemoteWriteClient set for the server, it will be passed to the -// runner using TargetRunner.SetRemoteWriteClient. func (s *HttpServer) SetTargetRunner(runner clients.Locker[TargetRunner]) { s.targetRunnerMu.Lock() defer s.targetRunnerMu.Unlock() - s.remoteWriteClientMu.Lock() - if s.remoteWriteClient != nil { - runner.Use(func(runner TargetRunner) { - runner.SetRemoteWriteClient(s.remoteWriteClient) - }) - } - s.targetRunner = runner } @@ -197,6 +187,7 @@ func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { c.Status(http.StatusOK) }) + } func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 4619286053..789f18f267 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -27,8 +27,9 @@ import ( type MetricsNode struct { capabilityv1.UnsafeNodeServer controlv1.UnsafeHealthServer - //remoteread.UnsafeRemoteReadGatewayServer - remoteread.UnimplementedRemoteReadGatewayServer + + // we only need a subset of the methods + remoteread.UnsafeRemoteReadAgentServer logger *zap.SugaredLogger diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 20e3737086..7620b9b49a 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -8,11 +8,9 @@ import ( "github.com/opentracing-contrib/go-stdlib/nethttp" promConfig "github.com/prometheus/common/config" "github.com/prometheus/prometheus/prompb" - "github.com/rancher/opni/pkg/auth/cluster" "github.com/rancher/opni/pkg/clients" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" - "github.com/rancher/opni/plugins/metrics/pkg/cortex" "go.uber.org/zap" "google.golang.org/protobuf/types/known/timestamppb" "sync" @@ -105,10 +103,6 @@ type TargetRunner interface { SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) - - SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) - - SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) } func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { @@ -124,14 +118,8 @@ type targetRunner struct { runsMu sync.RWMutex runs map[string]Run - //remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] - //remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] - - remoteWriteClientMu sync.RWMutex - RemoteWriteClient *cortex.RemoteWriteForwarder - - remoteReadServerMu sync.RWMutex - RemoteReadServer remoteread.RemoteReadGatewayServer + remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] + remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] } func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { @@ -142,46 +130,22 @@ func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread //runner.remoteReadClient = client } -func (runner *targetRunner) SetRemoteWriteForwarder(forwarder *cortex.RemoteWriteForwarder) { - runner.RemoteWriteClient = forwarder -} - -func (runner *targetRunner) SetRemoteReadServer(server remoteread.RemoteReadGatewayServer) { - runner.RemoteReadServer = server -} - // updateRunStatus notifies the gateway of the status of the Run's target status func (runner *targetRunner) updateRunStatus(run Run) { - //runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { - // newStatus := run.target.Status - // - // request := &remoteread.TargetStatusUpdateRequest{ - // Meta: run.target.Meta, - // NewStatus: newStatus, - // } - // - // _, err := client.UpdateTargetStatus(context.TODO(), request) - // - // if err != nil { - // // todo: log this - // } - //}) - - runner.remoteReadServerMu.Lock() - defer runner.remoteReadServerMu.Unlock() - - newStatus := run.target.Status - - request := &remoteread.TargetStatusUpdateRequest{ - Meta: run.target.Meta, - NewStatus: newStatus, - } + runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { + newStatus := run.target.Status + + request := &remoteread.TargetStatusUpdateRequest{ + Meta: run.target.Meta, + NewStatus: newStatus, + } - _, err := runner.RemoteReadServer.UpdateTargetStatus(context.TODO(), request) + _, err := client.UpdateTargetStatus(context.TODO(), request) - if err != nil { - runner.logger.Errorf("failed to push status to server: %s", err) - } + if err != nil { + runner.logger.Errorf("failed to push status to server: %s", err) + } + }) } func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { @@ -196,7 +160,7 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) labelMatchers := toLabelMatchers(run.query.Matchers) - // todo: this should probably be a lot more sophisticated than this + // todo: this should probably be more sophisticated than this to handle read size limits importEnd := run.query.EndTimestamp.AsTime().UnixMilli() nextEndDelta := time.Minute.Milliseconds() * 5 @@ -253,27 +217,16 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) Contents: compressed, } - // todo: allows for testing without direct to cluster communication streams - ctx := context.WithValue(context.TODO(), cluster.ClusterIDKey, run.target.Meta.ClusterId) - - //runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { - // if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { - // run.failed("failed to push to remote write") - // runner.updateRunStatus(run) - // return - // } - // - // run.updateLastRead(nextEnd) - // runner.updateRunStatus(run) - //}) - - runner.remoteWriteClientMu.Lock() - if _, err := runner.RemoteWriteClient.Push(ctx, payload); err != nil { - run.failed(fmt.Sprintf("failed to push to remote write: %s", err.Error())) + runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { + if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { + run.failed("failed to push to remote write") + runner.updateRunStatus(run) + return + } + + run.updateLastRead(nextEnd) runner.updateRunStatus(run) - return - } - runner.remoteWriteClientMu.Unlock() + }) runner.logger.With( "cluster", run.target.Meta.ClusterId, @@ -336,6 +289,11 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q go runner.run(run, remoteReaderClient) + runner.logger.With( + "cluster", target.Meta.ClusterId, + "name", target.Meta.Name, + ).Infof("target started") + return nil } @@ -352,5 +310,10 @@ func (runner *targetRunner) Stop(name string) error { run.stopped() runner.updateRunStatus(run) + runner.logger.With( + "cluster", run.target.Meta.ClusterId, + "name", run.target.Meta.Name, + ).Infof("target stopped") + return nil } diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index 93c86764fd..c4e11064a5 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -18,17 +18,24 @@ func (p *Plugin) StreamServers() []streamext.Server { Impl: p.node, }, { - Desc: &remoteread.RemoteReadGateway_ServiceDesc, + Desc: &remoteread.RemoteReadAgent_ServiceDesc, Impl: p.node, }, } } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { + runner := clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { + runner := NewTargetRunner(p.logger.Named("remote-read")) + + runner.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) + runner.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) + + return runner + }) + p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) - p.httpServer.SetTargetRunner(clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { - return NewTargetRunner(p.logger.Named("remote-read")) - })) + p.httpServer.SetTargetRunner(runner) p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 266504e9f0..4174a43ddc 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -1306,20 +1306,20 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, + 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x53, 0x0a, 0x12, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x32, 0x8d, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, + 0x32, 0xe2, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, @@ -1328,11 +1328,16 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1404,23 +1409,25 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 11, // 27: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest 12, // 28: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest 15, // 29: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest - 16, // 30: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest - 13, // 31: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest - 14, // 32: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 13, // 30: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 14, // 31: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 16, // 32: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest 13, // 33: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest 14, // 34: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest - 21, // 35: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty - 21, // 36: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty - 21, // 37: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty - 7, // 38: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList - 4, // 39: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus - 21, // 40: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty + 16, // 35: remoteread.RemoteReadAgent.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest + 21, // 36: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 21, // 37: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 21, // 38: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 7, // 39: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 4, // 40: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus 21, // 41: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty 21, // 42: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty - 21, // 43: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty - 21, // 44: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty - 35, // [35:45] is the sub-list for method output_type - 25, // [25:35] is the sub-list for method input_type + 21, // 43: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty + 21, // 44: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 21, // 45: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 21, // 46: remoteread.RemoteReadAgent.UpdateTargetStatus:output_type -> google.protobuf.Empty + 36, // [36:47] is the sub-list for method output_type + 25, // [25:36] is the sub-list for method input_type 25, // [25:25] is the sub-list for extension type_name 25, // [25:25] is the sub-list for extension extendee 0, // [0:25] is the sub-list for field type_name diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index 3084c162eb..ae4ac191e9 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -10,7 +10,6 @@ import "google/api/annotations.proto"; package remoteread; // todo: we probably need a new type for Describe and ScanFor -// RemoteReadGateway handles requests from the agent / cli. service RemoteReadGateway { // rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); // rpc Describe(Target) returns (Target) @@ -20,16 +19,16 @@ service RemoteReadGateway { rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); rpc ListTargets(TargetListRequest) returns (TargetList); rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); - rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); + rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); } -// RemoteReadAgent handles requests to the agent. service RemoteReadAgent { rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); + rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); } message Target { diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index a7d6f58fa8..c84bcb2e44 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -28,9 +28,9 @@ type RemoteReadGatewayClient interface { RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) - UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type remoteReadGatewayClient struct { @@ -86,27 +86,27 @@ func (c *remoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *Targe return out, nil } -func (c *remoteReadGatewayClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/UpdateTargetStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Start", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadGatewayClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Start", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Stop", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *remoteReadGatewayClient) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *remoteReadGatewayClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Stop", in, out, opts...) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/UpdateTargetStatus", in, out, opts...) if err != nil { return nil, err } @@ -122,9 +122,9 @@ type RemoteReadGatewayServer interface { RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) - UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) + UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) mustEmbedUnimplementedRemoteReadGatewayServer() } @@ -147,15 +147,15 @@ func (UnimplementedRemoteReadGatewayServer) ListTargets(context.Context, *Target func (UnimplementedRemoteReadGatewayServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") } -func (UnimplementedRemoteReadGatewayServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") -} func (UnimplementedRemoteReadGatewayServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } func (UnimplementedRemoteReadGatewayServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } +func (UnimplementedRemoteReadGatewayServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") +} func (UnimplementedRemoteReadGatewayServer) mustEmbedUnimplementedRemoteReadGatewayServer() {} // UnsafeRemoteReadGatewayServer may be embedded to opt out of forward compatibility for this service. @@ -259,56 +259,56 @@ func _RemoteReadGateway_GetTargetStatus_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } -func _RemoteReadGateway_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TargetStatusUpdateRequest) +func _RemoteReadGateway_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartReadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, in) + return srv.(RemoteReadGatewayServer).Start(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteReadGateway/UpdateTargetStatus", + FullMethod: "/remoteread.RemoteReadGateway/Start", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) + return srv.(RemoteReadGatewayServer).Start(ctx, req.(*StartReadRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteReadGateway_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartReadRequest) +func _RemoteReadGateway_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopReadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadGatewayServer).Start(ctx, in) + return srv.(RemoteReadGatewayServer).Stop(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteReadGateway/Start", + FullMethod: "/remoteread.RemoteReadGateway/Stop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadGatewayServer).Start(ctx, req.(*StartReadRequest)) + return srv.(RemoteReadGatewayServer).Stop(ctx, req.(*StopReadRequest)) } return interceptor(ctx, in, info, handler) } -func _RemoteReadGateway_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StopReadRequest) +func _RemoteReadGateway_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusUpdateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadGatewayServer).Stop(ctx, in) + return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteReadGateway/Stop", + FullMethod: "/remoteread.RemoteReadGateway/UpdateTargetStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadGatewayServer).Stop(ctx, req.(*StopReadRequest)) + return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) } return interceptor(ctx, in, info, handler) } @@ -340,10 +340,6 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetTargetStatus", Handler: _RemoteReadGateway_GetTargetStatus_Handler, }, - { - MethodName: "UpdateTargetStatus", - Handler: _RemoteReadGateway_UpdateTargetStatus_Handler, - }, { MethodName: "Start", Handler: _RemoteReadGateway_Start_Handler, @@ -352,6 +348,10 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "Stop", Handler: _RemoteReadGateway_Stop_Handler, }, + { + MethodName: "UpdateTargetStatus", + Handler: _RemoteReadGateway_UpdateTargetStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", @@ -363,6 +363,7 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ type RemoteReadAgentClient interface { Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type remoteReadAgentClient struct { @@ -391,12 +392,22 @@ func (c *remoteReadAgentClient) Stop(ctx context.Context, in *StopReadRequest, o return out, nil } +func (c *remoteReadAgentClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/UpdateTargetStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RemoteReadAgentServer is the server API for RemoteReadAgent service. // All implementations must embed UnimplementedRemoteReadAgentServer // for forward compatibility type RemoteReadAgentServer interface { Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) + UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) mustEmbedUnimplementedRemoteReadAgentServer() } @@ -410,6 +421,9 @@ func (UnimplementedRemoteReadAgentServer) Start(context.Context, *StartReadReque func (UnimplementedRemoteReadAgentServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } +func (UnimplementedRemoteReadAgentServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") +} func (UnimplementedRemoteReadAgentServer) mustEmbedUnimplementedRemoteReadAgentServer() {} // UnsafeRemoteReadAgentServer may be embedded to opt out of forward compatibility for this service. @@ -459,6 +473,24 @@ func _RemoteReadAgent_Stop_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _RemoteReadAgent_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadAgentServer).UpdateTargetStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadAgent/UpdateTargetStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadAgentServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + // RemoteReadAgent_ServiceDesc is the grpc.ServiceDesc for RemoteReadAgent service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -474,6 +506,10 @@ var RemoteReadAgent_ServiceDesc = grpc.ServiceDesc{ MethodName: "Stop", Handler: _RemoteReadAgent_Stop_Handler, }, + { + MethodName: "UpdateTargetStatus", + Handler: _RemoteReadAgent_UpdateTargetStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 953ab4de5e..988d081874 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,7 +3,7 @@ package backend import ( "context" "fmt" - "github.com/rancher/opni/plugins/metrics/pkg/agent" + streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" "go.uber.org/zap" @@ -49,8 +49,6 @@ type MetricsBackend struct { remoteReadTargetMu sync.RWMutex remoteReadTargets map[string]*remoteread.Target - runner agent.TargetRunner - util.Initializer } @@ -59,14 +57,14 @@ var _ cortexops.CortexOpsServer = (*MetricsBackend)(nil) var _ remoteread.RemoteReadGatewayServer = (*MetricsBackend)(nil) type MetricsBackendConfig struct { - Logger *zap.SugaredLogger `validate:"required"` - StorageBackend storage.Backend `validate:"required"` - MgmtClient managementv1.ManagementClient `validate:"required"` - NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` - UninstallController *task.Controller `validate:"required"` - ClusterDriver drivers.ClusterDriver `validate:"required"` - - RemoteWriteClient *cortex.RemoteWriteForwarder `validate:"required"` + Logger *zap.SugaredLogger `validate:"required"` + StorageBackend storage.Backend `validate:"required"` + MgmtClient managementv1.ManagementClient `validate:"required"` + NodeManagerClient capabilityv1.NodeManagerClient `validate:"required"` + UninstallController *task.Controller `validate:"required"` + ClusterDriver drivers.ClusterDriver `validate:"required"` + Delegate streamext.StreamDelegate[remoteread.RemoteReadAgentClient] `validate:"required"` + RemoteWriteClient *cortex.RemoteWriteForwarder `validate:"required"` } func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { @@ -79,9 +77,11 @@ func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { m.desiredNodeSpec = make(map[string]*node.MetricsCapabilitySpec) m.remoteReadTargets = make(map[string]*remoteread.Target) - m.runner = agent.NewTargetRunner(m.Logger.Named("target-runner")) - m.runner.SetRemoteWriteForwarder(m.RemoteWriteClient) - m.runner.SetRemoteReadServer(m) + if m.Delegate == nil { + m.Logger.Infof("found nil delegate") + } else { + m.Logger.Infof("found non-nil delegate") + } }) } @@ -366,6 +366,7 @@ func (m *MetricsBackend) Sync(ctx context.Context, req *node.SyncRequest) (*node }, }, }), nil + // return buildResponse(req.GetCurrentConfig(), &node.MetricsCapabilityConfig{ // Enabled: enabled, // Spec: m.desiredNodeSpec[id], @@ -427,11 +428,6 @@ func (m *MetricsBackend) UninstallCluster(ctx context.Context, in *emptypb.Empty } // Metrics Remote Read Backend -// todo: handle running targets (disallow all edits / deletes / etc) - -func targetAlreadyRunningError(id string) error { - return fmt.Errorf("target '%s' is already running", id) -} func targetAlreadyExistsError(id string) error { return fmt.Errorf("target '%s' already exists", id) @@ -598,23 +594,11 @@ func (m *MetricsBackend) UpdateTargetStatus(_ context.Context, request *remotere func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - targetId := getIdFromTargetMeta(request.Target.Meta) - - m.remoteReadTargetMu.Lock() - target, found := m.remoteReadTargets[targetId] - m.remoteReadTargetMu.Unlock() - - if !found { - return nil, targetDoesNotExistError(targetId) - } - - request.Target = target - - if target.Status.State == remoteread.TargetStatus_Running { - return nil, targetAlreadyRunningError(targetId) + if m.Delegate == nil { + return nil, fmt.Errorf("encountered nil delegate") } - err := m.runner.Start(request.Target, request.Query) + _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Target.Meta.ClusterId}).Start(ctx, request) if err != nil { m.Logger.With( @@ -639,10 +623,11 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - err := m.runner.Stop(request.Meta.Name) + if m.Delegate == nil { + return nil, fmt.Errorf("encountered nil delegate") + } - // todo: send start request to appropriate agent - //_, err := 0, fmt.Errorf("not yet implemented") + _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Meta.ClusterId}).Stop(ctx, request) if err != nil { m.Logger.With( @@ -655,7 +640,6 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR return nil, err } - // todo: we might want to display the new name if it was changed m.Logger.With( "cluster", request.Meta.Name, "target", request.Meta.Name, diff --git a/plugins/metrics/pkg/cortex/remotewrite.go b/plugins/metrics/pkg/cortex/remotewrite.go index 2998d32ac6..60d2d29291 100644 --- a/plugins/metrics/pkg/cortex/remotewrite.go +++ b/plugins/metrics/pkg/cortex/remotewrite.go @@ -51,13 +51,10 @@ func (f *RemoteWriteForwarder) Push(ctx context.Context, payload *remotewrite.Pa return nil, util.StatusError(codes.Unavailable) } - // todo: allows for testing without direct to cluster communication streams - //clusterId, ok := cluster.AuthorizedIDFromIncomingContext(ctx) - //if !ok { - // return nil, status.Error(codes.Unauthenticated, "no cluster ID found in context") - //} - - clusterId := ctx.Value(cluster.ClusterIDKey).(string) + clusterId, ok := cluster.AuthorizedIDFromIncomingContext(ctx) + if !ok { + return nil, status.Error(codes.Unauthenticated, "no cluster ID found in context") + } defer func() { code := status.Code(pushErr) diff --git a/plugins/metrics/pkg/gateway/plugin.go b/plugins/metrics/pkg/gateway/plugin.go index bc768901c0..489e7d73a4 100644 --- a/plugins/metrics/pkg/gateway/plugin.go +++ b/plugins/metrics/pkg/gateway/plugin.go @@ -52,6 +52,7 @@ type Plugin struct { cortexClientSet future.Future[cortex.ClientSet] uninstallController future.Future[*task.Controller] clusterDriver future.Future[drivers.ClusterDriver] + delegate future.Future[streamext.StreamDelegate[remoteread.RemoteReadAgentClient]] } func NewPlugin(ctx context.Context) *Plugin { @@ -71,6 +72,7 @@ func NewPlugin(ctx context.Context) *Plugin { cortexClientSet: future.New[cortex.ClientSet](), uninstallController: future.New[*task.Controller](), clusterDriver: future.New[drivers.ClusterDriver](), + delegate: future.New[streamext.StreamDelegate[remoteread.RemoteReadAgentClient]](), } future.Wait2(p.cortexClientSet, p.config, @@ -100,13 +102,14 @@ func NewPlugin(ctx context.Context) *Plugin { }) }) - future.Wait5(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, + future.Wait6(p.storageBackend, p.mgmtClient, p.nodeManagerClient, p.uninstallController, p.clusterDriver, p.delegate, func( storageBackend storage.Backend, mgmtClient managementv1.ManagementClient, nodeManagerClient capabilityv1.NodeManagerClient, uninstallController *task.Controller, clusterDriver drivers.ClusterDriver, + delegate streamext.StreamDelegate[remoteread.RemoteReadAgentClient], ) { p.metrics.Initialize(backend.MetricsBackendConfig{ Logger: p.logger.Named("metrics-backend"), @@ -116,6 +119,7 @@ func NewPlugin(ctx context.Context) *Plugin { UninstallController: uninstallController, ClusterDriver: clusterDriver, RemoteWriteClient: &p.cortexRemoteWrite, + Delegate: delegate, }) }) diff --git a/plugins/metrics/pkg/gateway/stream.go b/plugins/metrics/pkg/gateway/stream.go index ef645f946b..602175ed74 100644 --- a/plugins/metrics/pkg/gateway/stream.go +++ b/plugins/metrics/pkg/gateway/stream.go @@ -30,8 +30,5 @@ func (p *Plugin) StreamServers() []streamext.Server { } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { - // example delegate usage - // syncDelegate := streamext.NewDelegate(cc, capabilityv1.NewNodeClient) - // target := &corev1.Reference{Id: "foo"} - // syncDelegate.WithTarget(target).SyncNow(context.Background(), &capabilityv1.Filter{}) + p.delegate.Set(streamext.NewDelegate(cc, remoteread.NewRemoteReadAgentClient)) } From 665d882769b7a5627d7d9d908059c2e1373e476f Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 21 Dec 2022 17:53:57 -0500 Subject: [PATCH 14/43] allow for routing from gateway to agent --- pkg/apis/stream/v1/stream.pb.go | 10 ++-- pkg/apis/stream/v1/stream.proto | 4 ++ pkg/gateway/gateway.go | 2 +- .../apis/apiextensions/stream/plugin.go | 1 - plugins/metrics/pkg/agent/http.go | 46 +++++++++++-------- plugins/metrics/pkg/agent/node.go | 16 ++++--- plugins/metrics/pkg/agent/runner.go | 4 +- plugins/metrics/pkg/agent/stream.go | 22 +++------ 8 files changed, 56 insertions(+), 49 deletions(-) diff --git a/pkg/apis/stream/v1/stream.pb.go b/pkg/apis/stream/v1/stream.pb.go index a8a4642f4a..526cd55da1 100644 --- a/pkg/apis/stream/v1/stream.pb.go +++ b/pkg/apis/stream/v1/stream.pb.go @@ -336,7 +336,7 @@ var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byt 0x43, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x82, 0x01, 0x0a, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x8a, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, @@ -345,10 +345,10 @@ var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byt 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0x8a, 0xf1, 0x04, 0x02, 0x08, - 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x1a, 0x06, 0x92, 0xf1, 0x04, 0x02, 0x08, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, + 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/apis/stream/v1/stream.proto b/pkg/apis/stream/v1/stream.proto index 8ac87b7ccf..4b48207422 100644 --- a/pkg/apis/stream/v1/stream.proto +++ b/pkg/apis/stream/v1/stream.proto @@ -26,6 +26,10 @@ message StreamEvent { } service Delegate { + option (totem.visibility) = { + splicedClients: true + }; + // A synchronous request-response RPC sent to a single client. rpc Request(DelegatedMessage) returns (totem.RPC); diff --git a/pkg/gateway/gateway.go b/pkg/gateway/gateway.go index f4470fd8bc..13617d332f 100644 --- a/pkg/gateway/gateway.go +++ b/pkg/gateway/gateway.go @@ -207,7 +207,7 @@ func NewGateway(ctx context.Context, conf *config.GatewayConfig, pl plugins.Load streamSvc := NewStreamServer(agentHandler, storageBackend, lg) controlv1.RegisterHealthListenerServer(streamSvc, listener) - streamv1.RegisterDelegateServer(grpcServer, delegate) + streamv1.RegisterDelegateServer(streamSvc, delegate) streamv1.RegisterStreamServer(grpcServer, streamSvc) controlv1.RegisterPluginSyncServer(grpcServer, syncServer) diff --git a/pkg/plugins/apis/apiextensions/stream/plugin.go b/pkg/plugins/apis/apiextensions/stream/plugin.go index 1db61c4ab0..e489d41c63 100644 --- a/pkg/plugins/apis/apiextensions/stream/plugin.go +++ b/pkg/plugins/apis/apiextensions/stream/plugin.go @@ -68,7 +68,6 @@ func (p *streamApiExtensionPlugin) GRPCServer( ) error { apiextensions.RegisterStreamAPIExtensionServer(s, p.extensionSrv) streamv1.RegisterStreamServer(s, p.extensionSrv) - streamv1.RegisterDelegateServer(s, p.extensionSrv) return nil } diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index 6b288ddba4..131df7e51b 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -34,7 +34,7 @@ type HttpServer struct { remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] targetRunnerMu sync.RWMutex - targetRunner clients.Locker[TargetRunner] + targetRunner TargetRunner conditions health.ConditionTracker @@ -71,11 +71,19 @@ func (s *HttpServer) SetRemoteReadClient(client clients.Locker[remoteread.Remote s.remoteReadClient = client } -func (s *HttpServer) SetTargetRunner(runner clients.Locker[TargetRunner]) { +func (s *HttpServer) SetTargetRunner(runner TargetRunner) { s.targetRunnerMu.Lock() defer s.targetRunnerMu.Unlock() s.targetRunner = runner + + s.remoteReadClientMu.RLock() + s.targetRunner.SetRemoteReadClient(s.remoteReadClient) + s.remoteReadClientMu.RUnlock() + + s.remoteWriteClientMu.RLock() + s.targetRunner.SetRemoteWriteClient(s.remoteWriteClient) + s.remoteWriteClientMu.RUnlock() } func (s *HttpServer) ConfigureRoutes(router *gin.Engine) { @@ -160,6 +168,7 @@ func (s *HttpServer) handleMetricPushRequest(c *gin.Context) { } func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { + s.logger.Debugf("received http start") if !s.enabled.Load() { c.Status(http.StatusServiceUnavailable) return @@ -178,19 +187,20 @@ func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { return } - s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Start(request.Target, request.Query); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } + s.targetRunnerMu.Lock() + defer s.targetRunnerMu.Unlock() + if err := s.targetRunner.Start(request.Target, request.Query); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } - c.Status(http.StatusOK) - }) + c.Status(http.StatusOK) } func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { + s.logger.Debugf("received http stop") if !s.enabled.Load() { c.Status(http.StatusServiceUnavailable) return @@ -209,13 +219,13 @@ func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { return } - s.targetRunner.Use(func(runner TargetRunner) { - if err := runner.Stop(request.Meta.Name); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } + s.targetRunnerMu.Lock() + defer s.targetRunnerMu.Unlock() + if err := s.targetRunner.Stop(request.Meta.Name); err != nil { + c.Status(http.StatusBadRequest) + c.Error(err) + return + } - c.Status(http.StatusOK) - }) + c.Status(http.StatusOK) } diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 789f18f267..67bfd27634 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -169,8 +169,8 @@ func (m *MetricsNode) GetHealth(_ context.Context, _ *emptypb.Empty) (*corev1.He // Start Implements remoteread.RemoteReadServer func (m *MetricsNode) UpdateTargetStatus(ctx context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() + //m.remoteReadClientMu.Lock() + //defer m.remoteReadClientMu.Unlock() if m.remoteReadClient == nil { m.logger.Errorf("no remote read client doing nothing") @@ -181,8 +181,10 @@ func (m *MetricsNode) UpdateTargetStatus(ctx context.Context, request *remoterea } func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() + //m.remoteReadClientMu.Lock() + //defer m.remoteReadClientMu.Unlock() + + m.logger.Debug("received grpc start") if m.remoteReadClient == nil { m.logger.Errorf("no remote read client doing nothing") @@ -193,8 +195,10 @@ func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRe } func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() + //m.remoteReadClientMu.Lock() + //defer m.remoteReadClientMu.Unlock() + + m.logger.Debug("received grpc stop") if m.remoteReadClient == nil { m.logger.Errorf("no remote read client doing nothing") diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 7620b9b49a..f5989fdaac 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -123,11 +123,11 @@ type targetRunner struct { } func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { - //runner.remoteWriteClient = client + runner.remoteWriteClient = client } func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) { - //runner.remoteReadClient = client + runner.remoteReadClient = client } // updateRunStatus notifies the gateway of the status of the Run's target status diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index c4e11064a5..da718a6a76 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -25,28 +25,18 @@ func (p *Plugin) StreamServers() []streamext.Server { } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { - runner := clients.NewLocker(cc, func(_ grpc.ClientConnInterface) TargetRunner { - runner := NewTargetRunner(p.logger.Named("remote-read")) - - runner.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) - runner.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) - - return runner - }) + runner := NewTargetRunner(p.logger.Named("runner")) + nodeClient := node.NewNodeMetricsCapabilityClient(cc) + healthListenerClient := controlv1.NewHealthListenerClient(cc) + identityClient := controlv1.NewIdentityClient(cc) p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) - p.httpServer.SetTargetRunner(runner) p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) - + p.httpServer.SetTargetRunner(runner) p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) - nodeClient := node.NewNodeMetricsCapabilityClient(cc) - healthListenerClient := controlv1.NewHealthListenerClient(cc) - identityClient := controlv1.NewIdentityClient(cc) - remoteReadClient := remoteread.NewRemoteReadGatewayClient(cc) - p.node.SetNodeClient(nodeClient) p.node.SetHealthListenerClient(healthListenerClient) p.node.SetIdentityClient(identityClient) - p.node.SetRemoteReadClient(remoteReadClient) + p.node.SetRemoteReadClient(remoteread.NewRemoteReadGatewayClient(cc)) } From 00af040418a4762c887819e135b6702d6602144a Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 22 Dec 2022 16:33:36 -0500 Subject: [PATCH 15/43] agent target optimizations --- pkg/opni/commands/import.go | 4 +- .../apis/apiextensions/stream/plugin.go | 12 -- plugins/metrics/pkg/agent/http.go | 156 +++++++++--------- plugins/metrics/pkg/agent/node.go | 59 +++---- plugins/metrics/pkg/agent/runner.go | 82 ++++----- plugins/metrics/pkg/agent/stream.go | 5 +- .../pkg/apis/remoteread/remoteread.pb.go | 94 +++++------ .../pkg/apis/remoteread/remoteread.proto | 5 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 92 ++++------- plugins/metrics/pkg/backend/metrics.go | 35 ++-- 10 files changed, 231 insertions(+), 313 deletions(-) diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index bf00b38eb2..2236134fb1 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -243,7 +243,9 @@ func BuildImportStartCmd() *cobra.Command { ForceOverlap: forceOverlap, } - if _, err := remoteReadClient.Start(cmd.Context(), request); err != nil { + //ctx, _ := context.WithTimeout(cmd.Context(), time.Second) + ctx := cmd.Context() + if _, err := remoteReadClient.Start(ctx, request); err != nil { return err } diff --git a/pkg/plugins/apis/apiextensions/stream/plugin.go b/pkg/plugins/apis/apiextensions/stream/plugin.go index e489d41c63..54120986c4 100644 --- a/pkg/plugins/apis/apiextensions/stream/plugin.go +++ b/pkg/plugins/apis/apiextensions/stream/plugin.go @@ -125,7 +125,6 @@ func NewPlugin(p StreamAPIExtension) plugin.Plugin { type streamExtensionServerImpl struct { streamv1.UnsafeStreamServer - streamv1.UnsafeDelegateServer name string apiextensions.UnimplementedStreamAPIExtensionServer @@ -247,17 +246,6 @@ func (e *streamExtensionServerImpl) Notify(ctx context.Context, event *streamv1. return &emptypb.Empty{}, nil } -// Implements streamv1.DelegateServer -func (e *streamExtensionServerImpl) Request(ctx context.Context, message *streamv1.DelegatedMessage) (*totem.RPC, error) { - //TODO implement me - panic("implement me") -} - -func (e *streamExtensionServerImpl) Broadcast(ctx context.Context, message *streamv1.BroadcastMessage) (*emptypb.Empty, error) { - //TODO implement me - panic("implement me") -} - // func (e *mgmtExtensionServerImpl) Services(context.Context, *emptypb.Empty) (*apiextensions.ServiceDescriptorList, error) { // list := []*apiextensions.ServiceDescriptor{} // for _, srv := range e.servers { diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index 131df7e51b..842e01e24a 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -3,7 +3,6 @@ package agent import ( "errors" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" - "google.golang.org/protobuf/proto" "net/http" "strings" "sync" @@ -33,9 +32,6 @@ type HttpServer struct { remoteReadClientMu sync.RWMutex remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] - targetRunnerMu sync.RWMutex - targetRunner TargetRunner - conditions health.ConditionTracker enabled atomic.Bool @@ -72,26 +68,26 @@ func (s *HttpServer) SetRemoteReadClient(client clients.Locker[remoteread.Remote } func (s *HttpServer) SetTargetRunner(runner TargetRunner) { - s.targetRunnerMu.Lock() - defer s.targetRunnerMu.Unlock() - - s.targetRunner = runner - - s.remoteReadClientMu.RLock() - s.targetRunner.SetRemoteReadClient(s.remoteReadClient) - s.remoteReadClientMu.RUnlock() - - s.remoteWriteClientMu.RLock() - s.targetRunner.SetRemoteWriteClient(s.remoteWriteClient) - s.remoteWriteClientMu.RUnlock() + //s.targetRunnerMu.Lock() + //defer s.targetRunnerMu.Unlock() + // + //s.targetRunner = runner + // + //s.remoteReadClientMu.RLock() + //s.targetRunner.SetRemoteReadClient(s.remoteReadClient) + //s.remoteReadClientMu.RUnlock() + // + //s.remoteWriteClientMu.RLock() + //s.targetRunner.SetRemoteWriteClient(s.remoteWriteClient) + //s.remoteWriteClientMu.RUnlock() } func (s *HttpServer) ConfigureRoutes(router *gin.Engine) { router.POST("/api/agent/push", s.handleMetricPushRequest) pprof.Register(router, "/debug/plugin_metrics/pprof") - router.GET("/api/remoteread/start", s.handleRemoteReadStart) - router.GET("/api/remoteread/stop", s.handleRemoteReadStop) + //router.GET("/api/remoteread/start", s.handleRemoteReadStart) + //router.GET("/api/remoteread/stop", s.handleRemoteReadStop) } func (s *HttpServer) handleMetricPushRequest(c *gin.Context) { @@ -167,65 +163,65 @@ func (s *HttpServer) handleMetricPushRequest(c *gin.Context) { } } -func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { - s.logger.Debugf("received http start") - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - buf := bytebufferpool.Get() - if _, err := buf.ReadFrom(c.Request.Body); err != nil { - c.Status(http.StatusInternalServerError) - return - } - - var request remoteread.StartReadRequest - if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - s.targetRunnerMu.Lock() - defer s.targetRunnerMu.Unlock() - if err := s.targetRunner.Start(request.Target, request.Query); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - c.Status(http.StatusOK) - -} - -func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { - s.logger.Debugf("received http stop") - if !s.enabled.Load() { - c.Status(http.StatusServiceUnavailable) - return - } - - buf := bytebufferpool.Get() - if _, err := buf.ReadFrom(c.Request.Body); err != nil { - c.Status(http.StatusInternalServerError) - return - } - - var request remoteread.StopReadRequest - if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - s.targetRunnerMu.Lock() - defer s.targetRunnerMu.Unlock() - if err := s.targetRunner.Stop(request.Meta.Name); err != nil { - c.Status(http.StatusBadRequest) - c.Error(err) - return - } - - c.Status(http.StatusOK) -} +//func (s *HttpServer) handleRemoteReadStart(c *gin.Context) { +// s.logger.Debugf("received http start") +// if !s.enabled.Load() { +// c.Status(http.StatusServiceUnavailable) +// return +// } +// +// buf := bytebufferpool.Get() +// if _, err := buf.ReadFrom(c.Request.Body); err != nil { +// c.Status(http.StatusInternalServerError) +// return +// } +// +// var request remoteread.StartReadRequest +// if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { +// c.Status(http.StatusBadRequest) +// c.Error(err) +// return +// } +// +// s.targetRunnerMu.Lock() +// defer s.targetRunnerMu.Unlock() +// if err := s.targetRunner.Start(request.Target, request.Query); err != nil { +// c.Status(http.StatusBadRequest) +// c.Error(err) +// return +// } +// +// c.Status(http.StatusOK) +// +//} +// +//func (s *HttpServer) handleRemoteReadStop(c *gin.Context) { +// s.logger.Debugf("received http stop") +// if !s.enabled.Load() { +// c.Status(http.StatusServiceUnavailable) +// return +// } +// +// buf := bytebufferpool.Get() +// if _, err := buf.ReadFrom(c.Request.Body); err != nil { +// c.Status(http.StatusInternalServerError) +// return +// } +// +// var request remoteread.StopReadRequest +// if err := proto.Unmarshal(buf.Bytes(), &request); err != nil { +// c.Status(http.StatusBadRequest) +// c.Error(err) +// return +// } +// +// s.targetRunnerMu.Lock() +// defer s.targetRunnerMu.Unlock() +// if err := s.targetRunner.Stop(request.Meta.Name); err != nil { +// c.Status(http.StatusBadRequest) +// c.Error(err) +// return +// } +// +// c.Status(http.StatusOK) +//} diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 67bfd27634..d33bf5d7e9 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -42,8 +42,8 @@ type MetricsNode struct { healthListenerClientMu sync.RWMutex healthListenerClient controlv1.HealthListenerClient - remoteReadClientMu sync.RWMutex - remoteReadClient remoteread.RemoteReadGatewayClient + targetRunnerMu sync.RWMutex + targetRunner TargetRunner configMu sync.RWMutex config *node.MetricsCapabilityConfig @@ -54,8 +54,9 @@ type MetricsNode struct { func NewMetricsNode(ct health.ConditionTracker, lg *zap.SugaredLogger) *MetricsNode { node := &MetricsNode{ - logger: lg, - conditions: ct, + logger: lg, + conditions: ct, + targetRunner: NewTargetRunner(lg.Named("runner")), } node.conditions.AddListener(node.sendHealthUpdate) return node @@ -110,13 +111,6 @@ func (m *MetricsNode) SetHealthListenerClient(client controlv1.HealthListenerCli m.sendHealthUpdate() } -func (m *MetricsNode) SetRemoteReadClient(client remoteread.RemoteReadGatewayClient) { - m.remoteReadClientMu.Lock() - defer m.remoteReadClientMu.Unlock() - - m.remoteReadClient = client -} - func (m *MetricsNode) Info(_ context.Context, _ *emptypb.Empty) (*capabilityv1.Details, error) { return &capabilityv1.Details{ Name: wellknown.CapabilityMetrics, @@ -168,44 +162,39 @@ func (m *MetricsNode) GetHealth(_ context.Context, _ *emptypb.Empty) (*corev1.He // Start Implements remoteread.RemoteReadServer -func (m *MetricsNode) UpdateTargetStatus(ctx context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { - //m.remoteReadClientMu.Lock() - //defer m.remoteReadClientMu.Unlock() +func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { + m.targetRunnerMu.Lock() + defer m.targetRunnerMu.Unlock() - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + if err := m.targetRunner.Start(request.Target, request.Query); err != nil { + return nil, err } - return m.remoteReadClient.UpdateTargetStatus(ctx, request) + return &emptypb.Empty{}, nil } -func (m *MetricsNode) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - //m.remoteReadClientMu.Lock() - //defer m.remoteReadClientMu.Unlock() - - m.logger.Debug("received grpc start") +func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { + m.targetRunnerMu.Lock() + defer m.targetRunnerMu.Unlock() - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + if err := m.targetRunner.Stop(request.Meta.Name); err != nil { + return nil, err } - return m.remoteReadClient.Start(ctx, request) + return &emptypb.Empty{}, nil } -func (m *MetricsNode) Stop(ctx context.Context, request *remoteread.StopReadRequest) (*emptypb.Empty, error) { - //m.remoteReadClientMu.Lock() - //defer m.remoteReadClientMu.Unlock() +func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { + m.targetRunnerMu.RLock() + defer m.targetRunnerMu.RUnlock() - m.logger.Debug("received grpc stop") + status, err := m.targetRunner.GetStatus(request.Meta.Name) - if m.remoteReadClient == nil { - m.logger.Errorf("no remote read client doing nothing") - return &emptypb.Empty{}, fmt.Errorf("no remote read client doing nothing") + if err != nil { + return nil, err } - return m.remoteReadClient.Stop(ctx, request) + return status, nil } func (m *MetricsNode) doSync(ctx context.Context) { diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index f5989fdaac..fb9dd28cf5 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -100,9 +100,9 @@ type TargetRunner interface { Stop(name string) error - SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) + GetStatus(name string) (*remoteread.TargetStatus, error) - SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) + SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) } func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { @@ -130,34 +130,11 @@ func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread runner.remoteReadClient = client } -// updateRunStatus notifies the gateway of the status of the Run's target status -func (runner *targetRunner) updateRunStatus(run Run) { - runner.remoteReadClient.Use(func(client remoteread.RemoteReadGatewayClient) { - newStatus := run.target.Status - - request := &remoteread.TargetStatusUpdateRequest{ - Meta: run.target.Meta, - NewStatus: newStatus, - } - - _, err := client.UpdateTargetStatus(context.TODO(), request) - - if err != nil { - runner.logger.Errorf("failed to push status to server: %s", err) - } - }) -} - func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { runner.runsMu.Lock() runner.runs[run.target.Meta.Name] = run runner.runsMu.Unlock() - run.target.Status.Progress = &remoteread.TargetProgress{ - StartTimestamp: run.query.StartTimestamp, - EndTimestamp: run.query.EndTimestamp, - } - labelMatchers := toLabelMatchers(run.query.Matchers) // todo: this should probably be more sophisticated than this to handle read size limits @@ -167,8 +144,26 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) nextStart := run.query.StartTimestamp.AsTime().UnixMilli() nextEnd := nextStart - run.running() - runner.updateRunStatus(run) + run.target.Status = &remoteread.TargetStatus{ + Progress: &remoteread.TargetProgress{ + StartTimestamp: run.query.StartTimestamp, + EndTimestamp: run.query.EndTimestamp, + }, + Message: "", + State: remoteread.TargetStatus_Running, + } + + defer func() { + // todo: defer this stuff + if run.target.Status.State == remoteread.TargetStatus_Running { + runner.logger.With( + "cluster", run.target.Meta.ClusterId, + "target", run.target.Meta.Name, + ).Infof("run completed") + + run.complete() + } + }() for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { nextStart = nextEnd @@ -191,7 +186,6 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) if err != nil { run.failed(fmt.Sprintf("failed to read from target endpoint: %s", err.Error())) - runner.updateRunStatus(run) return } @@ -207,7 +201,6 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) uncompressed, err := proto.Marshal(&writeRequest) if err != nil { run.failed(fmt.Sprintf("failed to uncompress data from target endpoint: %s", err.Error())) - runner.updateRunStatus(run) return } @@ -220,12 +213,10 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { run.failed("failed to push to remote write") - runner.updateRunStatus(run) return } run.updateLastRead(nextEnd) - runner.updateRunStatus(run) }) runner.logger.With( @@ -235,23 +226,7 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) } run.updateLastRead(nextEnd) - runner.updateRunStatus(run) - } - - if run.target.Status.State == remoteread.TargetStatus_Running { - runner.logger.With( - "cluster", run.target.Meta.ClusterId, - "target", run.target.Meta.Name, - ).Infof("run completed") - - run.complete() - runner.updateRunStatus(run) } - - runner.runsMu.Lock() - defer runner.runsMu.Unlock() - - delete(runner.runs, run.target.Meta.Name) } func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Query) error { @@ -308,7 +283,6 @@ func (runner *targetRunner) Stop(name string) error { delete(runner.runs, name) run.stopped() - runner.updateRunStatus(run) runner.logger.With( "cluster", run.target.Meta.ClusterId, @@ -317,3 +291,15 @@ func (runner *targetRunner) Stop(name string) error { return nil } + +func (runner *targetRunner) GetStatus(name string) (*remoteread.TargetStatus, error) { + runner.runsMu.Lock() + run, found := runner.runs[name] + runner.runsMu.Unlock() + + if !found { + return nil, targetIsNotRunningError(name) + } + + return run.target.Status, nil +} diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index da718a6a76..f11146853a 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -25,18 +25,17 @@ func (p *Plugin) StreamServers() []streamext.Server { } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { - runner := NewTargetRunner(p.logger.Named("runner")) + //runner := NewTargetRunner(p.logger.Named("runner")) nodeClient := node.NewNodeMetricsCapabilityClient(cc) healthListenerClient := controlv1.NewHealthListenerClient(cc) identityClient := controlv1.NewIdentityClient(cc) p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) - p.httpServer.SetTargetRunner(runner) + //p.httpServer.SetTargetRunner(runner) p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) p.node.SetNodeClient(nodeClient) p.node.SetHealthListenerClient(healthListenerClient) p.node.SetIdentityClient(identityClient) - p.node.SetRemoteReadClient(remoteread.NewRemoteReadGatewayClient(cc)) } diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 4174a43ddc..3a6c7d9e47 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -1282,7 +1282,7 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xc9, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, + 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xf4, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, @@ -1301,11 +1301,20 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xdb, 0x01, 0x0a, 0x0f, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, @@ -1313,31 +1322,16 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x53, 0x0a, 0x12, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x32, 0xe2, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x53, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, + 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1408,26 +1402,24 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 10, // 26: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest 11, // 27: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest 12, // 28: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest - 15, // 29: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest - 13, // 30: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest - 14, // 31: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest - 16, // 32: remoteread.RemoteReadGateway.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest - 13, // 33: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest - 14, // 34: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest - 16, // 35: remoteread.RemoteReadAgent.UpdateTargetStatus:input_type -> remoteread.TargetStatusUpdateRequest - 21, // 36: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty - 21, // 37: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty - 21, // 38: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty - 7, // 39: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList - 4, // 40: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus - 21, // 41: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty - 21, // 42: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty - 21, // 43: remoteread.RemoteReadGateway.UpdateTargetStatus:output_type -> google.protobuf.Empty - 21, // 44: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty - 21, // 45: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty - 21, // 46: remoteread.RemoteReadAgent.UpdateTargetStatus:output_type -> google.protobuf.Empty - 36, // [36:47] is the sub-list for method output_type - 25, // [25:36] is the sub-list for method input_type + 13, // 29: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 14, // 30: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 15, // 31: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 13, // 32: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest + 14, // 33: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest + 15, // 34: remoteread.RemoteReadAgent.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 21, // 35: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 21, // 36: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 21, // 37: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 7, // 38: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 21, // 39: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty + 21, // 40: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty + 4, // 41: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus + 21, // 42: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 21, // 43: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 4, // 44: remoteread.RemoteReadAgent.GetTargetStatus:output_type -> remoteread.TargetStatus + 35, // [35:45] is the sub-list for method output_type + 25, // [25:35] is the sub-list for method input_type 25, // [25:25] is the sub-list for extension type_name 25, // [25:25] is the sub-list for extension extendee 0, // [0:25] is the sub-list for field type_name diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index ae4ac191e9..9af94bd4e8 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -18,17 +18,16 @@ service RemoteReadGateway { rpc EditTarget(TargetEditRequest) returns (google.protobuf.Empty); rpc RemoveTarget(TargetRemoveRequest) returns (google.protobuf.Empty); rpc ListTargets(TargetListRequest) returns (TargetList); - rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); - rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); + rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); } service RemoteReadAgent { rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); - rpc UpdateTargetStatus(TargetStatusUpdateRequest) returns (google.protobuf.Empty); + rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); } message Target { diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index c84bcb2e44..59c3f70b2c 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -27,10 +27,9 @@ type RemoteReadGatewayClient interface { EditTarget(ctx context.Context, in *TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) RemoveTarget(ctx context.Context, in *TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) ListTargets(ctx context.Context, in *TargetListRequest, opts ...grpc.CallOption) (*TargetList, error) - GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) } type remoteReadGatewayClient struct { @@ -77,15 +76,6 @@ func (c *remoteReadGatewayClient) ListTargets(ctx context.Context, in *TargetLis return out, nil } -func (c *remoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) { - out := new(TargetStatus) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/GetTargetStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *remoteReadGatewayClient) Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Start", in, out, opts...) @@ -104,9 +94,9 @@ func (c *remoteReadGatewayClient) Stop(ctx context.Context, in *StopReadRequest, return out, nil } -func (c *remoteReadGatewayClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/UpdateTargetStatus", in, out, opts...) +func (c *remoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) { + out := new(TargetStatus) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/GetTargetStatus", in, out, opts...) if err != nil { return nil, err } @@ -121,10 +111,9 @@ type RemoteReadGatewayServer interface { EditTarget(context.Context, *TargetEditRequest) (*emptypb.Empty, error) RemoveTarget(context.Context, *TargetRemoveRequest) (*emptypb.Empty, error) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) - GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) - UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) + GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) mustEmbedUnimplementedRemoteReadGatewayServer() } @@ -144,17 +133,14 @@ func (UnimplementedRemoteReadGatewayServer) RemoveTarget(context.Context, *Targe func (UnimplementedRemoteReadGatewayServer) ListTargets(context.Context, *TargetListRequest) (*TargetList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListTargets not implemented") } -func (UnimplementedRemoteReadGatewayServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") -} func (UnimplementedRemoteReadGatewayServer) Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } func (UnimplementedRemoteReadGatewayServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } -func (UnimplementedRemoteReadGatewayServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") +func (UnimplementedRemoteReadGatewayServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") } func (UnimplementedRemoteReadGatewayServer) mustEmbedUnimplementedRemoteReadGatewayServer() {} @@ -241,24 +227,6 @@ func _RemoteReadGateway_ListTargets_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _RemoteReadGateway_GetTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TargetStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/remoteread.RemoteReadGateway/GetTargetStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, req.(*TargetStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _RemoteReadGateway_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartReadRequest) if err := dec(in); err != nil { @@ -295,20 +263,20 @@ func _RemoteReadGateway_Stop_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _RemoteReadGateway_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TargetStatusUpdateRequest) +func _RemoteReadGateway_GetTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, in) + return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteReadGateway/UpdateTargetStatus", + FullMethod: "/remoteread.RemoteReadGateway/GetTargetStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadGatewayServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) + return srv.(RemoteReadGatewayServer).GetTargetStatus(ctx, req.(*TargetStatusRequest)) } return interceptor(ctx, in, info, handler) } @@ -336,10 +304,6 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListTargets", Handler: _RemoteReadGateway_ListTargets_Handler, }, - { - MethodName: "GetTargetStatus", - Handler: _RemoteReadGateway_GetTargetStatus_Handler, - }, { MethodName: "Start", Handler: _RemoteReadGateway_Start_Handler, @@ -349,8 +313,8 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ Handler: _RemoteReadGateway_Stop_Handler, }, { - MethodName: "UpdateTargetStatus", - Handler: _RemoteReadGateway_UpdateTargetStatus_Handler, + MethodName: "GetTargetStatus", + Handler: _RemoteReadGateway_GetTargetStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -363,7 +327,7 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ type RemoteReadAgentClient interface { Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) } type remoteReadAgentClient struct { @@ -392,9 +356,9 @@ func (c *remoteReadAgentClient) Stop(ctx context.Context, in *StopReadRequest, o return out, nil } -func (c *remoteReadAgentClient) UpdateTargetStatus(ctx context.Context, in *TargetStatusUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/UpdateTargetStatus", in, out, opts...) +func (c *remoteReadAgentClient) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) { + out := new(TargetStatus) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/GetTargetStatus", in, out, opts...) if err != nil { return nil, err } @@ -407,7 +371,7 @@ func (c *remoteReadAgentClient) UpdateTargetStatus(ctx context.Context, in *Targ type RemoteReadAgentServer interface { Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) - UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) + GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) mustEmbedUnimplementedRemoteReadAgentServer() } @@ -421,8 +385,8 @@ func (UnimplementedRemoteReadAgentServer) Start(context.Context, *StartReadReque func (UnimplementedRemoteReadAgentServer) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } -func (UnimplementedRemoteReadAgentServer) UpdateTargetStatus(context.Context, *TargetStatusUpdateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTargetStatus not implemented") +func (UnimplementedRemoteReadAgentServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") } func (UnimplementedRemoteReadAgentServer) mustEmbedUnimplementedRemoteReadAgentServer() {} @@ -473,20 +437,20 @@ func _RemoteReadAgent_Stop_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _RemoteReadAgent_UpdateTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TargetStatusUpdateRequest) +func _RemoteReadAgent_GetTargetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TargetStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RemoteReadAgentServer).UpdateTargetStatus(ctx, in) + return srv.(RemoteReadAgentServer).GetTargetStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/remoteread.RemoteReadAgent/UpdateTargetStatus", + FullMethod: "/remoteread.RemoteReadAgent/GetTargetStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteReadAgentServer).UpdateTargetStatus(ctx, req.(*TargetStatusUpdateRequest)) + return srv.(RemoteReadAgentServer).GetTargetStatus(ctx, req.(*TargetStatusRequest)) } return interceptor(ctx, in, info, handler) } @@ -507,8 +471,8 @@ var RemoteReadAgent_ServiceDesc = grpc.ServiceDesc{ Handler: _RemoteReadAgent_Stop_Handler, }, { - MethodName: "UpdateTargetStatus", - Handler: _RemoteReadAgent_UpdateTargetStatus_Handler, + MethodName: "GetTargetStatus", + Handler: _RemoteReadAgent_GetTargetStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 988d081874..a8160bf56b 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -46,6 +46,7 @@ type MetricsBackend struct { desiredNodeSpecMu sync.RWMutex desiredNodeSpec map[string]*node.MetricsCapabilitySpec + // todo: we probably want to use a storage rather than a simple map to allow for HA remoteReadTargetMu sync.RWMutex remoteReadTargets map[string]*remoteread.Target @@ -443,6 +444,8 @@ func getIdFromTargetMeta(meta *remoteread.TargetMeta) string { } func (m *MetricsBackend) AddTarget(_ context.Context, request *remoteread.TargetAddRequest) (*emptypb.Empty, error) { + m.WaitForInit() + m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() @@ -560,6 +563,7 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ func (m *MetricsBackend) GetTargetStatus(_ context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { m.WaitForInit() + // todo: need to query agent m.remoteReadTargetMu.Lock() defer m.remoteReadTargetMu.Unlock() @@ -573,32 +577,31 @@ func (m *MetricsBackend) GetTargetStatus(_ context.Context, request *remoteread. return target.Status, nil } -func (m *MetricsBackend) UpdateTargetStatus(_ context.Context, request *remoteread.TargetStatusUpdateRequest) (*emptypb.Empty, error) { +func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - m.remoteReadTargetMu.Lock() - defer m.remoteReadTargetMu.Unlock() + // todo: delete after debugging circular communication stuff + //request.Query.Matchers[0].Name = "debugging" - targetId := getIdFromTargetMeta(request.Meta) + if m.Delegate == nil { + return nil, fmt.Errorf("encountered nil delegate") + } + // agent needs the full target but cli will ony have access to remoteread.TargetMeta values (clusterId, name, etc) + // so we need to replace the naive request target + targetId := getIdFromTargetMeta(request.Target.Meta) + + m.remoteReadTargetMu.Lock() target, found := m.remoteReadTargets[targetId] + m.remoteReadTargetMu.Unlock() + if !found { return nil, targetDoesNotExistError(targetId) } - target.Status = request.NewStatus - - return &emptypb.Empty{}, nil -} - -func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { - m.WaitForInit() - - if m.Delegate == nil { - return nil, fmt.Errorf("encountered nil delegate") - } + request.Target = target - _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Target.Meta.ClusterId}).Start(ctx, request) + _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Target.Meta.ClusterId}).Start(context.TODO(), request) if err != nil { m.Logger.With( From de9518c2775f84110799cbe0c68dc34c31ef293b Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 15:08:06 -0500 Subject: [PATCH 16/43] add target discovery # Conflicts: # go.mod # go.sum --- go.mod | 17 +- go.sum | 146 +++++- pkg/opni/commands/import.go | 38 +- pkg/opni/util/render.go | 14 + plugins/metrics/pkg/agent/discovery.go | 81 ++++ plugins/metrics/pkg/agent/node.go | 36 +- plugins/metrics/pkg/agent/remoteread.go | 3 + plugins/metrics/pkg/agent/runner.go | 3 + .../pkg/apis/remoteread/remoteread.pb.go | 417 ++++++++++++++---- .../pkg/apis/remoteread/remoteread.proto | 24 +- .../pkg/apis/remoteread/remoteread_grpc.pb.go | 72 +++ plugins/metrics/pkg/backend/metrics.go | 90 +++- 12 files changed, 809 insertions(+), 132 deletions(-) create mode 100644 plugins/metrics/pkg/agent/discovery.go diff --git a/go.mod b/go.mod index 64c744931f..85cc0d0fcb 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,8 @@ require ( github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/pkg/errors v0.9.1 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.63.0 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.63.0 github.com/prometheus/alertmanager v0.25.0 github.com/prometheus/client_golang v1.14.0 github.com/prometheus/client_model v0.3.0 @@ -154,11 +155,9 @@ require ( require ( cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/bigtable v1.3.0 // indirect cloud.google.com/go/compute v1.14.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.8.0 // indirect - cloud.google.com/go/longrunning v0.3.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect github.com/AlekSi/pointer v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect @@ -220,7 +219,6 @@ require ( github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.4.0 // indirect github.com/cppforlife/go-patch v0.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect @@ -241,7 +239,7 @@ require ( github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/efficientgo/core v1.0.0-rc.2 // indirect github.com/elliotchance/orderedmap v1.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/emicklei/go-restful/v3 v3.10.1 // indirect github.com/emicklei/proto v1.6.15 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect @@ -265,8 +263,8 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/errors v0.20.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/runtime v0.25.0 // indirect github.com/go-openapi/spec v0.20.7 // indirect @@ -448,7 +446,6 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/ulikunitz/xz v0.5.10 // indirect - github.com/urfave/cli v1.22.5 // indirect github.com/vimeo/galaxycache v0.0.0-20210323154928-b7e5d71c067a // indirect github.com/wayneashleyberry/terminal-dimensions v1.0.0 // indirect github.com/weaveworks/promrus v1.2.0 // indirect @@ -498,8 +495,8 @@ require ( helm.sh/helm/v3 v3.10.3 // indirect howett.net/plist v1.0.0 // indirect k8s.io/apiserver v0.26.1 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 // indirect + k8s.io/klog/v2 v2.90.0 // indirect + k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 // indirect lukechampine.com/frand v1.4.2 // indirect oras.land/oras-go v1.2.0 // indirect sigs.k8s.io/gateway-api v0.6.0 // indirect diff --git a/go.sum b/go.sum index b17a729f3f..cf03079e81 100644 --- a/go.sum +++ b/go.sum @@ -45,7 +45,6 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/bigtable v1.3.0/go.mod h1:z5EyKrPE8OQmeg4h5MNdKvuSnI9CCT49Ki3f23aBzio= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -64,7 +63,6 @@ cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -436,6 +434,7 @@ github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOo github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.18/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -449,6 +448,7 @@ github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= @@ -462,6 +462,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/apd/v2 v2.0.1 h1:y1Rh3tEU89D+7Tgbw+lp52T6p/GJLpDmNvr10UWqLTE= github.com/cockroachdb/apd/v2 v2.0.1/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= @@ -470,8 +472,11 @@ github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1 github.com/cockroachdb/cockroach-go v0.0.0-20200312223839-f565e4789405/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4 h1:Lap807SXTH5tri2TivECb/4abUkMZC9zRoLarvcKDqs= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= @@ -490,6 +495,7 @@ github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4S github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= +github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= @@ -602,15 +608,14 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cppforlife/go-patch v0.2.0 h1:Y14MnCQjDlbw7WXT4k+u6DPAA9XnygN4BfrSpI/19RU= github.com/cppforlife/go-patch v0.2.0/go.mod h1:67a7aIi94FHDZdoeGSJRRFDp66l9MhaAG1yGxpUoFD8= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= @@ -653,15 +658,22 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= +github.com/digitalocean/godo v1.91.1 h1:1o30VOCu1aC6488qBd0SkQiBeAZ35RSTvLwCA1pQMhc= +github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= +github.com/distribution/distribution/v3 v3.0.0-20220526142353-ffbd94cbe269 h1:hbCT8ZPPMqefiAWD2ZKjn7ypokIGViTvBBg/ExLSdCk= github.com/djherbis/times v1.2.0/go.mod h1:CGMZlo255K5r4Yw0b9RRfFQpM2y7uOmxg4jm9HsaVf8= +github.com/djherbis/times v1.5.0 h1:79myA211VwPhFTqUk8xehWrsEO+zcIZj0zT8mXPVARU= github.com/djherbis/times v1.5.0/go.mod h1:5q7FDLvbNg1L/KaBmPcWlVR9NmoKo3+ucqUA3ijQhA0= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= @@ -684,6 +696,7 @@ github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -692,6 +705,7 @@ github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -714,15 +728,18 @@ github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/efficientgo/core v1.0.0-rc.2 h1:7j62qHLnrZqO3V3UA0AqOGd5d5aXV3AX6m/NZBHp78I= github.com/efficientgo/core v1.0.0-rc.2/go.mod h1:FfGdkzWarkuzOlY04VY+bGfb1lWrjaL6x/GLcQ4vJps= +github.com/efficientgo/e2e v0.14.1-0.20230119090947-fa7ceb0197c5 h1:N1fHVcNEPMJNB93sxT6icl5yvoFxa2sp3/1NnVlrAFc= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5 h1:LCoguo7Zd0MByKMbQbTvcZw7HiBcbvew+MOcwsJVwrY= github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elliotchance/orderedmap v1.5.0 h1:1IsExUsjv5XNBD3ZdC7jkAAqLWOOKdbPTmkHx63OsBg= github.com/elliotchance/orderedmap v1.5.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= +github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/proto v1.6.15 h1:XbpwxmuOPrdES97FrSfpyy67SSCV/wBIKXqgJzh6hNw= github.com/emicklei/proto v1.6.15/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= @@ -739,8 +756,10 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGYvecuLB1HtdexY= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -779,6 +798,7 @@ github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -792,6 +812,7 @@ github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmx github.com/gabstv/go-bsdiff v1.0.5 h1:g29MC/38Eaig+iAobW10/CiFvPtin8U3Jj4yNLcNG9k= github.com/gabstv/go-bsdiff v1.0.5/go.mod h1:/Zz6GK+/f/TMylRtVaW3uwZlb0FZITILfA0q12XKGwg= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -804,6 +825,7 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY= github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8nfB398= +github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -823,6 +845,7 @@ github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= @@ -892,15 +915,17 @@ github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwds github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -951,6 +976,7 @@ github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbN github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y= github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -965,13 +991,18 @@ github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyh github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= @@ -1039,6 +1070,7 @@ github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.1/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk= github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= github.com/gobuffalo/genny v0.0.0-20180924032338-7af3a40f2252/go.mod h1:tUTQOogrr7tAQnhajMSH6rv1BVev34H2sa1xNHMy94g= github.com/gobuffalo/genny v0.0.0-20181003150629-3786a0744c5d/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM= @@ -1105,6 +1137,7 @@ github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw5 github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= +github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/makr v1.1.5/go.mod h1:Y+o0btAH1kYAMDJW/TX3+oAXEu0bmSLLoC9mIFxtzOw= github.com/gobuffalo/mapi v1.0.0/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= @@ -1144,6 +1177,7 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packd v0.2.0/go.mod h1:k2CkHP3bjbqL2GwxwhxUy1DgnlbW644hkLC9iIUvZwY= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= +github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= github.com/gobuffalo/packr v1.13.7/go.mod h1:KkinLIn/n6+3tVXMwg6KkNvWwVsrRAz4ph+jgpk3Z24= github.com/gobuffalo/packr v1.15.0/go.mod h1:t5gXzEhIviQwVlNx/+3SfS07GS+cZ2hn76WLzPp6MGI= @@ -1151,6 +1185,7 @@ github.com/gobuffalo/packr v1.15.1/go.mod h1:IeqicJ7jm8182yrVmNbM6PR4g79SjN9tZLH github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= github.com/gobuffalo/packr v1.20.0/go.mod h1:JDytk1t2gP+my1ig7iI4NcVaXr886+N0ecUga6884zw= github.com/gobuffalo/packr v1.21.0/go.mod h1:H00jGfj1qFKxscFJSw8wcL4hpQtPe1PfU2wa6sg/SR0= +github.com/gobuffalo/packr v1.22.0 h1:/YVd/GRGsu0QuoCJtlcWSVllobs4q3Xvx3nqxTvPyN0= github.com/gobuffalo/packr v1.22.0/go.mod h1:Qr3Wtxr3+HuQEwWqlLnNW4t1oTvK+7Gc/Rnoi/lDFvA= github.com/gobuffalo/packr/v2 v2.0.0-rc.8/go.mod h1:y60QCdzwuMwO2R49fdQhsjCPv7tLQFR0ayzxxla9zes= github.com/gobuffalo/packr/v2 v2.0.0-rc.9/go.mod h1:fQqADRfZpEsgkc7c/K7aMew3n4aF1Kji7+lIZeR98Fc= @@ -1166,6 +1201,7 @@ github.com/gobuffalo/packr/v2 v2.4.0/go.mod h1:ra341gygw9/61nSjAbfwcwh8IrYL4WmR4 github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobuffalo/packr/v2 v2.8.0/go.mod h1:PDk2k3vGevNE3SwVyVRgQCCXETC9SaONCNSXT1Q8M1g= +github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= github.com/gobuffalo/plush v3.7.16+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.20+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= @@ -1230,6 +1266,7 @@ github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGF github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/goccy/go-yaml v1.9.8 h1:5gMyLUeU1/6zl+WFfR1hN7D2kf+1/eRGa7DFtToiBvQ= github.com/goccy/go-yaml v1.9.8/go.mod h1:JubOolP3gh0HpiBc4BLRD4YmjEjHAmIIB2aaXKkTfoE= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= @@ -1241,6 +1278,7 @@ github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVH github.com/godror/godror v0.24.2/go.mod h1:wZv/9vPiUib6tkoDl+AZ/QLf5YZgMravZ7jxH2eQWAE= github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1323,6 +1361,7 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= +github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= @@ -1353,14 +1392,17 @@ github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt github.com/google/go-jsonnet v0.19.1 h1:MORxkrG0elylUqh36R4AcSPX0oZQa9hvI3lroN+kDhs= github.com/google/go-jsonnet v0.19.1/go.mod h1:5JVT33JVCoehdTj5Z2KJq1eIdt3Nb8PCmZ+W5D8U350= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -1412,11 +1454,13 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e h1:XmA6L9IPRdUr28a+SK/oMchGgQy159wvzXA5tJ7l+40= github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e/go.mod h1:AFIo+02s+12CEg8Gzz9kzhCbmbq6JcKNrhHffCGA9z4= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gophercloud/gophercloud v1.1.1 h1:MuGyqbSxiuVBqkPZ3+Nhbytk1xZxhmfCB2Rg1cJWFWM= github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -1458,6 +1502,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1 h1:/sDbPb60SusIXjiJGYLUoS/rAQurQmvGWmwn2bBPM9c= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1/go.mod h1:G+WkljZi4mflcqVxYSgvt8MNctRQHjEH8ubKtt1Ka3w= +github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -1468,7 +1513,9 @@ github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4N github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= +github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -1497,6 +1544,7 @@ github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJ github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -1507,6 +1555,7 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -1524,6 +1573,7 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/nomad/api v0.0.0-20221214074818-7dbbf6bc584d h1:kEWrUx7mld3c6HRcO2KhfD1MYBkofuZfEfDwCRQ9aMU= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= @@ -1531,6 +1581,8 @@ github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hetznercloud/hcloud-go v1.38.0 h1:K6Pd/mMdcLfBhvwG39qyAaacp4pCS3dKa8gChmLKxLg= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -1567,6 +1619,7 @@ github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mq github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8/go.mod h1:KrtyD5PFj++GKkFS/7/RRrfnRhAMGQwy75GLCHWrCNs= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= +github.com/ionos-cloud/sdk-go/v6 v6.0.4 h1:4LoWeM7WtcDqYDjlntqQ3fD6XaENlCw2YqiVWkHQbNA= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -1622,6 +1675,7 @@ github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= +github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc= github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jaypipes/ghw v0.10.0 h1:UHu9UX08Py315iPojADFPOkmjTsNzHj4g4adsNKKteY= github.com/jaypipes/ghw v0.10.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= @@ -1640,6 +1694,7 @@ github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7 github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= github.com/jhump/protoreflect v1.14.1 h1:N88q7JkxTHWFEqReuTsYH1dPIwXxA0ITNQp7avLY10s= github.com/jhump/protoreflect v1.14.1/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= +github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= @@ -1648,6 +1703,7 @@ github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= @@ -1698,6 +1754,7 @@ github.com/karrick/godirwalk v1.10.9/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.15.3/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/karrick/godirwalk v1.15.5/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= +github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= @@ -1729,6 +1786,7 @@ github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH6 github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec/go.mod h1:H5mEFsTeWizwFXHKtsITL5ipsLTuAMQoGuQpp+1JL9U= +github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1740,11 +1798,13 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kralicky/cortex v1.14.1-opni.0 h1:+XrmnpjKlAwyMUOgSDgWVVd7uRM6Vrk/2691uRpGnRM= github.com/kralicky/cortex v1.14.1-opni.0/go.mod h1:/EKcnQHqRrx1MyPp2LDJ7tKSHlr+f+A1hrisqyOVFZw= @@ -1756,6 +1816,7 @@ github.com/kralicky/grafana-operator/v4 v4.2.1-0.20221115225851-0b4fc0307089 h1: github.com/kralicky/grafana-operator/v4 v4.2.1-0.20221115225851-0b4fc0307089/go.mod h1:bNBl/NkTje9KiKAD4qKvwSRvdX2Xn+AjO6uu3DSam5k= github.com/kralicky/grpc-gateway/v2 v2.11.3 h1:vLLe/VPWWJmtQwuQ0rlL2cU0L/VpL5UKfk6IkM3Zak0= github.com/kralicky/grpc-gateway/v2 v2.11.3/go.mod h1:REy8s1IlkKMQFqp5QJaO0qvcfY5gRjXetqwqfb0iiMY= +github.com/kralicky/kmatch v0.0.0-20220713045459-85a252b9275e h1:0HTOxNxXnJy4EV0zRWr37D/N6xWLdQ1GjtgLpts30jw= github.com/kralicky/kmatch v0.0.0-20220713045459-85a252b9275e/go.mod h1:GIlN+uSFeISHISm+32UmNce20rNVC5q1Jyz5Wg05cEw= github.com/kralicky/logging-operator v0.0.0-20230206225216-304d63447c1f h1:OLXJYDCBLimsDZooGryznY+TQqm47RrwSRONvTr0RRg= github.com/kralicky/logging-operator v0.0.0-20230206225216-304d63447c1f/go.mod h1:5sTY/rz7ybmF7izsy9JvyJB4TvfOqeffRNhkK9q9lq4= @@ -1782,6 +1843,7 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= @@ -1810,6 +1872,7 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linode/linodego v1.9.3 h1:+lxNZw4avRxhCqGjwfPgQ2PvMT+vOL0OMsTdzixR7hQ= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/longhorn/upgrade-responder v0.1.5 h1:d1GksWjckahzFruqmeHyWwOEt8+P6H5gAET3Ojmm/ms= @@ -1842,6 +1905,7 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/markbates/deplist v1.0.4/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.0.5/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.1.3/go.mod h1:BF7ioVzAJYEtzQN/os4rt8H8Ti3h0T7EoN+7eyALktE= +github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= github.com/markbates/going v1.0.2/go.mod h1:UWCk3zm0UKefHZ7l8BNqi26UyiEMniznk8naLdTcy6c= github.com/markbates/grift v1.0.4/go.mod h1:wbmtW74veyx+cgfwFhlnnMWqhoz55rnHR47oMXzsyVs= @@ -1854,15 +1918,18 @@ github.com/markbates/oncer v0.0.0-20180924031910-e862a676800b/go.mod h1:Ld9puTsI github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/refresh v1.4.10/go.mod h1:NDPHvotuZmTmesXxr95C9bjlw1/0frJwtME2dzcVKhc= github.com/markbates/safe v1.0.0/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/markbates/sigtx v1.0.0/go.mod h1:QF1Hv6Ic6Ca6W+T+DL0Y/ypborFKyvUY9HmuCD4VeTc= github.com/markbates/willie v1.0.9/go.mod h1:fsrFVWl91+gXpx/6dv715j7i11fYPfZ9ZGfH0DQzY7w= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= +github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -1912,6 +1979,7 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E= @@ -1923,6 +1991,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mholt/archiver/v4 v4.0.0-alpha.3 h1:cSPJX8PnksNrhSQUyKLW6kd6iuLg37GaRJUIpSmqRlw= @@ -1935,6 +2004,7 @@ github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJys github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mikefarah/yq/v4 v4.30.8 h1:EHovseqMJs9kvE25/2k6VnDs4CrBZN+DFbybUhpPAGM= github.com/mikefarah/yq/v4 v4.30.8/go.mod h1:8D30GDxhu3+KXll0aFV5msGcdgYRZSPOPVBTbgUQ7Dc= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= @@ -1954,6 +2024,7 @@ github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HK github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -1987,6 +2058,7 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/mountinfo v0.6.0 h1:gUDhXQx58YNrpHlK4nSL+7y2pxFZkUcXqzFDKWdC0Oo= github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= @@ -2015,6 +2087,7 @@ github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/moul/http2curl v0.0.0-20170919181001-9ac6cf4d929b/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de h1:D5x39vF5KCwKQaw+OC9ZPiLVHXz3UFw2+psEX+gYcto= github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de/go.mod h1:kJun4WP5gFuHZgRjZUWWuH1DTxCtxbHDOIJsudS8jzY= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -2063,6 +2136,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk= github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -2073,6 +2147,7 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olebedev/when v0.0.0-20221205223600-4d190b02b8d8 h1:0uFGkScHef2Xd8g74BMHU1jFcnKEm0PzrPn4CluQ9FI= github.com/olebedev/when v0.0.0-20221205223600-4d190b02b8d8/go.mod h1:T0THb4kP9D3NNqlvCwIG4GyUioTAzEhB4RNVzig/43E= github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= +github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -2093,6 +2168,7 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.8.0 h1:pAM+oBNPrpXRs+E/8spkeGx9QgekbRVyr74EUvRVOUI= github.com/onsi/ginkgo/v2 v2.8.0/go.mod h1:6JsQiECmxCa3V5st74AL/AmsV482EDdVrGaVW6z3oYU= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -2157,6 +2233,7 @@ github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.m github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0= github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS69fQMD+MNP1mRs6mBQc= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -2167,6 +2244,7 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/oracle/oci-go-sdk/v65 v65.13.0 h1:0+9ea5goYfhI3/MPfbIQU6yzHYWE6sCk6VuUepxk5Nk= github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.5.4/go.mod h1:J8ZUbNB2FOhm1cFZW9xBpDsODqsSWcyYgtJYVPcnF70= @@ -2197,9 +2275,11 @@ github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M= github.com/ory/x v0.0.214 h1:nz5ijvm5MVhYxWsQSuUrW1hj9F5QLZvPn/nLo5s06T4= github.com/ory/x v0.0.214/go.mod h1:aRl57gzyD4GF0HQCekovXhv0xTZgAgiht3o8eVhsm9Q= github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis= +github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -2238,6 +2318,7 @@ github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqgg github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -2249,6 +2330,7 @@ github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdL github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -2256,9 +2338,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/poy/onpar v0.0.0-20190519213022-ee068f8ea4d1/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU= +github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0 h1:55138zTXw/yRYizPxZ672I/aDD7Yte3uYRAfUjWUu2M= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0/go.mod h1:j51242bf6LQwvJ1JPKWApzTnifmCwcQq0i1p29ylWiM= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.63.0 h1:efsW3CfymG5bZUpeIsYfdihB33YItCn7uHBOEbnHQG8= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.63.0/go.mod h1:/UtstAaWVaS3Z9GK9jo8+4SN9T+RMSq7VlOcQMmiEsc= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.63.0 h1:8Au9x/807lcDRCmypzfWvr9haO5eF/eX7hiMQCy1k4A= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.63.0/go.mod h1:sjCnCbwVFVTO90iChFOK0eUat70C4Q11EVik0Rk3EeU= github.com/prometheus/alertmanager v0.25.0 h1:vbXKUR6PYRiZPRIKfmXaG+dmCKG52RtPL4Btl8hQGvg= github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -2330,18 +2415,25 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc h1:gSVONBi2HWMFXCa9jFdYvYk7IwW/mTLxWOF7rXS4LO0= github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc/go.mod h1:KbKfKPy2I6ecOIGA9apfheFv14+P3RSmmQvshofQyMY= github.com/pulumi/pulumi-aws/sdk/v5 v5.1.2/go.mod h1:5Bl3enkEyJD5oDkNZYfduZP7aP3xFjCf7yaBdNuifEo= +github.com/pulumi/pulumi-aws/sdk/v5 v5.29.1 h1:uD6oJckjP9lcMGvw0FSXLz5DwweEyCJ2N0XudRSBSM0= github.com/pulumi/pulumi-aws/sdk/v5 v5.29.1/go.mod h1:axXtUAYEclH+SVqr/QmWFzMfJchxrrPiyMrywCcMF9A= +github.com/pulumi/pulumi-awsx/sdk v1.0.1 h1:Hz5TQ3XAnHQge2F+ydNL1DKxMRXTZY1gk/MSou/2nls= github.com/pulumi/pulumi-awsx/sdk v1.0.1/go.mod h1:jwPmIPvPTVYkq+n6Nz/QfMhNZ1cHvBSORdRYvljV9Xo= +github.com/pulumi/pulumi-docker/sdk/v3 v3.2.0 h1:7liqzpMLCmk7BIO7w6f6JCh9IdtwCp0a//jA12i6eyo= github.com/pulumi/pulumi-docker/sdk/v3 v3.2.0/go.mod h1:TACDfD6SWGyaHmWLrtHAuGiZ+pTBD4OYYFb5kTyxdtQ= +github.com/pulumi/pulumi-eks/sdk v1.0.1 h1:/QstsE+ETWhx3hYVDWHhn4GT7V9aVWrPtyCjKckxB8o= github.com/pulumi/pulumi-eks/sdk v1.0.1/go.mod h1:H1+qy3r+WqP4Bw/zSd6vb+ZoY3zjDkCq0B1IScAcxhk= github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.17.0/go.mod h1:w+Y1d8uqc+gv7JYWLF4rfzvTsIIHR1SCL+GG6sX1xMM= +github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.23.1 h1:/80MhL18CCRdDbN1Ed87vf1dCi6F6/YDetOMXldozJg= github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.23.1/go.mod h1:NOCrmeTmR12varCHZXBnGUj3OzqTPQuOh1CspxjwgRs= +github.com/pulumi/pulumi-random/sdk/v4 v4.10.0 h1:F2GFmP8oxD0BUHV9E9yyWBO8u2MLHM51O45++zmmgB8= github.com/pulumi/pulumi-random/sdk/v4 v4.10.0/go.mod h1:czSwj+jZnn/VWovMpTLUs/RL/ZS4PFHRdmlXrkvHqeI= github.com/pulumi/pulumi/sdk/v3 v3.16.0/go.mod h1:252ou/zAU1g6E8iTwe2Y9ht7pb5BDl2fJlOuAgZCHiA= github.com/pulumi/pulumi/sdk/v3 v3.25.0/go.mod h1:VsxW+TGv2VBLe/MeqsAr9r0zKzK/gbAhFT9QxYr24cY= github.com/pulumi/pulumi/sdk/v3 v3.27.0/go.mod h1:VsxW+TGv2VBLe/MeqsAr9r0zKzK/gbAhFT9QxYr24cY= github.com/pulumi/pulumi/sdk/v3 v3.36.0/go.mod h1:e1xuPnh9aKzCesrFf96DEzcybLdRWRMhKeKVBmb2lm0= github.com/pulumi/pulumi/sdk/v3 v3.49.0/go.mod h1:58NOiU6vEdA0S8KFiFt4/eqH7vKtWhDFsEGCUFRBovw= +github.com/pulumi/pulumi/sdk/v3 v3.53.1 h1:fTYqe0fQiGshlOuHwpjOqQOb2SW3CSqXteeGcAuO+Bk= github.com/pulumi/pulumi/sdk/v3 v3.53.1/go.mod h1:IYcBrkAwKEGRVq7R1ne3XJKB5bcux5eL3M/zqco7d6Y= github.com/qmuntal/stateless v1.6.2 h1:HZq+/PxrJtGX7mF4pvbu6uuVuqQ/tWQoDZWbo6878ao= github.com/qmuntal/stateless v1.6.2/go.mod h1:/HWN2w30OtWL2VT9EUZxMsnz26iIbzuE8R0HOEcMaBY= @@ -2368,6 +2460,7 @@ github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= @@ -2391,6 +2484,7 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= +github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= @@ -2401,8 +2495,10 @@ github.com/samber/lo v1.37.0/go.mod h1:9vaz2O4o8oOnK23pd2TrXufcbdbJIa3b6cstBWKpo github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= github.com/santhosh-tekuri/jsonschema/v2 v2.1.0/go.mod h1:yzJzKUGV4RbWqWIBBP4wSOBqavX5saE02yirLS0OTyg= +github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10 h1:wsfMs0iv+MJiViM37qh5VEKISi3/ZUq2nNKNdqmumAs= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= @@ -2474,6 +2570,7 @@ github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -2559,7 +2656,9 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= +github.com/tencentyun/cos-go-sdk-v5 v0.7.34 h1:xm+Pg+6m486y4eugRI7/E4WasbVmpY1hp9QBSRErgp8= github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= +github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1Zsv7OAU9iQhZwigp50Yl38W10g/vd5NC8Rdk1Jzng= github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM= @@ -2601,6 +2700,7 @@ github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvF github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 h1:X9dsIWPuuEJlPX//UmRKophhOKCGXc46RVIGuttks68= github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7/go.mod h1:UxoP3EypF8JfGEjAII8jx1q8rQyDnX8qdTCs/UQBVIE= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -2628,7 +2728,6 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -2642,6 +2741,7 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/wayneashleyberry/terminal-dimensions v1.0.0 h1:LawtS1nqKjAfqrmKOzkcrDLAjSzh38lEhC401JPjQVA= github.com/wayneashleyberry/terminal-dimensions v1.0.0/go.mod h1:PW2XrtV6KmKOPhuf7wbtcmw1/IFnC39mryRET2XbxeE= github.com/weaveworks/common v0.0.0-20221201103051-7c2720a9024d h1:9Z/HiqeGN+LOnmotAMpFEQjuXZ4AGAVFG0rC1laP5Go= @@ -2688,8 +2788,12 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= +github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= +github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= +github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= @@ -2955,6 +3059,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -3712,6 +3817,7 @@ gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= @@ -3735,6 +3841,7 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -3749,6 +3856,7 @@ gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzW gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/telebot.v3 v3.1.2 h1:uw3zobPBnexytTsIPyxsS10xHRLXCf5f2GQhBxp6NaU= gopkg.in/telebot.v3 v3.1.2/go.mod h1:GJKwwWqp9nSkIVN51eRKU78aB5f5OnQuWdwiIZfPbko= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19/go.mod h1:o4V0GXN9/CAmCsvJ0oXYZvrZOe7syiDZSN1GWGZTGzc= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -3775,9 +3883,11 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= helm.sh/helm/v3 v3.4.2/go.mod h1:O4USJi4CwjSHEPPYmw2NpA1omXiaKu8ePA3cbxk66RQ= helm.sh/helm/v3 v3.10.3 h1:wL7IUZ7Zyukm5Kz0OUmIFZgKHuAgByCrUcJBtY0kDyw= @@ -3873,16 +3983,16 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M= +k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 h1:vV3ZKAUX0nMjTflyfVea98dTfROpIxDaEsQws0FT2Ts= +k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= k8s.io/kubectl v0.19.4/go.mod h1:XPmlu4DJEYgD83pvZFeKF8+MSvGnYGqunbFSrJsqHv0= k8s.io/kubectl v0.26.1 h1:K8A0Jjlwg8GqrxOXxAbjY5xtmXYeYjLU96cHp2WMQ7s= k8s.io/kubectl v0.26.1/go.mod h1:miYFVzldVbdIiXMrHZYmL/EDWwJKM+F0sSsdxsATFPo= @@ -3897,6 +4007,7 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230202215443-34013725500c h1:YVqDar2X7YiQa/DVAXFMDIfGF8uGrHQemlrwRU5NlVI= k8s.io/utils v0.0.0-20230202215443-34013725500c/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw= lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s= modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= @@ -3928,6 +4039,7 @@ modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= oras.land/oras-go v1.2.0 h1:yoKosVIbsPoFMqAIFHTnrmOuafHal+J/r+I5bdbVWu4= oras.land/oras-go v1.2.0/go.mod h1:pFNs7oHp2dYsYMSS82HaX5l4mpnGO7hbpPN6EWH2ltc= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= @@ -3942,6 +4054,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyz sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M= sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= +sigs.k8s.io/controller-tools v0.11.3 h1:T1xzLkog9saiyQSLz1XOImu4OcbdXWytc5cmYsBeBiE= sigs.k8s.io/controller-tools v0.11.3/go.mod h1:qcfX7jfcfYD/b7lAhvqAyTbt/px4GpvN88WKLFFv7p8= sigs.k8s.io/gateway-api v0.6.0 h1:v2FqrN2ROWZLrSnI2o91taHR8Sj3s+Eh3QU7gLNWIqA= sigs.k8s.io/gateway-api v0.6.0/go.mod h1:EYJT+jlPWTeNskjV0JTki/03WX1cyAnBhwBJfYHpV/0= @@ -3950,7 +4063,9 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h6 sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= +sigs.k8s.io/kustomize/cmd/config v0.10.9 h1:LV8AUwZPuvqhGfia50uNwsPwNg1xOy9koEf5hyBnYs4= sigs.k8s.io/kustomize/cmd/config v0.10.9/go.mod h1:T0s850zPV3wKfBALA0dyeP/K74jlJcoP8Pr9ZWwE3MQ= +sigs.k8s.io/kustomize/kustomize/v4 v4.5.7 h1:cDW6AVMl6t/SLuQaezMET8hgnadZGIAr8tUrxFVOrpg= sigs.k8s.io/kustomize/kustomize/v4 v4.5.7/go.mod h1:VSNKEH9D9d9bLiWEGbS6Xbg/Ih0tgQalmPvntzRxZ/Q= sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= @@ -3969,5 +4084,6 @@ sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= +sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 h1:hfyJ5ku9yFtLVOiSxa3IN+dx5eBQT9mPmKFypAmg8XM= sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 2236134fb1..180db66873 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -243,7 +243,6 @@ func BuildImportStartCmd() *cobra.Command { ForceOverlap: forceOverlap, } - //ctx, _ := context.WithTimeout(cmd.Context(), time.Second) ctx := cmd.Context() if _, err := remoteReadClient.Start(ctx, request); err != nil { return err @@ -327,6 +326,42 @@ func BuildProgressCmd() *cobra.Command { return cmd } +func BuildDiscoverCmd() *cobra.Command { + var namespace string + + cmd := &cobra.Command{ + Use: "discover [clusters...]", + Short: "discover potential import targets on registered clusters", + RunE: func(cmd *cobra.Command, args []string) error { + clusterIds := args + + request := &remoteread.DiscoveryRequest{ + ClusterIds: clusterIds, + } + + if namespace != "" { + request.Namespace = &namespace + } + + response, err := remoteReadClient.Discover(cmd.Context(), request) + if err != nil { + return fmt.Errorf("could not start discovery: %w", err) + } + + cliutil.RenderDiscoveryEntries(response.Entries) + + return nil + }, + } + + cmd.Flags().StringVar(&namespace, "namespace", "", "a namespace to limit the discovery to") + + ConfigureManagementCommand(cmd) + ConfigureImportCommand(cmd) + + return cmd +} + func BuildImportCmd() *cobra.Command { cmd := &cobra.Command{ Use: "import", @@ -340,6 +375,7 @@ func BuildImportCmd() *cobra.Command { cmd.AddCommand(BuildImportStartCmd()) cmd.AddCommand(BuildImportStopCmd()) cmd.AddCommand(BuildProgressCmd()) + cmd.AddCommand(BuildDiscoverCmd()) ConfigureManagementCommand(cmd) ConfigureImportCommand(cmd) diff --git a/pkg/opni/util/render.go b/pkg/opni/util/render.go index 74a89e498e..0cc5255a61 100644 --- a/pkg/opni/util/render.go +++ b/pkg/opni/util/render.go @@ -2,6 +2,7 @@ package cliutil import ( "fmt" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "strings" "time" @@ -262,6 +263,19 @@ func RenderCortexRules(resp *cortexadmin.ListRulesResponse) string { return w.Render() } +func RenderDiscoveryEntries(entries []*remoteread.DiscoveryEntry) string { + writer := table.NewWriter() + writer.SetStyle(table.StyleColoredDark) + writer.AppendHeader(table.Row{"CLUSTER", "NAME", "EXTERNAL", "INTERNAL"}) + + for _, entry := range entries { + row := table.Row{entry.ClusterId, entry.Name, entry.ExternalEndpoint, entry.InternalEndpoint} + writer.AppendRow(row) + } + + return writer.Render() +} + func RenderClusterDetails(cluster *corev1.Cluster) string { w := table.NewWriter() w.SetIndexColumn(1) diff --git a/plugins/metrics/pkg/agent/discovery.go b/plugins/metrics/pkg/agent/discovery.go new file mode 100644 index 0000000000..e303ec20c1 --- /dev/null +++ b/plugins/metrics/pkg/agent/discovery.go @@ -0,0 +1,81 @@ +package agent + +import ( + "context" + "fmt" + apimonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringclient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned" + "go.uber.org/zap" + apimetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" +) + +type DiscovererConfig struct { + RESTConfig *rest.Config + Context context.Context + Logger *zap.SugaredLogger +} + +type PrometheusDiscoverer struct { + DiscovererConfig + + kubeClient kubernetes.Interface + promClient monitoringclient.Interface +} + +func NewPrometheusDiscoverer(config DiscovererConfig) (*PrometheusDiscoverer, error) { + if config.RESTConfig == nil { + restConfig, err := rest.InClusterConfig() + + if err != nil { + return nil, fmt.Errorf("could not create restr config: %w", err) + } + + config.RESTConfig = restConfig + } + + kubeClient, err := kubernetes.NewForConfig(config.RESTConfig) + if err != nil { + return nil, fmt.Errorf("could not create kubernets client; %w", err) + } + + promClient, err := monitoringclient.NewForConfig(config.RESTConfig) + if err != nil { + return nil, fmt.Errorf("could not create Prometheus monitoring client: %w", err) + } + + return &PrometheusDiscoverer{ + kubeClient: kubeClient, + promClient: promClient, + }, nil +} + +func (discoverer *PrometheusDiscoverer) Discover() ([]*apimonitoringv1.Prometheus, error) { + namespaces, err := discoverer.kubeClient.CoreV1().Namespaces().List(discoverer.Context, apimetav1.ListOptions{}) + if err != nil { + return nil, fmt.Errorf("could not fetch list of namespaces: %w", err) + } + + prometheuses := make([]*apimonitoringv1.Prometheus, 0) + + for _, namespace := range namespaces.Items { + p, err := discoverer.DiscoverIn(namespace.Name) + if err != nil { + discoverer.Logger.Errorf("error fetching Prometheuses for namespace '%s': %w", namespace, err) + } + + prometheuses = append(prometheuses, p...) + } + + return prometheuses, nil +} + +func (discoverer *PrometheusDiscoverer) DiscoverIn(namespace string) ([]*apimonitoringv1.Prometheus, error) { + list, err := discoverer.promClient.MonitoringV1().Prometheuses(namespace).List(discoverer.Context, apimetav1.ListOptions{}) + if err != nil { + return nil, fmt.Errorf("could complete discovery: %w", err) + } + + return list.Items, nil +} diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index d33bf5d7e9..9736eaaff1 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -3,7 +3,9 @@ package agent import ( "context" "fmt" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/samber/lo" "sort" "strings" "sync" @@ -197,13 +199,45 @@ func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.T return status, nil } +func (m *MetricsNode) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { + discoverer, err := NewPrometheusDiscoverer(DiscovererConfig{ + Context: ctx, + Logger: m.logger.Named("prom-discovery"), + }) + + if err != nil { + m.logger.With( + "capability", wellknown.CapabilityMetrics, + zap.Error(err), + ).Errorf("could not create prometheus discoverer: %s", err) + + return nil, fmt.Errorf("could not create prometheus discoverer: %s", err) + } + + prometheuses, err := discoverer.Discover() + if err != nil { + return nil, fmt.Errorf("could not discover Prometheues instances: %w", err) + } + + entries := lo.Map(prometheuses, func(prometheus *monitoringv1.Prometheus, _ int) *remoteread.DiscoveryEntry { + return &remoteread.DiscoveryEntry{ + ExternalEndpoint: prometheus.Spec.ExternalURL, + InternalEndpoint: fmt.Sprintf("%s.%s.svc.cluster.local", prometheus.Name, prometheus.Namespace), + } + }) + + return &remoteread.DiscoveryResponse{ + Entries: entries, + }, nil +} + func (m *MetricsNode) doSync(ctx context.Context) { m.logger.Debug("syncing metrics node") m.nodeClientMu.RLock() defer m.nodeClientMu.RUnlock() if m.nodeClient == nil { - m.conditions.Set(health.CondConfigSync, health.StatusPending, "no client, skipping sync") + m.conditions.Set(health.CondConfigSync, health.StatusPending, "no promClient, skipping sync") return } diff --git a/plugins/metrics/pkg/agent/remoteread.go b/plugins/metrics/pkg/agent/remoteread.go index 15164f5424..af50b1be73 100644 --- a/plugins/metrics/pkg/agent/remoteread.go +++ b/plugins/metrics/pkg/agent/remoteread.go @@ -4,7 +4,10 @@ import ( "bytes" "context" "fmt" + + // todo: needed instead of google.golang.org/protobuf/proto since prometheus Messages are built with it "github.com/golang/protobuf/proto" + "github.com/golang/snappy" "github.com/prometheus/common/version" "github.com/prometheus/prometheus/prompb" diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index fb9dd28cf5..f7188f6f66 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -3,7 +3,10 @@ package agent import ( "context" "fmt" + + // todo: needed instead of google.golang.org/protobuf/proto since prometheus Messages are built with it "github.com/golang/protobuf/proto" + "github.com/golang/snappy" "github.com/opentracing-contrib/go-stdlib/nethttp" promConfig "github.com/prometheus/common/config" diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index 3a6c7d9e47..bc0df06379 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -1132,6 +1132,180 @@ func (x *Progress) GetPercentDone() float32 { return 0 } +type DiscoveryEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + ExternalEndpoint string `protobuf:"bytes,3,opt,name=externalEndpoint,proto3" json:"externalEndpoint,omitempty"` + InternalEndpoint string `protobuf:"bytes,4,opt,name=internalEndpoint,proto3" json:"internalEndpoint,omitempty"` +} + +func (x *DiscoveryEntry) Reset() { + *x = DiscoveryEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiscoveryEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscoveryEntry) ProtoMessage() {} + +func (x *DiscoveryEntry) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DiscoveryEntry.ProtoReflect.Descriptor instead. +func (*DiscoveryEntry) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{18} +} + +func (x *DiscoveryEntry) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DiscoveryEntry) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +func (x *DiscoveryEntry) GetExternalEndpoint() string { + if x != nil { + return x.ExternalEndpoint + } + return "" +} + +func (x *DiscoveryEntry) GetInternalEndpoint() string { + if x != nil { + return x.InternalEndpoint + } + return "" +} + +type DiscoveryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // we only need to provide clusterId or namespace if we want to narrow our scope of discovery + ClusterIds []string `protobuf:"bytes,1,rep,name=clusterIds,proto3" json:"clusterIds,omitempty"` + Namespace *string `protobuf:"bytes,2,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"` +} + +func (x *DiscoveryRequest) Reset() { + *x = DiscoveryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiscoveryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscoveryRequest) ProtoMessage() {} + +func (x *DiscoveryRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DiscoveryRequest.ProtoReflect.Descriptor instead. +func (*DiscoveryRequest) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{19} +} + +func (x *DiscoveryRequest) GetClusterIds() []string { + if x != nil { + return x.ClusterIds + } + return nil +} + +func (x *DiscoveryRequest) GetNamespace() string { + if x != nil && x.Namespace != nil { + return *x.Namespace + } + return "" +} + +type DiscoveryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entries []*DiscoveryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *DiscoveryResponse) Reset() { + *x = DiscoveryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiscoveryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscoveryResponse) ProtoMessage() {} + +func (x *DiscoveryResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DiscoveryResponse.ProtoReflect.Descriptor instead. +func (*DiscoveryResponse) Descriptor() ([]byte, []int) { + return file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDescGZIP(), []int{20} +} + +func (x *DiscoveryResponse) GetEntries() []*DiscoveryEntry { + if x != nil { + return x.Entries + } + return nil +} + var File_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto protoreflect.FileDescriptor var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc = []byte{ @@ -1282,56 +1456,86 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x44, 0x6f, 0x6e, 0x65, 0x32, 0xf4, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, - 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, - 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, - 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, - 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x44, 0x6f, 0x6e, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x22, 0x63, 0x0a, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x32, 0xbd, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, + 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, + 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xdb, 0x01, 0x0a, 0x0f, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, - 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, - 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, + 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, - 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xa4, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x47, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, + 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1347,7 +1551,7 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_goTypes = []interface{}{ (TargetStatus_State)(0), // 0: remoteread.TargetStatus.State (LabelMatcher_Type)(0), // 1: remoteread.LabelMatcher.Type @@ -1369,8 +1573,11 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ (*Query)(nil), // 17: remoteread.Query (*LabelMatcher)(nil), // 18: remoteread.LabelMatcher (*Progress)(nil), // 19: remoteread.Progress - (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 21: google.protobuf.Empty + (*DiscoveryEntry)(nil), // 20: remoteread.DiscoveryEntry + (*DiscoveryRequest)(nil), // 21: remoteread.DiscoveryRequest + (*DiscoveryResponse)(nil), // 22: remoteread.DiscoveryResponse + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 24: google.protobuf.Empty } var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_depIdxs = []int32{ 3, // 0: remoteread.Target.meta:type_name -> remoteread.TargetMeta @@ -1379,9 +1586,9 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 8, // 3: remoteread.TargetStatus.progress:type_name -> remoteread.TargetProgress 0, // 4: remoteread.TargetStatus.state:type_name -> remoteread.TargetStatus.State 2, // 5: remoteread.TargetList.targets:type_name -> remoteread.Target - 20, // 6: remoteread.TargetProgress.startTimestamp:type_name -> google.protobuf.Timestamp - 20, // 7: remoteread.TargetProgress.lastReadTimestamp:type_name -> google.protobuf.Timestamp - 20, // 8: remoteread.TargetProgress.endTimestamp:type_name -> google.protobuf.Timestamp + 23, // 6: remoteread.TargetProgress.startTimestamp:type_name -> google.protobuf.Timestamp + 23, // 7: remoteread.TargetProgress.lastReadTimestamp:type_name -> google.protobuf.Timestamp + 23, // 8: remoteread.TargetProgress.endTimestamp:type_name -> google.protobuf.Timestamp 2, // 9: remoteread.TargetAddRequest.target:type_name -> remoteread.Target 3, // 10: remoteread.TargetEditRequest.meta:type_name -> remoteread.TargetMeta 6, // 11: remoteread.TargetEditRequest.targetDiff:type_name -> remoteread.TargetDiff @@ -1392,37 +1599,42 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 3, // 16: remoteread.TargetStatusRequest.meta:type_name -> remoteread.TargetMeta 3, // 17: remoteread.TargetStatusUpdateRequest.meta:type_name -> remoteread.TargetMeta 4, // 18: remoteread.TargetStatusUpdateRequest.newStatus:type_name -> remoteread.TargetStatus - 20, // 19: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp - 20, // 20: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp + 23, // 19: remoteread.Query.startTimestamp:type_name -> google.protobuf.Timestamp + 23, // 20: remoteread.Query.endTimestamp:type_name -> google.protobuf.Timestamp 18, // 21: remoteread.Query.matchers:type_name -> remoteread.LabelMatcher 1, // 22: remoteread.LabelMatcher.type:type_name -> remoteread.LabelMatcher.Type - 20, // 23: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp - 20, // 24: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp - 9, // 25: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest - 10, // 26: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest - 11, // 27: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest - 12, // 28: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest - 13, // 29: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest - 14, // 30: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest - 15, // 31: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest - 13, // 32: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest - 14, // 33: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest - 15, // 34: remoteread.RemoteReadAgent.GetTargetStatus:input_type -> remoteread.TargetStatusRequest - 21, // 35: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty - 21, // 36: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty - 21, // 37: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty - 7, // 38: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList - 21, // 39: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty - 21, // 40: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty - 4, // 41: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus - 21, // 42: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty - 21, // 43: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty - 4, // 44: remoteread.RemoteReadAgent.GetTargetStatus:output_type -> remoteread.TargetStatus - 35, // [35:45] is the sub-list for method output_type - 25, // [25:35] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 23, // 23: remoteread.Progress.startTimestamp:type_name -> google.protobuf.Timestamp + 23, // 24: remoteread.Progress.endTimestamp:type_name -> google.protobuf.Timestamp + 20, // 25: remoteread.DiscoveryResponse.entries:type_name -> remoteread.DiscoveryEntry + 9, // 26: remoteread.RemoteReadGateway.AddTarget:input_type -> remoteread.TargetAddRequest + 10, // 27: remoteread.RemoteReadGateway.EditTarget:input_type -> remoteread.TargetEditRequest + 11, // 28: remoteread.RemoteReadGateway.RemoveTarget:input_type -> remoteread.TargetRemoveRequest + 12, // 29: remoteread.RemoteReadGateway.ListTargets:input_type -> remoteread.TargetListRequest + 13, // 30: remoteread.RemoteReadGateway.Start:input_type -> remoteread.StartReadRequest + 14, // 31: remoteread.RemoteReadGateway.Stop:input_type -> remoteread.StopReadRequest + 15, // 32: remoteread.RemoteReadGateway.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 21, // 33: remoteread.RemoteReadGateway.Discover:input_type -> remoteread.DiscoveryRequest + 13, // 34: remoteread.RemoteReadAgent.Start:input_type -> remoteread.StartReadRequest + 14, // 35: remoteread.RemoteReadAgent.Stop:input_type -> remoteread.StopReadRequest + 15, // 36: remoteread.RemoteReadAgent.GetTargetStatus:input_type -> remoteread.TargetStatusRequest + 21, // 37: remoteread.RemoteReadAgent.Discover:input_type -> remoteread.DiscoveryRequest + 24, // 38: remoteread.RemoteReadGateway.AddTarget:output_type -> google.protobuf.Empty + 24, // 39: remoteread.RemoteReadGateway.EditTarget:output_type -> google.protobuf.Empty + 24, // 40: remoteread.RemoteReadGateway.RemoveTarget:output_type -> google.protobuf.Empty + 7, // 41: remoteread.RemoteReadGateway.ListTargets:output_type -> remoteread.TargetList + 24, // 42: remoteread.RemoteReadGateway.Start:output_type -> google.protobuf.Empty + 24, // 43: remoteread.RemoteReadGateway.Stop:output_type -> google.protobuf.Empty + 4, // 44: remoteread.RemoteReadGateway.GetTargetStatus:output_type -> remoteread.TargetStatus + 22, // 45: remoteread.RemoteReadGateway.Discover:output_type -> remoteread.DiscoveryResponse + 24, // 46: remoteread.RemoteReadAgent.Start:output_type -> google.protobuf.Empty + 24, // 47: remoteread.RemoteReadAgent.Stop:output_type -> google.protobuf.Empty + 4, // 48: remoteread.RemoteReadAgent.GetTargetStatus:output_type -> remoteread.TargetStatus + 22, // 49: remoteread.RemoteReadAgent.Discover:output_type -> remoteread.DiscoveryResponse + 38, // [38:50] is the sub-list for method output_type + 26, // [26:38] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_init() } @@ -1647,14 +1859,51 @@ func file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread return nil } } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiscoveryEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiscoveryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiscoveryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } + file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_msgTypes[19].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_proto_rawDesc, NumEnums: 2, - NumMessages: 18, + NumMessages: 21, NumExtensions: 0, NumServices: 2, }, diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index 9af94bd4e8..b2ac9685ca 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -11,7 +11,6 @@ package remoteread; // todo: we probably need a new type for Describe and ScanFor service RemoteReadGateway { -// rpc ScanForTargets(google.protobuf.Empty) returns (stream Target); // rpc Describe(Target) returns (Target) rpc AddTarget(TargetAddRequest) returns (google.protobuf.Empty); @@ -22,12 +21,14 @@ service RemoteReadGateway { rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); + rpc Discover(DiscoveryRequest) returns (DiscoveryResponse); } service RemoteReadAgent { rpc Start(StartReadRequest) returns (google.protobuf.Empty); rpc Stop(StopReadRequest) returns (google.protobuf.Empty); rpc GetTargetStatus(TargetStatusRequest) returns (TargetStatus); + rpc Discover(DiscoveryRequest) returns (DiscoveryResponse); } message Target { @@ -139,3 +140,24 @@ message Progress { google.protobuf.Timestamp endTimestamp = 2; float percentDone = 3; } + +message DiscoveryEntry { + string name = 1; + string clusterId = 2; + string externalEndpoint = 3; + string internalEndpoint = 4; + + // todo: adding these would require more traffic and time for a response +// google.protobuf.Timestamp minimumTimestamp = 3; +// int32 availableData = 4; +} + +message DiscoveryRequest { + // we only need to provide clusterId or namespace if we want to narrow our scope of discovery + repeated string clusterIds = 1; + optional string namespace = 2; +} + +message DiscoveryResponse { + repeated DiscoveryEntry entries = 1; +} \ No newline at end of file diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go index 59c3f70b2c..7280375cb1 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread_grpc.pb.go @@ -30,6 +30,7 @@ type RemoteReadGatewayClient interface { Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) + Discover(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error) } type remoteReadGatewayClient struct { @@ -103,6 +104,15 @@ func (c *remoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *Targe return out, nil } +func (c *remoteReadGatewayClient) Discover(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error) { + out := new(DiscoveryResponse) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadGateway/Discover", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RemoteReadGatewayServer is the server API for RemoteReadGateway service. // All implementations must embed UnimplementedRemoteReadGatewayServer // for forward compatibility @@ -114,6 +124,7 @@ type RemoteReadGatewayServer interface { Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) + Discover(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error) mustEmbedUnimplementedRemoteReadGatewayServer() } @@ -142,6 +153,9 @@ func (UnimplementedRemoteReadGatewayServer) Stop(context.Context, *StopReadReque func (UnimplementedRemoteReadGatewayServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") } +func (UnimplementedRemoteReadGatewayServer) Discover(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Discover not implemented") +} func (UnimplementedRemoteReadGatewayServer) mustEmbedUnimplementedRemoteReadGatewayServer() {} // UnsafeRemoteReadGatewayServer may be embedded to opt out of forward compatibility for this service. @@ -281,6 +295,24 @@ func _RemoteReadGateway_GetTargetStatus_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _RemoteReadGateway_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DiscoveryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadGatewayServer).Discover(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadGateway/Discover", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadGatewayServer).Discover(ctx, req.(*DiscoveryRequest)) + } + return interceptor(ctx, in, info, handler) +} + // RemoteReadGateway_ServiceDesc is the grpc.ServiceDesc for RemoteReadGateway service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -316,6 +348,10 @@ var RemoteReadGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetTargetStatus", Handler: _RemoteReadGateway_GetTargetStatus_Handler, }, + { + MethodName: "Discover", + Handler: _RemoteReadGateway_Discover_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", @@ -328,6 +364,7 @@ type RemoteReadAgentClient interface { Start(ctx context.Context, in *StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stop(ctx context.Context, in *StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GetTargetStatus(ctx context.Context, in *TargetStatusRequest, opts ...grpc.CallOption) (*TargetStatus, error) + Discover(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error) } type remoteReadAgentClient struct { @@ -365,6 +402,15 @@ func (c *remoteReadAgentClient) GetTargetStatus(ctx context.Context, in *TargetS return out, nil } +func (c *remoteReadAgentClient) Discover(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error) { + out := new(DiscoveryResponse) + err := c.cc.Invoke(ctx, "/remoteread.RemoteReadAgent/Discover", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RemoteReadAgentServer is the server API for RemoteReadAgent service. // All implementations must embed UnimplementedRemoteReadAgentServer // for forward compatibility @@ -372,6 +418,7 @@ type RemoteReadAgentServer interface { Start(context.Context, *StartReadRequest) (*emptypb.Empty, error) Stop(context.Context, *StopReadRequest) (*emptypb.Empty, error) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) + Discover(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error) mustEmbedUnimplementedRemoteReadAgentServer() } @@ -388,6 +435,9 @@ func (UnimplementedRemoteReadAgentServer) Stop(context.Context, *StopReadRequest func (UnimplementedRemoteReadAgentServer) GetTargetStatus(context.Context, *TargetStatusRequest) (*TargetStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTargetStatus not implemented") } +func (UnimplementedRemoteReadAgentServer) Discover(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Discover not implemented") +} func (UnimplementedRemoteReadAgentServer) mustEmbedUnimplementedRemoteReadAgentServer() {} // UnsafeRemoteReadAgentServer may be embedded to opt out of forward compatibility for this service. @@ -455,6 +505,24 @@ func _RemoteReadAgent_GetTargetStatus_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _RemoteReadAgent_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DiscoveryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RemoteReadAgentServer).Discover(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remoteread.RemoteReadAgent/Discover", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RemoteReadAgentServer).Discover(ctx, req.(*DiscoveryRequest)) + } + return interceptor(ctx, in, info, handler) +} + // RemoteReadAgent_ServiceDesc is the grpc.ServiceDesc for RemoteReadAgent service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -474,6 +542,10 @@ var RemoteReadAgent_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetTargetStatus", Handler: _RemoteReadAgent_GetTargetStatus_Handler, }, + { + MethodName: "Discover", + Handler: _RemoteReadAgent_Discover_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread/remoteread.proto", diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index a8160bf56b..10a48d6be2 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,15 +3,20 @@ package backend import ( "context" "fmt" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" + "github.com/rancher/opni/plugins/metrics/pkg/agent" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" + "github.com/samber/lo" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" + "k8s.io/client-go/tools/clientcmd" + "os" "strings" "sync" @@ -560,29 +565,30 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ return list, nil } -func (m *MetricsBackend) GetTargetStatus(_ context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { +func (m *MetricsBackend) GetTargetStatus(ctx context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { m.WaitForInit() - // todo: need to query agent - m.remoteReadTargetMu.Lock() - defer m.remoteReadTargetMu.Unlock() + status, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Meta.ClusterId}).GetTargetStatus(ctx, request) - targetId := getIdFromTargetMeta(request.Meta) + if err != nil { + if err != nil { + m.Logger.With( + "cluster", request.Meta.ClusterId, + "capability", wellknown.CapabilityMetrics, + "target", request.Meta.Name, + zap.Error(err), + ).Error("failed to start target") - target, found := m.remoteReadTargets[targetId] - if !found { - return nil, targetDoesNotExistError(targetId) + return nil, err + } } - return target.Status, nil + return status, nil } func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { m.WaitForInit() - // todo: delete after debugging circular communication stuff - //request.Query.Matchers[0].Name = "debugging" - if m.Delegate == nil { return nil, fmt.Errorf("encountered nil delegate") } @@ -601,23 +607,23 @@ func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartRea request.Target = target - _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Target.Meta.ClusterId}).Start(context.TODO(), request) + _, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Target.Meta.ClusterId}).Start(ctx, request) if err != nil { m.Logger.With( - "cluster", request.Target.Meta.Name, + "cluster", request.Target.Meta.ClusterId, "capability", wellknown.CapabilityMetrics, "target", request.Target.Meta.Name, zap.Error(err), - ).Warn("failed to start target") + ).Error("failed to start target") return nil, err } m.Logger.With( - "cluster", request.Target.Meta.Name, - "target", request.Target.Meta.Name, + "cluster", request.Target.Meta.ClusterId, "capability", wellknown.CapabilityMetrics, + "target", request.Target.Meta.Name, ).Info("target started") return &emptypb.Empty{}, nil @@ -634,20 +640,64 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR if err != nil { m.Logger.With( - "cluster", request.Meta.Name, + "cluster", request.Meta.ClusterId, "capability", wellknown.CapabilityMetrics, "target", request.Meta.Name, zap.Error(err), - ).Warn("failed to stop target") + ).Error("failed to stop target") return nil, err } m.Logger.With( "cluster", request.Meta.Name, - "target", request.Meta.Name, "capability", wellknown.CapabilityMetrics, + "target", request.Meta.Name, ).Info("target stopped") return &emptypb.Empty{}, nil } + +func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { + m.WaitForInit() + + // todo: remove after testing + kubePath := os.Getenv("KUBECONFIG") + config, err := clientcmd.BuildConfigFromFlags("", kubePath) + if err != nil { + return nil, fmt.Errorf("could not construct rest config from kubeconfig at '%s': %w", kubePath, err) + } + + // todo: this is still the client implementation + discoverer, err := agent.NewPrometheusDiscoverer(agent.DiscovererConfig{ + //RESTConfig: nil,/ + RESTConfig: config, + Context: ctx, + Logger: m.Logger.Named("prom-discovery"), + }) + + if err != nil { + m.Logger.With( + "capability", wellknown.CapabilityMetrics, + zap.Error(err), + ).Errorf("could not create prometheus discoverer: %s", err) + + return nil, fmt.Errorf("could not create prometheus discoverer: %s", err) + } + + prometheuses, err := discoverer.Discover() + if err != nil { + return nil, fmt.Errorf("could not discover Prometheues instances: %w", err) + } + + entries := lo.Map(prometheuses, func(prometheus *monitoringv1.Prometheus, _ int) *remoteread.DiscoveryEntry { + return &remoteread.DiscoveryEntry{ + ExternalEndpoint: prometheus.Spec.ExternalURL, + InternalEndpoint: fmt.Sprintf("%s.%s.svc.cluster.local", prometheus.Name, prometheus.Namespace), + } + }) + + return &remoteread.DiscoveryResponse{ + Entries: entries, + }, nil +} From ab9a6992bd77a2bc0ef5f65e7edf41a51bdebdba Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Mon, 9 Jan 2023 16:46:35 -0500 Subject: [PATCH 17/43] move client code onto client side --- plugins/metrics/pkg/backend/metrics.go | 45 ++++++-------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 10a48d6be2..381d7ffc02 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,20 +3,15 @@ package backend import ( "context" "fmt" - monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" - "github.com/rancher/opni/plugins/metrics/pkg/agent" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" - "github.com/samber/lo" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" - "k8s.io/client-go/tools/clientcmd" - "os" "strings" "sync" @@ -661,43 +656,23 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { m.WaitForInit() - // todo: remove after testing - kubePath := os.Getenv("KUBECONFIG") - config, err := clientcmd.BuildConfigFromFlags("", kubePath) - if err != nil { - return nil, fmt.Errorf("could not construct rest config from kubeconfig at '%s': %w", kubePath, err) - } - - // todo: this is still the client implementation - discoverer, err := agent.NewPrometheusDiscoverer(agent.DiscovererConfig{ - //RESTConfig: nil,/ - RESTConfig: config, - Context: ctx, - Logger: m.Logger.Named("prom-discovery"), - }) + response, err := m.Delegate.WithBroadcastSelector(&corev1.ClusterSelector{ + ClusterIDs: request.ClusterIds, + }).Discover(ctx, request) if err != nil { m.Logger.With( "capability", wellknown.CapabilityMetrics, zap.Error(err), - ).Errorf("could not create prometheus discoverer: %s", err) + ).Error("failed to run import discovery") - return nil, fmt.Errorf("could not create prometheus discoverer: %s", err) - } - - prometheuses, err := discoverer.Discover() - if err != nil { - return nil, fmt.Errorf("could not discover Prometheues instances: %w", err) + return nil, err } - entries := lo.Map(prometheuses, func(prometheus *monitoringv1.Prometheus, _ int) *remoteread.DiscoveryEntry { - return &remoteread.DiscoveryEntry{ - ExternalEndpoint: prometheus.Spec.ExternalURL, - InternalEndpoint: fmt.Sprintf("%s.%s.svc.cluster.local", prometheus.Name, prometheus.Namespace), - } - }) + m.Logger.With( + "capability", wellknown.CapabilityMetrics, + zap.Error(err), + ).Error("ran import discovery") - return &remoteread.DiscoveryResponse{ - Entries: entries, - }, nil + return response, nil } From 8671ec120914ffe87d83b8e8b118589392bf9c79 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Tue, 10 Jan 2023 11:06:47 -0500 Subject: [PATCH 18/43] fix delegate response handling flow --- pkg/plugins/apis/apiextensions/stream/delegate.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go index 69470a362f..b96fcc9b8d 100644 --- a/pkg/plugins/apis/apiextensions/stream/delegate.go +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -3,14 +3,14 @@ package stream import ( "context" "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "strings" "github.com/kralicky/totem" corev1 "github.com/rancher/opni/pkg/apis/core/v1" streamv1 "github.com/rancher/opni/pkg/apis/stream/v1" "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -76,7 +76,8 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, Request: requestBytes, }, } - if w.target != nil { + switch { + case w.target != nil: respMsg, err := w.delegateClient.Request(ctx, &streamv1.DelegatedMessage{ Request: rpc, Target: w.target, @@ -92,7 +93,7 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, if err := proto.Unmarshal(resp.Response, reply.(proto.Message)); err != nil { return status.Errorf(codes.Internal, "failed to unmarshal response: %v", err) } - } else if w.selector != nil { + case w.selector != nil: _, err := w.delegateClient.Broadcast(ctx, &streamv1.BroadcastMessage{ Request: rpc, TargetSelector: w.selector, @@ -100,8 +101,11 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, if err != nil { return err } + default: + panic("bug: no target or selector given") } - panic("bug: no target or selector given") + + return nil } func (w *targetedDelegatingClient[T]) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { From a33a8f6b46decc114f8137dc216c365f4f41cf6e Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Thu, 9 Feb 2023 15:08:33 -0500 Subject: [PATCH 19/43] small fixes # Conflicts: # pkg/opni/util/render.go --- pkg/opni/commands/import.go | 3 +- pkg/opni/commands/import_progress.go | 2 +- .../apis/apiextensions/stream/delegate.go | 4 +- plugins/metrics/pkg/agent/node.go | 8 + plugins/metrics/pkg/agent/runner.go | 4 +- .../pkg/apis/remoteread/remoteread.pb.go | 402 +++++++++--------- .../pkg/apis/remoteread/remoteread.proto | 11 +- plugins/metrics/pkg/backend/metrics.go | 18 +- 8 files changed, 238 insertions(+), 214 deletions(-) diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 180db66873..ed67784ea2 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -92,7 +92,6 @@ func BuildImportAddCmd() *cobra.Command { } _, err := remoteReadClient.AddTarget(cmd.Context(), request) - if err != nil { return err } @@ -110,7 +109,7 @@ func BuildImportEditCmd() *cobra.Command { var newName string cmd := &cobra.Command{ - Use: "edit", + Use: "edit ", Short: "Edit an existing import target", RunE: func(cmd *cobra.Command, args []string) error { if newEndpoint == "" && newName == "" { diff --git a/pkg/opni/commands/import_progress.go b/pkg/opni/commands/import_progress.go index 2a9135f124..7f91f5790f 100644 --- a/pkg/opni/commands/import_progress.go +++ b/pkg/opni/commands/import_progress.go @@ -36,7 +36,7 @@ func getNextStatus(ctx context.Context, request *remoteread.TargetStatusRequest) } func getProgressAsPercent(progress *remoteread.TargetProgress) float64 { - if progress.LastReadTimestamp == nil { + if progress == nil || progress.LastReadTimestamp == nil { return 0 } diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go index b96fcc9b8d..5e726a25a1 100644 --- a/pkg/plugins/apis/apiextensions/stream/delegate.go +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -81,7 +81,7 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, respMsg, err := w.delegateClient.Request(ctx, &streamv1.DelegatedMessage{ Request: rpc, Target: w.target, - }) + }, opts...) if err != nil { return err } @@ -97,7 +97,7 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, _, err := w.delegateClient.Broadcast(ctx, &streamv1.BroadcastMessage{ Request: rpc, TargetSelector: w.selector, - }) + }, opts...) if err != nil { return err } diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 9736eaaff1..bb502a65f3 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -6,6 +6,7 @@ import ( monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/samber/lo" + "google.golang.org/protobuf/proto" "sort" "strings" "sync" @@ -196,6 +197,13 @@ func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.T return nil, err } + if bytes, err := proto.Marshal(status); err != nil { + m.logger.Errorf("failed marshaling status: %s", err) + } else { + m.logger.Debugf("found status: %s", status.String()) + m.logger.Debugf("responding with %d bytes: %v", len(bytes), bytes) + } + return status, nil } diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index f7188f6f66..9a3e92fd26 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -3,7 +3,8 @@ package agent import ( "context" "fmt" - + "github.com/rancher/opni/pkg/capabilities/wellknown" + // todo: needed instead of google.golang.org/protobuf/proto since prometheus Messages are built with it "github.com/golang/protobuf/proto" @@ -269,6 +270,7 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q runner.logger.With( "cluster", target.Meta.ClusterId, + "capability", wellknown.CapabilityMetrics, "name", target.Meta.Name, ).Infof("target started") diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go index bc0df06379..b59960adfa 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.pb.go @@ -27,28 +27,31 @@ const ( type TargetStatus_State int32 const ( - TargetStatus_NotRunning TargetStatus_State = 0 - TargetStatus_Running TargetStatus_State = 1 - TargetStatus_Failed TargetStatus_State = 2 - TargetStatus_Complete TargetStatus_State = 3 - TargetStatus_Stopped TargetStatus_State = 4 + TargetStatus_Unknown TargetStatus_State = 0 + TargetStatus_NotRunning TargetStatus_State = 1 + TargetStatus_Running TargetStatus_State = 2 + TargetStatus_Failed TargetStatus_State = 3 + TargetStatus_Complete TargetStatus_State = 4 + TargetStatus_Stopped TargetStatus_State = 5 ) // Enum value maps for TargetStatus_State. var ( TargetStatus_State_name = map[int32]string{ - 0: "NotRunning", - 1: "Running", - 2: "Failed", - 3: "Complete", - 4: "Stopped", + 0: "Unknown", + 1: "NotRunning", + 2: "Running", + 3: "Failed", + 4: "Complete", + 5: "Stopped", } TargetStatus_State_value = map[string]int32{ - "NotRunning": 0, - "Running": 1, - "Failed": 2, - "Complete": 3, - "Stopped": 4, + "Unknown": 0, + "NotRunning": 1, + "Running": 2, + "Failed": 3, + "Complete": 4, + "Stopped": 5, } ) @@ -310,7 +313,7 @@ func (x *TargetStatus) GetState() TargetStatus_State { if x != nil { return x.State } - return TargetStatus_NotRunning + return TargetStatus_Unknown } type TargetSpec struct { @@ -1337,7 +1340,7 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x22, 0xe3, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x49, 0x64, 0x22, 0xf0, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, @@ -1346,196 +1349,197 @@ var file_github_cim_rancher_opni_plugins_metrics_pkg_apis_remoteread_remoteread_ 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4b, 0x0a, 0x05, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x69, - 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, - 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, - 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x53, - 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x04, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, - 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, - 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0xde, 0x01, 0x0a, - 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, - 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, - 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x5c, 0x0a, - 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x11, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x58, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, + 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x70, + 0x70, 0x65, 0x64, 0x10, 0x05, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, + 0x3c, 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, + 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x48, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x5c, 0x0a, 0x10, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x0a, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x44, 0x69, 0x66, 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, - 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x10, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, - 0x72, 0x6c, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, + 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x69, 0x66, + 0x66, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4f, 0x76, + 0x65, 0x72, 0x6c, 0x61, 0x70, 0x22, 0x3d, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x41, 0x0a, 0x13, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, - 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, + 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x7f, 0x0a, 0x19, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x6e, + 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, 0xaf, 0x01, 0x0a, + 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x42, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x52, + 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4e, + 0x6f, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x03, 0x22, 0xb0, + 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, + 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x63, + 0x0a, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x64, 0x73, 0x12, 0x21, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x32, 0xbd, + 0x04, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, + 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0c, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x7f, 0x0a, 0x19, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, - 0x65, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x09, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x22, - 0xaf, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x42, 0x0a, - 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x00, - 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x0e, - 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, 0x11, - 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x10, - 0x03, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, - 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x6e, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x44, 0x6f, 0x6e, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x22, 0x63, 0x0a, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, - 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x32, 0xbd, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x41, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x45, 0x64, - 0x69, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x47, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, - 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, - 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, - 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, + 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, - 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xa4, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, + 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa4, + 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x61, 0x64, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, - 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, - 0x61, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x47, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, - 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x08, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x72, 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, + 0x65, 0x61, 0x64, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x69, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x72, 0x65, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index b2ac9685ca..f53ce11714 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -44,11 +44,12 @@ message TargetMeta { message TargetStatus { enum State { - NotRunning = 0; - Running = 1; - Failed = 2; - Complete = 3; - Stopped = 4; + Unknown = 0; + NotRunning = 1; + Running = 2; + Failed = 3; + Complete = 4; + Stopped = 5; } // this is the progress of the last known import diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 381d7ffc02..22689b4c56 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -540,7 +540,7 @@ func (m *MetricsBackend) RemoveTarget(_ context.Context, request *remoteread.Tar return &emptypb.Empty{}, nil } -func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { +func (m *MetricsBackend) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { m.WaitForInit() m.remoteReadTargetMu.Lock() @@ -551,6 +551,14 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ for _, target := range m.remoteReadTargets { if request.ClusterId == "" || request.ClusterId == target.Meta.ClusterId { + newStatus, err := m.GetTargetStatus(ctx, &remoteread.TargetStatusRequest{Meta: target.Meta}) + if err != nil { + m.Logger.Infof("could not get newStatus for target '%s/%s': %s", target.Meta.ClusterId, target.Meta.Name, err) + newStatus.State = remoteread.TargetStatus_Unknown + } + + target.Status = newStatus + inner = append(inner, target) } } @@ -563,7 +571,7 @@ func (m *MetricsBackend) ListTargets(_ context.Context, request *remoteread.Targ func (m *MetricsBackend) GetTargetStatus(ctx context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { m.WaitForInit() - status, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Meta.ClusterId}).GetTargetStatus(ctx, request) + newStatus, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Meta.ClusterId}).GetTargetStatus(ctx, request) if err != nil { if err != nil { @@ -572,13 +580,15 @@ func (m *MetricsBackend) GetTargetStatus(ctx context.Context, request *remoterea "capability", wellknown.CapabilityMetrics, "target", request.Meta.Name, zap.Error(err), - ).Error("failed to start target") + ).Error("failed to get target status") return nil, err } } - return status, nil + m.Logger.Debugf("received status: %s", newStatus.String()) + + return newStatus, nil } func (m *MetricsBackend) Start(ctx context.Context, request *remoteread.StartReadRequest) (*emptypb.Empty, error) { From a3d5539d9b22c0bf43fb92dd0beda4418f39cc71 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 18 Jan 2023 11:32:32 -0500 Subject: [PATCH 20/43] fix delegate response unmarshalling --- pkg/gateway/delegate.go | 13 ++++++++++++- plugins/metrics/pkg/agent/node.go | 8 -------- plugins/metrics/pkg/backend/metrics.go | 2 -- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkg/gateway/delegate.go b/pkg/gateway/delegate.go index f0850fcaa9..143a01f996 100644 --- a/pkg/gateway/delegate.go +++ b/pkg/gateway/delegate.go @@ -2,6 +2,7 @@ package gateway import ( "context" + "google.golang.org/protobuf/proto" "sync" "github.com/kralicky/totem" @@ -89,14 +90,24 @@ func (d *DelegateServer) Request(ctx context.Context, req *streamv1.DelegatedMes ) lg.Debug("delegating rpc request") if target, ok := d.activeAgents[targetId]; ok { + fwdResp := &totem.RPC{} + err := target.Invoke(ctx, totem.Forward, req.GetRequest(), fwdResp) + if err != nil { + d.logger.With( + zap.Error(err), + ).Error("delegating rpc request failed") + return nil, err + } + resp := &totem.RPC{} - err := target.Invoke(ctx, totem.Forward, req.GetRequest(), resp) + err = proto.Unmarshal(fwdResp.GetResponse().GetResponse(), resp) if err != nil { d.logger.With( zap.Error(err), ).Error("delegating rpc request failed") return nil, err } + return resp, nil } else { err := status.Error(codes.NotFound, "target not found") diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index bb502a65f3..9736eaaff1 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -6,7 +6,6 @@ import ( monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/samber/lo" - "google.golang.org/protobuf/proto" "sort" "strings" "sync" @@ -197,13 +196,6 @@ func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.T return nil, err } - if bytes, err := proto.Marshal(status); err != nil { - m.logger.Errorf("failed marshaling status: %s", err) - } else { - m.logger.Debugf("found status: %s", status.String()) - m.logger.Debugf("responding with %d bytes: %v", len(bytes), bytes) - } - return status, nil } diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 22689b4c56..c06fd0077c 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -586,8 +586,6 @@ func (m *MetricsBackend) GetTargetStatus(ctx context.Context, request *remoterea } } - m.Logger.Debugf("received status: %s", newStatus.String()) - return newStatus, nil } From 3d2bfc95df3b8fa0f3a890dfbe2e07ca3323a9ec Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 18 Jan 2023 17:39:58 -0500 Subject: [PATCH 21/43] workaround for delegate init blocking metrics gateway --- pkg/opni/commands/import.go | 48 ++++++++++++++++++++++++++ plugins/metrics/pkg/agent/node.go | 8 +++-- plugins/metrics/pkg/backend/metrics.go | 6 ---- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index ed67784ea2..a06ea7ff94 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -4,6 +4,7 @@ import ( "context" "fmt" tea "github.com/charmbracelet/bubbletea" + v1 "github.com/rancher/opni/pkg/apis/management/v1" cliutil "github.com/rancher/opni/pkg/opni/util" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/spf13/cobra" @@ -67,12 +68,31 @@ func followProgress(ctx context.Context, name string, cluster string) error { return nil } +// validateClustersExist ensures that there is at least one agent registered to prevent metrics gateway from blocking +// when are none. +func validateClustersExist(ctx context.Context) error { + list, err := mgmtClient.ListClusters(ctx, &v1.ListClustersRequest{}) + if err != nil { + return fmt.Errorf("error checking for agents: %w", err) + } + + if len(list.Items) == 0 { + return fmt.Errorf("no agents are registered") + } + + return nil +} + func BuildImportAddCmd() *cobra.Command { cmd := &cobra.Command{ Use: "add ", Short: "Add a new import target", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + clusterId := args[0] targetName := args[1] endpoint := args[2] @@ -112,6 +132,10 @@ func BuildImportEditCmd() *cobra.Command { Use: "edit ", Short: "Edit an existing import target", RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + if newEndpoint == "" && newName == "" { lg.Infof("no edits specified, doing nothing") } @@ -152,6 +176,10 @@ func BuildImportRemoveCmd() *cobra.Command { Aliases: []string{"rm"}, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + request := &remoteread.TargetRemoveRequest{ Meta: &remoteread.TargetMeta{ ClusterId: args[0], @@ -179,6 +207,10 @@ func BuildImportListCmd() *cobra.Command { Short: "List available import targets", Aliases: []string{"ls"}, RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + request := &remoteread.TargetListRequest{ClusterId: ""} targetList, err := remoteReadClient.ListTargets(cmd.Context(), request) @@ -211,6 +243,10 @@ func BuildImportStartCmd() *cobra.Command { Short: "start an import", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + clusterId := args[0] targetName := args[1] labelMatchers := make([]*remoteread.LabelMatcher, len(labelFilters)) @@ -280,6 +316,10 @@ func BuildImportStopCmd() *cobra.Command { Short: "stop an import (will not remove already imported data)", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + clusterId := args[0] targetName := args[1] @@ -312,6 +352,10 @@ func BuildProgressCmd() *cobra.Command { Short: "follow import progress until finished", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + clusterId := args[0] targetName := args[1] @@ -332,6 +376,10 @@ func BuildDiscoverCmd() *cobra.Command { Use: "discover [clusters...]", Short: "discover potential import targets on registered clusters", RunE: func(cmd *cobra.Command, args []string) error { + if err := validateClustersExist(cmd.Context()); err != nil { + return err + } + clusterIds := args request := &remoteread.DiscoveryRequest{ diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index 9736eaaff1..e030b801ff 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -6,6 +6,7 @@ import ( monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/samber/lo" + "k8s.io/client-go/tools/clientcmd" "sort" "strings" "sync" @@ -200,9 +201,12 @@ func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.T } func (m *MetricsNode) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { + config, err := clientcmd.BuildConfigFromFlags("", "/home/jmeranda/.kube/config") + discoverer, err := NewPrometheusDiscoverer(DiscovererConfig{ - Context: ctx, - Logger: m.logger.Named("prom-discovery"), + RESTConfig: config, + Context: ctx, + Logger: m.logger.Named("prom-discovery"), }) if err != nil { diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index c06fd0077c..f5aa634195 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -77,12 +77,6 @@ func (m *MetricsBackend) Initialize(conf MetricsBackendConfig) { m.nodeStatus = make(map[string]*capabilityv1.NodeCapabilityStatus) m.desiredNodeSpec = make(map[string]*node.MetricsCapabilitySpec) m.remoteReadTargets = make(map[string]*remoteread.Target) - - if m.Delegate == nil { - m.Logger.Infof("found nil delegate") - } else { - m.Logger.Infof("found non-nil delegate") - } }) } From d5720b50ba0f1faab95515e965bc5ea3fc265b89 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 18 Jan 2023 17:47:28 -0500 Subject: [PATCH 22/43] remove redundant import/management clients --- pkg/opni/commands/import.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index a06ea7ff94..36f5a745c0 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -304,9 +304,6 @@ func BuildImportStartCmd() *cobra.Command { cmd.Flags().BoolVar(&forceOverlap, "force", false, "force import when 'start' is before the last stored start") - ConfigureManagementCommand(cmd) - ConfigureImportCommand(cmd) - return cmd } @@ -340,9 +337,6 @@ func BuildImportStopCmd() *cobra.Command { }, } - ConfigureManagementCommand(cmd) - ConfigureImportCommand(cmd) - return cmd } @@ -363,9 +357,6 @@ func BuildProgressCmd() *cobra.Command { }, } - ConfigureManagementCommand(cmd) - ConfigureImportCommand(cmd) - return cmd } @@ -403,9 +394,6 @@ func BuildDiscoverCmd() *cobra.Command { cmd.Flags().StringVar(&namespace, "namespace", "", "a namespace to limit the discovery to") - ConfigureManagementCommand(cmd) - ConfigureImportCommand(cmd) - return cmd } From 347b14b79e656f853b595a0adacc95ad9f5acfb1 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 25 Jan 2023 12:56:37 -0500 Subject: [PATCH 23/43] add broadcast response aggregator --- pkg/apis/stream/v1/stream.pb.go | 161 ++++++++++++------ pkg/apis/stream/v1/stream.proto | 12 +- pkg/apis/stream/v1/stream_grpc.pb.go | 10 +- pkg/gateway/delegate.go | 20 ++- pkg/opni/commands/import.go | 2 +- .../apis/apiextensions/stream/delegate.go | 15 +- plugins/metrics/pkg/agent/discovery.go | 2 + plugins/metrics/pkg/backend/metrics.go | 26 ++- 8 files changed, 181 insertions(+), 67 deletions(-) diff --git a/pkg/apis/stream/v1/stream.pb.go b/pkg/apis/stream/v1/stream.pb.go index 526cd55da1..a5b89f7bc6 100644 --- a/pkg/apis/stream/v1/stream.pb.go +++ b/pkg/apis/stream/v1/stream.pb.go @@ -283,6 +283,53 @@ func (x *BroadcastMessage) GetTargetSelector() *v1.ClusterSelector { return nil } +type BroadcastReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*totem.RPC `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *BroadcastReply) Reset() { + *x = BroadcastReply{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BroadcastReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BroadcastReply) ProtoMessage() {} + +func (x *BroadcastReply) ProtoReflect() protoreflect.Message { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BroadcastReply.ProtoReflect.Descriptor instead. +func (*BroadcastReply) Descriptor() ([]byte, []int) { + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{4} +} + +func (x *BroadcastReply) GetResponses() []*totem.RPC { + if x != nil { + return x.Responses + } + return nil +} + var File_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto protoreflect.FileDescriptor var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byte{ @@ -327,28 +374,32 @@ var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byt 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2a, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, - 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x10, 0x01, 0x32, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, - 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, - 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, - 0x43, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, - 0x13, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x8a, 0x01, 0x0a, - 0x08, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, - 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x12, 0x45, 0x0a, 0x09, 0x42, 0x72, - 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0x8a, 0xf1, 0x04, 0x02, 0x08, - 0x01, 0x1a, 0x06, 0x92, 0xf1, 0x04, 0x02, 0x08, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, - 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x72, 0x22, 0x3a, 0x0a, 0x0e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, + 0x2e, 0x52, 0x50, 0x43, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x2a, + 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, + 0x32, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, 0x07, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, + 0x43, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x28, 0x01, 0x30, + 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x84, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, + 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x12, 0x3f, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, + 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, + 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x1a, 0x06, 0x92, 0xf1, 0x04, 0x02, 0x08, 0x01, 0x42, + 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, + 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -364,40 +415,42 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP() } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_goTypes = []interface{}{ (EventType)(0), // 0: stream.EventType (*StreamEvent)(nil), // 1: stream.StreamEvent (*DelegatedMessage)(nil), // 2: stream.DelegatedMessage (*DelegatedMessageReply)(nil), // 3: stream.DelegatedMessageReply (*BroadcastMessage)(nil), // 4: stream.BroadcastMessage - (*totem.RPC)(nil), // 5: totem.RPC - (*v1.Reference)(nil), // 6: core.Reference - (*status.Status)(nil), // 7: google.rpc.Status - (*v1.ClusterSelector)(nil), // 8: core.ClusterSelector - (*emptypb.Empty)(nil), // 9: google.protobuf.Empty + (*BroadcastReply)(nil), // 5: stream.BroadcastReply + (*totem.RPC)(nil), // 6: totem.RPC + (*v1.Reference)(nil), // 7: core.Reference + (*status.Status)(nil), // 8: google.rpc.Status + (*v1.ClusterSelector)(nil), // 9: core.ClusterSelector + (*emptypb.Empty)(nil), // 10: google.protobuf.Empty } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_depIdxs = []int32{ 0, // 0: stream.StreamEvent.type:type_name -> stream.EventType - 5, // 1: stream.DelegatedMessage.request:type_name -> totem.RPC - 6, // 2: stream.DelegatedMessage.target:type_name -> core.Reference - 5, // 3: stream.DelegatedMessageReply.reply:type_name -> totem.RPC - 7, // 4: stream.DelegatedMessageReply.status:type_name -> google.rpc.Status - 5, // 5: stream.BroadcastMessage.request:type_name -> totem.RPC - 8, // 6: stream.BroadcastMessage.targetSelector:type_name -> core.ClusterSelector - 5, // 7: stream.Stream.Connect:input_type -> totem.RPC - 1, // 8: stream.Stream.Notify:input_type -> stream.StreamEvent - 2, // 9: stream.Delegate.Request:input_type -> stream.DelegatedMessage - 4, // 10: stream.Delegate.Broadcast:input_type -> stream.BroadcastMessage - 5, // 11: stream.Stream.Connect:output_type -> totem.RPC - 9, // 12: stream.Stream.Notify:output_type -> google.protobuf.Empty - 5, // 13: stream.Delegate.Request:output_type -> totem.RPC - 9, // 14: stream.Delegate.Broadcast:output_type -> google.protobuf.Empty - 11, // [11:15] is the sub-list for method output_type - 7, // [7:11] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 6, // 1: stream.DelegatedMessage.request:type_name -> totem.RPC + 7, // 2: stream.DelegatedMessage.target:type_name -> core.Reference + 6, // 3: stream.DelegatedMessageReply.reply:type_name -> totem.RPC + 8, // 4: stream.DelegatedMessageReply.status:type_name -> google.rpc.Status + 6, // 5: stream.BroadcastMessage.request:type_name -> totem.RPC + 9, // 6: stream.BroadcastMessage.targetSelector:type_name -> core.ClusterSelector + 6, // 7: stream.BroadcastReply.responses:type_name -> totem.RPC + 6, // 8: stream.Stream.Connect:input_type -> totem.RPC + 1, // 9: stream.Stream.Notify:input_type -> stream.StreamEvent + 2, // 10: stream.Delegate.Request:input_type -> stream.DelegatedMessage + 4, // 11: stream.Delegate.Broadcast:input_type -> stream.BroadcastMessage + 6, // 12: stream.Stream.Connect:output_type -> totem.RPC + 10, // 13: stream.Stream.Notify:output_type -> google.protobuf.Empty + 6, // 14: stream.Delegate.Request:output_type -> totem.RPC + 5, // 15: stream.Delegate.Broadcast:output_type -> stream.BroadcastReply + 12, // [12:16] is the sub-list for method output_type + 8, // [8:12] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() } @@ -454,6 +507,18 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { return nil } } + file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BroadcastReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -461,7 +526,7 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc, NumEnums: 1, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 2, }, diff --git a/pkg/apis/stream/v1/stream.proto b/pkg/apis/stream/v1/stream.proto index 4b48207422..55fe1b1bd9 100644 --- a/pkg/apis/stream/v1/stream.proto +++ b/pkg/apis/stream/v1/stream.proto @@ -35,10 +35,10 @@ service Delegate { // A best-effort broadcast sent to all connected clients, with an // optional target filter. - rpc Broadcast(BroadcastMessage) returns (google.protobuf.Empty) { - option (totem.qos) = { - replicationStrategy: Broadcast - }; + rpc Broadcast(BroadcastMessage) returns (BroadcastReply) { +// option (totem.qos) = { +// replicationStrategy: Broadcast +// }; } } @@ -56,3 +56,7 @@ message BroadcastMessage { totem.RPC request = 1; core.ClusterSelector targetSelector = 2; } + +message BroadcastReply { + repeated totem.RPC responses = 1; +} \ No newline at end of file diff --git a/pkg/apis/stream/v1/stream_grpc.pb.go b/pkg/apis/stream/v1/stream_grpc.pb.go index d5cd8f3593..4ac36ed308 100644 --- a/pkg/apis/stream/v1/stream_grpc.pb.go +++ b/pkg/apis/stream/v1/stream_grpc.pb.go @@ -187,7 +187,7 @@ type DelegateClient interface { Request(ctx context.Context, in *DelegatedMessage, opts ...grpc.CallOption) (*totem.RPC, error) // A best-effort broadcast sent to all connected clients, with an // optional target filter. - Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) + Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReply, error) } type delegateClient struct { @@ -207,8 +207,8 @@ func (c *delegateClient) Request(ctx context.Context, in *DelegatedMessage, opts return out, nil } -func (c *delegateClient) Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *delegateClient) Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReply, error) { + out := new(BroadcastReply) err := c.cc.Invoke(ctx, "/stream.Delegate/Broadcast", in, out, opts...) if err != nil { return nil, err @@ -224,7 +224,7 @@ type DelegateServer interface { Request(context.Context, *DelegatedMessage) (*totem.RPC, error) // A best-effort broadcast sent to all connected clients, with an // optional target filter. - Broadcast(context.Context, *BroadcastMessage) (*emptypb.Empty, error) + Broadcast(context.Context, *BroadcastMessage) (*BroadcastReply, error) mustEmbedUnimplementedDelegateServer() } @@ -235,7 +235,7 @@ type UnimplementedDelegateServer struct { func (UnimplementedDelegateServer) Request(context.Context, *DelegatedMessage) (*totem.RPC, error) { return nil, status.Errorf(codes.Unimplemented, "method Request not implemented") } -func (UnimplementedDelegateServer) Broadcast(context.Context, *BroadcastMessage) (*emptypb.Empty, error) { +func (UnimplementedDelegateServer) Broadcast(context.Context, *BroadcastMessage) (*BroadcastReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") } func (UnimplementedDelegateServer) mustEmbedUnimplementedDelegateServer() {} diff --git a/pkg/gateway/delegate.go b/pkg/gateway/delegate.go index 143a01f996..7efbefba40 100644 --- a/pkg/gateway/delegate.go +++ b/pkg/gateway/delegate.go @@ -16,7 +16,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/emptypb" ) type agentInfo struct { @@ -34,6 +33,8 @@ func (a agentInfo) GetId() string { return a.id } +//var _ streamv1.DelegateClient = (*DelegateServer)(nil) + type DelegateServer struct { streamv1.UnsafeDelegateServer mu sync.RWMutex @@ -118,7 +119,7 @@ func (d *DelegateServer) Request(ctx context.Context, req *streamv1.DelegatedMes } } -func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastMessage) (*emptypb.Empty, error) { +func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastMessage) (*streamv1.BroadcastReply, error) { d.mu.RLock() defer d.mu.RUnlock() @@ -136,12 +137,21 @@ func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastM } eg, ctx := errgroup.WithContext(ctx) + reply := &streamv1.BroadcastReply{ + Responses: make([]*totem.RPC, len(targets)), + } for _, target := range targets { target := target eg.Go(func() error { - reply := &emptypb.Empty{} - return target.Invoke(ctx, totem.Forward, req.GetRequest(), reply) + item := &totem.RPC{} + if err := target.Invoke(ctx, totem.Forward, req.GetRequest(), item); err != nil { + return err + } + + reply.Responses = append(reply.Responses, item) + + return nil }) } @@ -150,5 +160,5 @@ func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastM return nil, err } - return &emptypb.Empty{}, nil + return reply, nil } diff --git a/pkg/opni/commands/import.go b/pkg/opni/commands/import.go index 36f5a745c0..8c499d428a 100644 --- a/pkg/opni/commands/import.go +++ b/pkg/opni/commands/import.go @@ -386,7 +386,7 @@ func BuildDiscoverCmd() *cobra.Command { return fmt.Errorf("could not start discovery: %w", err) } - cliutil.RenderDiscoveryEntries(response.Entries) + fmt.Println(cliutil.RenderDiscoveryEntries(response.Entries)) return nil }, diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go index 5e726a25a1..af9d2aa02e 100644 --- a/pkg/plugins/apis/apiextensions/stream/delegate.go +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -14,9 +14,12 @@ import ( "google.golang.org/protobuf/proto" ) +// Aggregator allows the user to aggregate the responses from a broadcast request, and store the result in reply. +type Aggregator func(reply interface{}, msg *streamv1.BroadcastReply) error + type StreamDelegate[T any] interface { WithTarget(*corev1.Reference) T - WithBroadcastSelector(*corev1.ClusterSelector) T + WithBroadcastSelector(*corev1.ClusterSelector, Aggregator) T } func NewDelegate[T any](cc grpc.ClientConnInterface, newClientFunc func(grpc.ClientConnInterface) T) StreamDelegate[T] { @@ -38,10 +41,11 @@ func (w *delegatingClient[T]) WithTarget(target *corev1.Reference) T { }) } -func (w *delegatingClient[T]) WithBroadcastSelector(selector *corev1.ClusterSelector) T { +func (w *delegatingClient[T]) WithBroadcastSelector(selector *corev1.ClusterSelector, aggregator Aggregator) T { return w.newClientFunc(&targetedDelegatingClient[T]{ selector: selector, delegateClient: streamv1.NewDelegateClient(w.streamClientIntf), + aggregator: aggregator, }) } @@ -49,6 +53,7 @@ type targetedDelegatingClient[T any] struct { target *corev1.Reference selector *corev1.ClusterSelector delegateClient streamv1.DelegateClient + aggregator Aggregator } // parses a method name of the form "/service/method" @@ -94,13 +99,17 @@ func (w *targetedDelegatingClient[T]) Invoke(ctx context.Context, method string, return status.Errorf(codes.Internal, "failed to unmarshal response: %v", err) } case w.selector != nil: - _, err := w.delegateClient.Broadcast(ctx, &streamv1.BroadcastMessage{ + respMsg, err := w.delegateClient.Broadcast(ctx, &streamv1.BroadcastMessage{ Request: rpc, TargetSelector: w.selector, }, opts...) if err != nil { return err } + + if err := w.aggregator(reply, respMsg); err != nil { + return fmt.Errorf("broadcast aggregator failed: %w", err) + } default: panic("bug: no target or selector given") } diff --git a/plugins/metrics/pkg/agent/discovery.go b/plugins/metrics/pkg/agent/discovery.go index e303ec20c1..253a67a00c 100644 --- a/plugins/metrics/pkg/agent/discovery.go +++ b/plugins/metrics/pkg/agent/discovery.go @@ -46,6 +46,8 @@ func NewPrometheusDiscoverer(config DiscovererConfig) (*PrometheusDiscoverer, er } return &PrometheusDiscoverer{ + DiscovererConfig: config, + kubeClient: kubeClient, promClient: promClient, }, nil diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index f5aa634195..812e53ae71 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -3,12 +3,14 @@ package backend import ( "context" "fmt" + streamv1 "github.com/rancher/opni/pkg/apis/stream/v1" streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" @@ -657,9 +659,31 @@ func (m *MetricsBackend) Stop(ctx context.Context, request *remoteread.StopReadR func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { m.WaitForInit() - response, err := m.Delegate.WithBroadcastSelector(&corev1.ClusterSelector{ ClusterIDs: request.ClusterIds, + }, func(reply interface{}, msg *streamv1.BroadcastReply) error { + discoveryReply := reply.(*remoteread.DiscoveryResponse) + + discoveryReply.Entries = make([]*remoteread.DiscoveryEntry, 0) + + for _, response := range msg.Responses { + discoverResponse := &remoteread.DiscoveryResponse{} + + resp := response.GetResponse() + + if resp == nil { + continue + } + + if err := proto.Unmarshal(resp.Response, discoverResponse); err != nil { + m.Logger.Errorf("failed to unmarshal for aggregated DiscoveryResponse: %s", err) + } + + discoveryReply.Entries = append(discoveryReply.Entries, discoverResponse.Entries...) + _ = resp + } + + return nil }).Discover(ctx, request) if err != nil { From 0967f28b12cb5ae948cec23ac963412f04977623 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 25 Jan 2023 13:20:54 -0500 Subject: [PATCH 24/43] fixes to broadcast aggregation --- pkg/gateway/delegate.go | 2 +- pkg/plugins/apis/apiextensions/stream/delegate.go | 5 +++++ plugins/metrics/pkg/backend/metrics.go | 14 +------------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pkg/gateway/delegate.go b/pkg/gateway/delegate.go index 7efbefba40..697b36988c 100644 --- a/pkg/gateway/delegate.go +++ b/pkg/gateway/delegate.go @@ -138,7 +138,7 @@ func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastM eg, ctx := errgroup.WithContext(ctx) reply := &streamv1.BroadcastReply{ - Responses: make([]*totem.RPC, len(targets)), + Responses: make([]*totem.RPC, 0, len(targets)), } for _, target := range targets { diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go index af9d2aa02e..dede29f6b5 100644 --- a/pkg/plugins/apis/apiextensions/stream/delegate.go +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -17,6 +17,11 @@ import ( // Aggregator allows the user to aggregate the responses from a broadcast request, and store the result in reply. type Aggregator func(reply interface{}, msg *streamv1.BroadcastReply) error +// NothingAggregator is an aggregator to use if you don't need to do any aggregation, or don't care about the response. +var NothingAggregator Aggregator = func(interface{}, *streamv1.BroadcastReply) error { + return nil +} + type StreamDelegate[T any] interface { WithTarget(*corev1.Reference) T WithBroadcastSelector(*corev1.ClusterSelector, Aggregator) T diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index 812e53ae71..a3f12c6a94 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -669,18 +669,11 @@ func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.Disco for _, response := range msg.Responses { discoverResponse := &remoteread.DiscoveryResponse{} - resp := response.GetResponse() - - if resp == nil { - continue - } - - if err := proto.Unmarshal(resp.Response, discoverResponse); err != nil { + if err := proto.Unmarshal(response.GetResponse().Response, discoverResponse); err != nil { m.Logger.Errorf("failed to unmarshal for aggregated DiscoveryResponse: %s", err) } discoveryReply.Entries = append(discoveryReply.Entries, discoverResponse.Entries...) - _ = resp } return nil @@ -695,10 +688,5 @@ func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.Disco return nil, err } - m.Logger.With( - "capability", wellknown.CapabilityMetrics, - zap.Error(err), - ).Error("ran import discovery") - return response, nil } From 2d542ffa79ea5c7d62ae98dcf6c27710831ac8dd Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 25 Jan 2023 15:26:10 -0500 Subject: [PATCH 25/43] small broadcast fixes --- pkg/apis/stream/v1/stream.pb.go | 196 ++++++++++++------ pkg/apis/stream/v1/stream.proto | 13 +- pkg/apis/stream/v1/stream_grpc.pb.go | 10 +- pkg/gateway/delegate.go | 17 +- .../apis/apiextensions/stream/delegate.go | 4 +- plugins/metrics/pkg/agent/node.go | 6 +- plugins/metrics/pkg/backend/metrics.go | 14 +- 7 files changed, 173 insertions(+), 87 deletions(-) diff --git a/pkg/apis/stream/v1/stream.pb.go b/pkg/apis/stream/v1/stream.pb.go index a5b89f7bc6..d3016487d7 100644 --- a/pkg/apis/stream/v1/stream.pb.go +++ b/pkg/apis/stream/v1/stream.pb.go @@ -283,18 +283,66 @@ func (x *BroadcastMessage) GetTargetSelector() *v1.ClusterSelector { return nil } +type BroadcastReplyList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*BroadcastReply `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *BroadcastReplyList) Reset() { + *x = BroadcastReplyList{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BroadcastReplyList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BroadcastReplyList) ProtoMessage() {} + +func (x *BroadcastReplyList) ProtoReflect() protoreflect.Message { + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BroadcastReplyList.ProtoReflect.Descriptor instead. +func (*BroadcastReplyList) Descriptor() ([]byte, []int) { + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{4} +} + +func (x *BroadcastReplyList) GetResponses() []*BroadcastReply { + if x != nil { + return x.Responses + } + return nil +} + type BroadcastReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Responses []*totem.RPC `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` + Ref *v1.Reference `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` + Reply *totem.RPC `protobuf:"bytes,2,opt,name=reply,proto3" json:"reply,omitempty"` } func (x *BroadcastReply) Reset() { *x = BroadcastReply{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -307,7 +355,7 @@ func (x *BroadcastReply) String() string { func (*BroadcastReply) ProtoMessage() {} func (x *BroadcastReply) ProtoReflect() protoreflect.Message { - mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4] + mi := &file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -320,12 +368,19 @@ func (x *BroadcastReply) ProtoReflect() protoreflect.Message { // Deprecated: Use BroadcastReply.ProtoReflect.Descriptor instead. func (*BroadcastReply) Descriptor() ([]byte, []int) { - return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{4} + return file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP(), []int{5} } -func (x *BroadcastReply) GetResponses() []*totem.RPC { +func (x *BroadcastReply) GetRef() *v1.Reference { if x != nil { - return x.Responses + return x.Ref + } + return nil +} + +func (x *BroadcastReply) GetReply() *totem.RPC { + if x != nil { + return x.Reply } return nil } @@ -374,32 +429,38 @@ var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc = []byt 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x22, 0x3a, 0x0a, 0x0e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, - 0x2e, 0x52, 0x50, 0x43, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x2a, - 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, - 0x32, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, 0x07, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, - 0x43, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x84, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, - 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x12, 0x3f, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, - 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, - 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x1a, 0x06, 0x92, 0xf1, 0x04, 0x02, 0x08, 0x01, 0x42, - 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x72, 0x22, 0x4a, 0x0a, 0x12, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, + 0x55, 0x0a, 0x0e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x21, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x03, 0x72, 0x65, 0x66, 0x12, 0x20, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x52, + 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x2a, 0x2f, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, + 0x12, 0x15, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x32, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x25, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x0a, 0x2e, 0x74, + 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, + 0x2e, 0x52, 0x50, 0x43, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, + 0x88, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x1a, 0x0a, 0x2e, 0x74, 0x6f, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x50, 0x43, 0x12, 0x43, 0x0a, + 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1a, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, + 0x22, 0x00, 0x1a, 0x06, 0x92, 0xf1, 0x04, 0x02, 0x08, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x72, + 0x2f, 0x6f, 0x70, 0x6e, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -415,42 +476,45 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDescGZIP() } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_goTypes = []interface{}{ (EventType)(0), // 0: stream.EventType (*StreamEvent)(nil), // 1: stream.StreamEvent (*DelegatedMessage)(nil), // 2: stream.DelegatedMessage (*DelegatedMessageReply)(nil), // 3: stream.DelegatedMessageReply (*BroadcastMessage)(nil), // 4: stream.BroadcastMessage - (*BroadcastReply)(nil), // 5: stream.BroadcastReply - (*totem.RPC)(nil), // 6: totem.RPC - (*v1.Reference)(nil), // 7: core.Reference - (*status.Status)(nil), // 8: google.rpc.Status - (*v1.ClusterSelector)(nil), // 9: core.ClusterSelector - (*emptypb.Empty)(nil), // 10: google.protobuf.Empty + (*BroadcastReplyList)(nil), // 5: stream.BroadcastReplyList + (*BroadcastReply)(nil), // 6: stream.BroadcastReply + (*totem.RPC)(nil), // 7: totem.RPC + (*v1.Reference)(nil), // 8: core.Reference + (*status.Status)(nil), // 9: google.rpc.Status + (*v1.ClusterSelector)(nil), // 10: core.ClusterSelector + (*emptypb.Empty)(nil), // 11: google.protobuf.Empty } var file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_depIdxs = []int32{ 0, // 0: stream.StreamEvent.type:type_name -> stream.EventType - 6, // 1: stream.DelegatedMessage.request:type_name -> totem.RPC - 7, // 2: stream.DelegatedMessage.target:type_name -> core.Reference - 6, // 3: stream.DelegatedMessageReply.reply:type_name -> totem.RPC - 8, // 4: stream.DelegatedMessageReply.status:type_name -> google.rpc.Status - 6, // 5: stream.BroadcastMessage.request:type_name -> totem.RPC - 9, // 6: stream.BroadcastMessage.targetSelector:type_name -> core.ClusterSelector - 6, // 7: stream.BroadcastReply.responses:type_name -> totem.RPC - 6, // 8: stream.Stream.Connect:input_type -> totem.RPC - 1, // 9: stream.Stream.Notify:input_type -> stream.StreamEvent - 2, // 10: stream.Delegate.Request:input_type -> stream.DelegatedMessage - 4, // 11: stream.Delegate.Broadcast:input_type -> stream.BroadcastMessage - 6, // 12: stream.Stream.Connect:output_type -> totem.RPC - 10, // 13: stream.Stream.Notify:output_type -> google.protobuf.Empty - 6, // 14: stream.Delegate.Request:output_type -> totem.RPC - 5, // 15: stream.Delegate.Broadcast:output_type -> stream.BroadcastReply - 12, // [12:16] is the sub-list for method output_type - 8, // [8:12] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 7, // 1: stream.DelegatedMessage.request:type_name -> totem.RPC + 8, // 2: stream.DelegatedMessage.target:type_name -> core.Reference + 7, // 3: stream.DelegatedMessageReply.reply:type_name -> totem.RPC + 9, // 4: stream.DelegatedMessageReply.status:type_name -> google.rpc.Status + 7, // 5: stream.BroadcastMessage.request:type_name -> totem.RPC + 10, // 6: stream.BroadcastMessage.targetSelector:type_name -> core.ClusterSelector + 6, // 7: stream.BroadcastReplyList.responses:type_name -> stream.BroadcastReply + 8, // 8: stream.BroadcastReply.ref:type_name -> core.Reference + 7, // 9: stream.BroadcastReply.reply:type_name -> totem.RPC + 7, // 10: stream.Stream.Connect:input_type -> totem.RPC + 1, // 11: stream.Stream.Notify:input_type -> stream.StreamEvent + 2, // 12: stream.Delegate.Request:input_type -> stream.DelegatedMessage + 4, // 13: stream.Delegate.Broadcast:input_type -> stream.BroadcastMessage + 7, // 14: stream.Stream.Connect:output_type -> totem.RPC + 11, // 15: stream.Stream.Notify:output_type -> google.protobuf.Empty + 7, // 16: stream.Delegate.Request:output_type -> totem.RPC + 5, // 17: stream.Delegate.Broadcast:output_type -> stream.BroadcastReplyList + 14, // [14:18] is the sub-list for method output_type + 10, // [10:14] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() } @@ -508,6 +572,18 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { } } file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BroadcastReplyList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BroadcastReply); i { case 0: return &v.state @@ -526,7 +602,7 @@ func file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_rancher_opni_pkg_apis_stream_v1_stream_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 2, }, diff --git a/pkg/apis/stream/v1/stream.proto b/pkg/apis/stream/v1/stream.proto index 55fe1b1bd9..3d3bec6890 100644 --- a/pkg/apis/stream/v1/stream.proto +++ b/pkg/apis/stream/v1/stream.proto @@ -35,11 +35,7 @@ service Delegate { // A best-effort broadcast sent to all connected clients, with an // optional target filter. - rpc Broadcast(BroadcastMessage) returns (BroadcastReply) { -// option (totem.qos) = { -// replicationStrategy: Broadcast -// }; - } + rpc Broadcast(BroadcastMessage) returns (BroadcastReplyList); } message DelegatedMessage { @@ -57,6 +53,11 @@ message BroadcastMessage { core.ClusterSelector targetSelector = 2; } +message BroadcastReplyList { + repeated BroadcastReply responses = 1; +} + message BroadcastReply { - repeated totem.RPC responses = 1; + core.Reference ref = 1; + totem.RPC reply = 2; } \ No newline at end of file diff --git a/pkg/apis/stream/v1/stream_grpc.pb.go b/pkg/apis/stream/v1/stream_grpc.pb.go index 4ac36ed308..230a4e17ad 100644 --- a/pkg/apis/stream/v1/stream_grpc.pb.go +++ b/pkg/apis/stream/v1/stream_grpc.pb.go @@ -187,7 +187,7 @@ type DelegateClient interface { Request(ctx context.Context, in *DelegatedMessage, opts ...grpc.CallOption) (*totem.RPC, error) // A best-effort broadcast sent to all connected clients, with an // optional target filter. - Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReply, error) + Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReplyList, error) } type delegateClient struct { @@ -207,8 +207,8 @@ func (c *delegateClient) Request(ctx context.Context, in *DelegatedMessage, opts return out, nil } -func (c *delegateClient) Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReply, error) { - out := new(BroadcastReply) +func (c *delegateClient) Broadcast(ctx context.Context, in *BroadcastMessage, opts ...grpc.CallOption) (*BroadcastReplyList, error) { + out := new(BroadcastReplyList) err := c.cc.Invoke(ctx, "/stream.Delegate/Broadcast", in, out, opts...) if err != nil { return nil, err @@ -224,7 +224,7 @@ type DelegateServer interface { Request(context.Context, *DelegatedMessage) (*totem.RPC, error) // A best-effort broadcast sent to all connected clients, with an // optional target filter. - Broadcast(context.Context, *BroadcastMessage) (*BroadcastReply, error) + Broadcast(context.Context, *BroadcastMessage) (*BroadcastReplyList, error) mustEmbedUnimplementedDelegateServer() } @@ -235,7 +235,7 @@ type UnimplementedDelegateServer struct { func (UnimplementedDelegateServer) Request(context.Context, *DelegatedMessage) (*totem.RPC, error) { return nil, status.Errorf(codes.Unimplemented, "method Request not implemented") } -func (UnimplementedDelegateServer) Broadcast(context.Context, *BroadcastMessage) (*BroadcastReply, error) { +func (UnimplementedDelegateServer) Broadcast(context.Context, *BroadcastMessage) (*BroadcastReplyList, error) { return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") } func (UnimplementedDelegateServer) mustEmbedUnimplementedDelegateServer() {} diff --git a/pkg/gateway/delegate.go b/pkg/gateway/delegate.go index 697b36988c..94a3274d5e 100644 --- a/pkg/gateway/delegate.go +++ b/pkg/gateway/delegate.go @@ -119,13 +119,13 @@ func (d *DelegateServer) Request(ctx context.Context, req *streamv1.DelegatedMes } } -func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastMessage) (*streamv1.BroadcastReply, error) { +func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastMessage) (*streamv1.BroadcastReplyList, error) { d.mu.RLock() defer d.mu.RUnlock() sp := storage.NewSelectorPredicate[agentInfo](req.GetTargetSelector()) - var targets []grpc.ClientConnInterface + var targets []agentInfo for _, aa := range d.activeAgents { if sp(aa) { targets = append(targets, aa) @@ -137,11 +137,11 @@ func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastM } eg, ctx := errgroup.WithContext(ctx) - reply := &streamv1.BroadcastReply{ - Responses: make([]*totem.RPC, 0, len(targets)), + reply := &streamv1.BroadcastReplyList{ + Responses: make([]*streamv1.BroadcastReply, len(targets)), } - for _, target := range targets { + for i, target := range targets { target := target eg.Go(func() error { item := &totem.RPC{} @@ -149,7 +149,12 @@ func (d *DelegateServer) Broadcast(ctx context.Context, req *streamv1.BroadcastM return err } - reply.Responses = append(reply.Responses, item) + reply.Responses[i] = &streamv1.BroadcastReply{ + Ref: &corev1.Reference{ + Id: target.id, + }, + Reply: item, + } return nil }) diff --git a/pkg/plugins/apis/apiextensions/stream/delegate.go b/pkg/plugins/apis/apiextensions/stream/delegate.go index dede29f6b5..67795e1e3c 100644 --- a/pkg/plugins/apis/apiextensions/stream/delegate.go +++ b/pkg/plugins/apis/apiextensions/stream/delegate.go @@ -15,10 +15,10 @@ import ( ) // Aggregator allows the user to aggregate the responses from a broadcast request, and store the result in reply. -type Aggregator func(reply interface{}, msg *streamv1.BroadcastReply) error +type Aggregator func(reply interface{}, msg *streamv1.BroadcastReplyList) error // NothingAggregator is an aggregator to use if you don't need to do any aggregation, or don't care about the response. -var NothingAggregator Aggregator = func(interface{}, *streamv1.BroadcastReply) error { +var NothingAggregator Aggregator = func(interface{}, *streamv1.BroadcastReplyList) error { return nil } diff --git a/plugins/metrics/pkg/agent/node.go b/plugins/metrics/pkg/agent/node.go index e030b801ff..edd4ce0bde 100644 --- a/plugins/metrics/pkg/agent/node.go +++ b/plugins/metrics/pkg/agent/node.go @@ -6,7 +6,6 @@ import ( monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/samber/lo" - "k8s.io/client-go/tools/clientcmd" "sort" "strings" "sync" @@ -201,10 +200,8 @@ func (m *MetricsNode) GetTargetStatus(ctx context.Context, request *remoteread.T } func (m *MetricsNode) Discover(ctx context.Context, request *remoteread.DiscoveryRequest) (*remoteread.DiscoveryResponse, error) { - config, err := clientcmd.BuildConfigFromFlags("", "/home/jmeranda/.kube/config") - discoverer, err := NewPrometheusDiscoverer(DiscovererConfig{ - RESTConfig: config, + RESTConfig: nil, Context: ctx, Logger: m.logger.Named("prom-discovery"), }) @@ -225,6 +222,7 @@ func (m *MetricsNode) Discover(ctx context.Context, request *remoteread.Discover entries := lo.Map(prometheuses, func(prometheus *monitoringv1.Prometheus, _ int) *remoteread.DiscoveryEntry { return &remoteread.DiscoveryEntry{ + Name: prometheus.GetName(), ExternalEndpoint: prometheus.Spec.ExternalURL, InternalEndpoint: fmt.Sprintf("%s.%s.svc.cluster.local", prometheus.Name, prometheus.Namespace), } diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index a3f12c6a94..b7e6812038 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -7,6 +7,7 @@ import ( streamext "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" "github.com/rancher/opni/plugins/metrics/pkg/cortex" + "github.com/samber/lo" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -661,18 +662,23 @@ func (m *MetricsBackend) Discover(ctx context.Context, request *remoteread.Disco m.WaitForInit() response, err := m.Delegate.WithBroadcastSelector(&corev1.ClusterSelector{ ClusterIDs: request.ClusterIds, - }, func(reply interface{}, msg *streamv1.BroadcastReply) error { + }, func(reply interface{}, responses *streamv1.BroadcastReplyList) error { discoveryReply := reply.(*remoteread.DiscoveryResponse) - discoveryReply.Entries = make([]*remoteread.DiscoveryEntry, 0) - for _, response := range msg.Responses { + for _, response := range responses.Responses { discoverResponse := &remoteread.DiscoveryResponse{} - if err := proto.Unmarshal(response.GetResponse().Response, discoverResponse); err != nil { + if err := proto.Unmarshal(response.Reply.GetResponse().Response, discoverResponse); err != nil { m.Logger.Errorf("failed to unmarshal for aggregated DiscoveryResponse: %s", err) } + // inject the cluster id gateway-side + lo.Map(discoverResponse.Entries, func(entry *remoteread.DiscoveryEntry, _ int) *remoteread.DiscoveryEntry { + entry.ClusterId = response.Ref.Id + return entry + }) + discoveryReply.Entries = append(discoveryReply.Entries, discoverResponse.Entries...) } From 55aaf01a50efdacf833e8d53859127db5c02ff85 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Wed, 25 Jan 2023 22:48:27 -0500 Subject: [PATCH 26/43] fix target listing issues --- plugins/metrics/pkg/agent/runner.go | 17 ++++------- plugins/metrics/pkg/backend/metrics.go | 40 ++++++++++++++++++++------ 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index 9a3e92fd26..dff3763326 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -21,14 +21,6 @@ import ( "time" ) -func targetIsRunningError(name string) error { - return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", name) -} - -func targetIsNotRunningError(name string) error { - return fmt.Errorf("target '%s' is not running", name) -} - // todo: import prometheus LabelMatcher into plugins/metrics/pkg/apis/remoteread.proto to remove this func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) @@ -239,7 +231,7 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q if found && run.target.Status.State == remoteread.TargetStatus_Running { switch run.target.Status.State { case remoteread.TargetStatus_Running: - return targetIsRunningError(target.Meta.Name) + return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", target.Meta.Name) default: runner.logger.With( "cluster", target.Meta.ClusterId, @@ -281,7 +273,7 @@ func (runner *targetRunner) Stop(name string) error { run, found := runner.runs[name] if !found { - return targetIsNotRunningError(name) + return fmt.Errorf("target '%s' is not running", name) } close(run.stopChan) @@ -303,7 +295,10 @@ func (runner *targetRunner) GetStatus(name string) (*remoteread.TargetStatus, er runner.runsMu.Unlock() if !found { - return nil, targetIsNotRunningError(name) + // the target was added to the gateway but was not started + return &remoteread.TargetStatus{ + State: remoteread.TargetStatus_NotRunning, + }, nil } return run.target.Status, nil diff --git a/plugins/metrics/pkg/backend/metrics.go b/plugins/metrics/pkg/backend/metrics.go index b7e6812038..7cc03dacb2 100644 --- a/plugins/metrics/pkg/backend/metrics.go +++ b/plugins/metrics/pkg/backend/metrics.go @@ -9,6 +9,7 @@ import ( "github.com/rancher/opni/plugins/metrics/pkg/cortex" "github.com/samber/lo" "go.uber.org/zap" + "golang.org/x/sync/errgroup" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" @@ -540,26 +541,39 @@ func (m *MetricsBackend) RemoveTarget(_ context.Context, request *remoteread.Tar func (m *MetricsBackend) ListTargets(ctx context.Context, request *remoteread.TargetListRequest) (*remoteread.TargetList, error) { m.WaitForInit() - m.remoteReadTargetMu.Lock() - defer m.remoteReadTargetMu.Unlock() + m.remoteReadTargetMu.RLock() + defer m.remoteReadTargetMu.RUnlock() // todo: we can probably shrink this later inner := make([]*remoteread.Target, 0, len(m.remoteReadTargets)) + innerMu := sync.RWMutex{} + eg, ctx := errgroup.WithContext(ctx) for _, target := range m.remoteReadTargets { if request.ClusterId == "" || request.ClusterId == target.Meta.ClusterId { - newStatus, err := m.GetTargetStatus(ctx, &remoteread.TargetStatusRequest{Meta: target.Meta}) - if err != nil { - m.Logger.Infof("could not get newStatus for target '%s/%s': %s", target.Meta.ClusterId, target.Meta.Name, err) - newStatus.State = remoteread.TargetStatus_Unknown - } + target := target + eg.Go(func() error { + newStatus, err := m.GetTargetStatus(ctx, &remoteread.TargetStatusRequest{Meta: target.Meta}) + if err != nil { + m.Logger.Infof("could not get newStatus for target '%s/%s': %s", target.Meta.ClusterId, target.Meta.Name, err) + newStatus.State = remoteread.TargetStatus_Unknown + } + + target.Status = newStatus - target.Status = newStatus + innerMu.Lock() + inner = append(inner, target) + innerMu.Unlock() - inner = append(inner, target) + return nil + }) } } + if err := eg.Wait(); err != nil { + m.Logger.Errorf("error waiting for status to update: %s", err) + } + list := &remoteread.TargetList{Targets: inner} return list, nil @@ -568,6 +582,14 @@ func (m *MetricsBackend) ListTargets(ctx context.Context, request *remoteread.Ta func (m *MetricsBackend) GetTargetStatus(ctx context.Context, request *remoteread.TargetStatusRequest) (*remoteread.TargetStatus, error) { m.WaitForInit() + targetId := getIdFromTargetMeta(request.Meta) + + m.remoteReadTargetMu.RLock() + defer m.remoteReadTargetMu.RUnlock() + if _, found := m.remoteReadTargets[targetId]; !found { + return nil, fmt.Errorf("target '%s/%s' does not exist", request.Meta.ClusterId, request.Meta.Name) + } + newStatus, err := m.Delegate.WithTarget(&corev1.Reference{Id: request.Meta.ClusterId}).GetTargetStatus(ctx, request) if err != nil { From 247e6aa0a5336e76a4baf99b393e3658d295f46a Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Tue, 31 Jan 2023 17:48:31 -0500 Subject: [PATCH 27/43] add target runner tests --- pkg/apis/management/v1/management.proto | 2 +- plugins/metrics/pkg/agent/agent_suite_test.go | 13 + plugins/metrics/pkg/agent/http.go | 15 - plugins/metrics/pkg/agent/remoteread.go | 16 +- plugins/metrics/pkg/agent/runner.go | 54 +-- plugins/metrics/pkg/agent/runner_test.go | 330 ++++++++++++++++++ plugins/metrics/pkg/agent/stream.go | 2 - .../pkg/apis/remoteread/remoteread.proto | 2 +- 8 files changed, 383 insertions(+), 51 deletions(-) create mode 100644 plugins/metrics/pkg/agent/agent_suite_test.go create mode 100644 plugins/metrics/pkg/agent/runner_test.go diff --git a/pkg/apis/management/v1/management.proto b/pkg/apis/management/v1/management.proto index a46824aa25..b029ab385f 100644 --- a/pkg/apis/management/v1/management.proto +++ b/pkg/apis/management/v1/management.proto @@ -218,7 +218,7 @@ message ListClustersRequest { } message EditClusterRequest { - core.Reference cluster = 1; + core.Reference cluste4r = 1; map labels = 2; } diff --git a/plugins/metrics/pkg/agent/agent_suite_test.go b/plugins/metrics/pkg/agent/agent_suite_test.go new file mode 100644 index 0000000000..736071df55 --- /dev/null +++ b/plugins/metrics/pkg/agent/agent_suite_test.go @@ -0,0 +1,13 @@ +package agent_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestAgent(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Agent Suite") +} diff --git a/plugins/metrics/pkg/agent/http.go b/plugins/metrics/pkg/agent/http.go index 842e01e24a..6b0739dc98 100644 --- a/plugins/metrics/pkg/agent/http.go +++ b/plugins/metrics/pkg/agent/http.go @@ -67,21 +67,6 @@ func (s *HttpServer) SetRemoteReadClient(client clients.Locker[remoteread.Remote s.remoteReadClient = client } -func (s *HttpServer) SetTargetRunner(runner TargetRunner) { - //s.targetRunnerMu.Lock() - //defer s.targetRunnerMu.Unlock() - // - //s.targetRunner = runner - // - //s.remoteReadClientMu.RLock() - //s.targetRunner.SetRemoteReadClient(s.remoteReadClient) - //s.remoteReadClientMu.RUnlock() - // - //s.remoteWriteClientMu.RLock() - //s.targetRunner.SetRemoteWriteClient(s.remoteWriteClient) - //s.remoteWriteClientMu.RUnlock() -} - func (s *HttpServer) ConfigureRoutes(router *gin.Engine) { router.POST("/api/agent/push", s.handleMetricPushRequest) pprof.Register(router, "/debug/plugin_metrics/pprof") diff --git a/plugins/metrics/pkg/agent/remoteread.go b/plugins/metrics/pkg/agent/remoteread.go index af50b1be73..9a86bf8864 100644 --- a/plugins/metrics/pkg/agent/remoteread.go +++ b/plugins/metrics/pkg/agent/remoteread.go @@ -16,19 +16,23 @@ import ( "time" ) -type RemoteReaderClient struct { - stopChan chan interface{} - prometheusClient *http.Client +type RemoteReader interface { + Read(ctx context.Context, endpoint string, request *prompb.ReadRequest) (*prompb.ReadResponse, error) } -func NewRemoteReaderClient(stopChan chan interface{}, prometheusClient *http.Client) *RemoteReaderClient { - return &RemoteReaderClient{ +func NewRemoteReader(stopChan chan interface{}, prometheusClient *http.Client) RemoteReader { + return &remoteReader{ stopChan: stopChan, prometheusClient: prometheusClient, } } -func (client *RemoteReaderClient) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { +type remoteReader struct { + stopChan chan interface{} + prometheusClient *http.Client +} + +func (client *remoteReader) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { uncompressedData, err := proto.Marshal(readRequest) if err != nil { return nil, fmt.Errorf("unable to marshal remote read readRequest: %w", err) diff --git a/plugins/metrics/pkg/agent/runner.go b/plugins/metrics/pkg/agent/runner.go index dff3763326..c0f831b120 100644 --- a/plugins/metrics/pkg/agent/runner.go +++ b/plugins/metrics/pkg/agent/runner.go @@ -9,8 +9,6 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/snappy" - "github.com/opentracing-contrib/go-stdlib/nethttp" - promConfig "github.com/prometheus/common/config" "github.com/prometheus/prometheus/prompb" "github.com/rancher/opni/pkg/clients" "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" @@ -21,6 +19,8 @@ import ( "time" ) +var TimeDeltaMillis = time.Minute.Milliseconds() + // todo: import prometheus LabelMatcher into plugins/metrics/pkg/apis/remoteread.proto to remove this func toLabelMatchers(rrLabelMatchers []*remoteread.LabelMatcher) []*prompb.LabelMatcher { pbLabelMatchers := make([]*prompb.LabelMatcher, 0, len(rrLabelMatchers)) @@ -89,8 +89,6 @@ func (run *Run) updateLastRead(lastReadSec int64) { run.target.Status.Progress.LastReadTimestamp = timestamppb.New(time.UnixMilli(lastReadSec)) } -// todo: add context - type TargetRunner interface { Start(target *remoteread.Target, query *remoteread.Query) error @@ -99,6 +97,10 @@ type TargetRunner interface { GetStatus(name string) (*remoteread.TargetStatus, error) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) + + SetRemoteReadClient(client clients.Locker[remoteread.RemoteReadGatewayClient]) + + SetRemoteReader(client clients.Locker[RemoteReader]) } func NewTargetRunner(logger *zap.SugaredLogger) TargetRunner { @@ -116,6 +118,7 @@ type targetRunner struct { remoteWriteClient clients.Locker[remotewrite.RemoteWriteClient] remoteReadClient clients.Locker[remoteread.RemoteReadGatewayClient] + remoteReader clients.Locker[RemoteReader] } func (runner *targetRunner) SetRemoteWriteClient(client clients.Locker[remotewrite.RemoteWriteClient]) { @@ -126,7 +129,11 @@ func (runner *targetRunner) SetRemoteReadClient(client clients.Locker[remoteread runner.remoteReadClient = client } -func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) { +func (runner *targetRunner) SetRemoteReader(client clients.Locker[RemoteReader]) { + runner.remoteReader = client +} + +func (runner *targetRunner) run(run Run) { runner.runsMu.Lock() runner.runs[run.target.Meta.Name] = run runner.runsMu.Unlock() @@ -135,8 +142,6 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) // todo: this should probably be more sophisticated than this to handle read size limits importEnd := run.query.EndTimestamp.AsTime().UnixMilli() - nextEndDelta := time.Minute.Milliseconds() * 5 - nextStart := run.query.StartTimestamp.AsTime().UnixMilli() nextEnd := nextStart @@ -150,7 +155,6 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) } defer func() { - // todo: defer this stuff if run.target.Status.State == remoteread.TargetStatus_Running { runner.logger.With( "cluster", run.target.Meta.ClusterId, @@ -163,8 +167,13 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) for nextStart < importEnd && run.target.Status.State == remoteread.TargetStatus_Running { nextStart = nextEnd - nextEnd = nextStart + nextEndDelta - if nextEnd > importEnd { + nextEnd = nextStart + TimeDeltaMillis + + if nextStart >= importEnd { + break + } + + if nextEnd >= importEnd { nextEnd = importEnd } @@ -178,7 +187,11 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) }, } - readResponse, err := remoteReaderClient.Read(context.TODO(), run.target.Spec.Endpoint, readRequest) + var readResponse *prompb.ReadResponse + var err error + runner.remoteReader.Use(func(client RemoteReader) { + readResponse, err = client.Read(context.Background(), run.target.Spec.Endpoint, readRequest) + }) if err != nil { run.failed(fmt.Sprintf("failed to read from target endpoint: %s", err.Error())) @@ -207,7 +220,7 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) } runner.remoteWriteClient.Use(func(remoteWriteClient remotewrite.RemoteWriteClient) { - if _, err := remoteWriteClient.Push(context.TODO(), payload); err != nil { + if _, err := remoteWriteClient.Push(context.Background(), payload); err != nil { run.failed("failed to push to remote write") return } @@ -218,7 +231,7 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) runner.logger.With( "cluster", run.target.Meta.ClusterId, "target", run.target.Meta.Name, - ).Infof("pushed remote write payload: %s", payload.String()) + ).Debugf("pushed remote write payload: %s", payload.String()) } run.updateLastRead(nextEnd) @@ -228,7 +241,7 @@ func (runner *targetRunner) run(run Run, remoteReaderClient *RemoteReaderClient) func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Query) error { // We want to allow for restarting a Failed or Completed. We should not encounter NotRunning, Stopped, or Completed. run, found := runner.runs[target.Meta.Name] - if found && run.target.Status.State == remoteread.TargetStatus_Running { + if found { switch run.target.Status.State { case remoteread.TargetStatus_Running: return fmt.Errorf("target '%s' is running, cannot be removed, modified, or started", target.Meta.Name) @@ -247,18 +260,7 @@ func (runner *targetRunner) Start(target *remoteread.Target, query *remoteread.Q } } - prometheusClient, err := promConfig.NewClientFromConfig(promConfig.HTTPClientConfig{}, fmt.Sprintf("%s-remoteread", run.target.Meta.Name), promConfig.WithHTTP2Disabled()) - if err != nil { - return fmt.Errorf("could not start import: %w", err) - } - - prometheusClient.Transport = &nethttp.Transport{ - RoundTripper: prometheusClient.Transport, - } - - remoteReaderClient := NewRemoteReaderClient(run.stopChan, prometheusClient) - - go runner.run(run, remoteReaderClient) + go runner.run(run) runner.logger.With( "cluster", target.Meta.ClusterId, diff --git a/plugins/metrics/pkg/agent/runner_test.go b/plugins/metrics/pkg/agent/runner_test.go new file mode 100644 index 0000000000..d4ecf84f8d --- /dev/null +++ b/plugins/metrics/pkg/agent/runner_test.go @@ -0,0 +1,330 @@ +package agent + +import ( + "context" + "fmt" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/prometheus/prometheus/prompb" + "github.com/rancher/opni/pkg/clients" + "github.com/rancher/opni/pkg/logger" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread" + "github.com/rancher/opni/plugins/metrics/pkg/apis/remotewrite" + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/timestamppb" + "k8s.io/apimachinery/pkg/util/wait" + "strings" + "time" +) + +type mockRemoteReader struct { + Error error + Responses []*prompb.ReadResponse + i int +} + +func (reader *mockRemoteReader) Read(ctx context.Context, endpoint string, readRequest *prompb.ReadRequest) (*prompb.ReadResponse, error) { + if reader.Error != nil { + return nil, reader.Error + } + + if reader.i >= len(reader.Responses) { + return nil, fmt.Errorf("all reader responses have alaredy been consumed") + } + + response := reader.Responses[reader.i] + reader.i++ + return response, reader.Error +} + +type mockRemoteWriteClient struct { + Payloads []*remotewrite.Payload +} + +func (client *mockRemoteWriteClient) Push(ctx context.Context, in *remotewrite.Payload, opts ...grpc.CallOption) (*emptypb.Empty, error) { + client.Payloads = append(client.Payloads, in) + return &emptypb.Empty{}, nil +} + +func (client *mockRemoteWriteClient) SyncRules(ctx context.Context, in *remotewrite.Payload, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return &emptypb.Empty{}, nil +} + +type mockRemoteReadGatewayClient struct { +} + +func (client *mockRemoteReadGatewayClient) AddTarget(ctx context.Context, in *remoteread.TargetAddRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) EditTarget(ctx context.Context, in *remoteread.TargetEditRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) RemoveTarget(ctx context.Context, in *remoteread.TargetRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) ListTargets(ctx context.Context, in *remoteread.TargetListRequest, opts ...grpc.CallOption) (*remoteread.TargetList, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) Start(ctx context.Context, in *remoteread.StartReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) Stop(ctx context.Context, in *remoteread.StopReadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) GetTargetStatus(ctx context.Context, in *remoteread.TargetStatusRequest, opts ...grpc.CallOption) (*remoteread.TargetStatus, error) { + return nil, nil +} + +func (client *mockRemoteReadGatewayClient) Discover(ctx context.Context, in *remoteread.DiscoveryRequest, opts ...grpc.CallOption) (*remoteread.DiscoveryResponse, error) { + return nil, nil +} + +var _ = Describe("Target Runner", Ordered, Label("integration"), func() { + var ( + runner TargetRunner + target *remoteread.Target + + writerClient *mockRemoteWriteClient + readClient *mockRemoteReadGatewayClient + remoteReader *mockRemoteReader + ) + + BeforeEach(func() { + lg := logger.NewPluginLogger().Named("test-runner") + + writerClient = &mockRemoteWriteClient{} + readClient = &mockRemoteReadGatewayClient{} + remoteReader = &mockRemoteReader{ + Responses: []*prompb.ReadResponse{ + { + Results: []*prompb.QueryResult{ + { + Timeseries: []*prompb.TimeSeries{ + { + Labels: []prompb.Label{}, + Samples: []prompb.Sample{ + { + Value: 100, + Timestamp: 100, + }, + }, + Exemplars: []prompb.Exemplar{ + { + Labels: nil, + Value: 0, + Timestamp: 0, + }, + }, + }, + }, + }, + }, + }, + }, + } + + runner = NewTargetRunner(lg) + runner.SetRemoteWriteClient(clients.NewLocker(nil, func(connInterface grpc.ClientConnInterface) remotewrite.RemoteWriteClient { + return writerClient + })) + runner.SetRemoteReadClient(clients.NewLocker(nil, func(connInterface grpc.ClientConnInterface) remoteread.RemoteReadGatewayClient { + return readClient + })) + runner.SetRemoteReader(clients.NewLocker(nil, func(connInterface grpc.ClientConnInterface) RemoteReader { + return remoteReader + })) + + target = &remoteread.Target{ + Meta: &remoteread.TargetMeta{ + Name: "test", + ClusterId: "00000-00000", + }, + Spec: &remoteread.TargetSpec{ + Endpoint: "http://127.0.0.1:9090/api/v1/read", + }, + Status: nil, + } + }) + + When("target runner cannot reach target endpoint", func() { + It("should fail", func() { + remoteReader := clients.NewLocker(nil, func(connInterface grpc.ClientConnInterface) RemoteReader { + return &mockRemoteReader{ + Error: fmt.Errorf("failed"), + } + }) + runner.SetRemoteReader(remoteReader) + + err := runner.Start( + target, + &remoteread.Query{ + StartTimestamp: ×tamppb.Timestamp{}, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), // ensures only 1 import cycle will occur + }, + Matchers: nil, + }) + Expect(err).NotTo(HaveOccurred()) + + var status *remoteread.TargetStatus + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + wait.UntilWithContext(ctx, func(context.Context) { + status, err = runner.GetStatus(target.Meta.Name) + if status != nil && status.State == remoteread.TargetStatus_Failed { + cancel() + } + }, time.Millisecond*100) + + if err := ctx.Err(); err != nil && !strings.Contains(err.Error(), "context canceled") { + Fail("waiting for expected state failed") + } + + expected := &remoteread.TargetStatus{ + Progress: &remoteread.TargetProgress{ + StartTimestamp: ×tamppb.Timestamp{}, + LastReadTimestamp: nil, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), + }, + }, + Message: "failed to read from target endpoint: failed", + State: remoteread.TargetStatus_Failed, + } + + Expect(expected).To(Equal(status)) + + remoteReader = clients.NewLocker(nil, func(connInterface grpc.ClientConnInterface) RemoteReader { + return &mockRemoteReader{ + Responses: []*prompb.ReadResponse{ + { + Results: []*prompb.QueryResult{ + { + Timeseries: []*prompb.TimeSeries{ + { + Labels: []prompb.Label{}, + Samples: []prompb.Sample{ + { + Value: 100, + Timestamp: 100, + }, + }, + Exemplars: []prompb.Exemplar{ + { + Labels: nil, + Value: 0, + Timestamp: 0, + }, + }, + }, + }, + }, + }, + }, + }, + } + }) + runner.SetRemoteReader(remoteReader) + + // todo: test restarting the target + err = runner.Start( + target, + &remoteread.Query{ + StartTimestamp: ×tamppb.Timestamp{}, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), // ensures only 1 import cycle will occur + }, + Matchers: nil, + }) + Expect(err).NotTo(HaveOccurred()) + + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + wait.UntilWithContext(ctx, func(context.Context) { + status, err = runner.GetStatus(target.Meta.Name) + + Expect(err).ToNot(HaveOccurred()) + + if status.State == remoteread.TargetStatus_Complete { + cancel() + } + }, time.Millisecond*100) + + if err := ctx.Err(); err != nil && !strings.Contains(err.Error(), "context canceled") { + Fail(fmt.Sprintf("waiting for expected state failed: %s", err)) + } + + expected = &remoteread.TargetStatus{ + Progress: &remoteread.TargetProgress{ + StartTimestamp: ×tamppb.Timestamp{}, + LastReadTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), + }, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), + }, + }, + Message: "", + State: remoteread.TargetStatus_Complete, + } + + Expect(expected).To(Equal(status)) + Expect(len(writerClient.Payloads)).To(Equal(1)) + }) + }) + + When("target runner can reach target endpoint", func() { + It("should complete", func() { + err := runner.Start( + target, + &remoteread.Query{ + StartTimestamp: ×tamppb.Timestamp{}, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), // ensures only 1 import cycle will occur + }, + Matchers: nil, + }) + Expect(err).NotTo(HaveOccurred()) + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + var status *remoteread.TargetStatus + + wait.UntilWithContext(ctx, func(context.Context) { + status, err = runner.GetStatus(target.Meta.Name) + + Expect(err).ToNot(HaveOccurred()) + + if status.State == remoteread.TargetStatus_Complete { + cancel() + } + }, time.Millisecond*100) + + if err := ctx.Err(); err != nil && !strings.Contains(err.Error(), "context canceled") { + Fail(fmt.Sprintf("waiting for expected state failed: %s", err)) + } + + expected := &remoteread.TargetStatus{ + Progress: &remoteread.TargetProgress{ + StartTimestamp: ×tamppb.Timestamp{}, + LastReadTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), + }, + EndTimestamp: ×tamppb.Timestamp{ + Seconds: TimeDeltaMillis / 2 / time.Second.Milliseconds(), + }, + }, + Message: "", + State: remoteread.TargetStatus_Complete, + } + + Expect(expected).To(Equal(status)) + Expect(len(writerClient.Payloads)).To(Equal(1)) + }) + }) +}) diff --git a/plugins/metrics/pkg/agent/stream.go b/plugins/metrics/pkg/agent/stream.go index f11146853a..d1b3beb4da 100644 --- a/plugins/metrics/pkg/agent/stream.go +++ b/plugins/metrics/pkg/agent/stream.go @@ -25,14 +25,12 @@ func (p *Plugin) StreamServers() []streamext.Server { } func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface) { - //runner := NewTargetRunner(p.logger.Named("runner")) nodeClient := node.NewNodeMetricsCapabilityClient(cc) healthListenerClient := controlv1.NewHealthListenerClient(cc) identityClient := controlv1.NewIdentityClient(cc) p.httpServer.SetRemoteWriteClient(clients.NewLocker(cc, remotewrite.NewRemoteWriteClient)) p.httpServer.SetRemoteReadClient(clients.NewLocker(cc, remoteread.NewRemoteReadGatewayClient)) - //p.httpServer.SetTargetRunner(runner) p.ruleStreamer.SetRemoteWriteClient(remotewrite.NewRemoteWriteClient(cc)) p.node.SetNodeClient(nodeClient) diff --git a/plugins/metrics/pkg/apis/remoteread/remoteread.proto b/plugins/metrics/pkg/apis/remoteread/remoteread.proto index f53ce11714..573fda1fae 100644 --- a/plugins/metrics/pkg/apis/remoteread/remoteread.proto +++ b/plugins/metrics/pkg/apis/remoteread/remoteread.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.cim/rancher/opni/plugins/metrics/pkg/apis/remoteread"; +option go_package = "github.com/rancher/opni/plugins/metrics/pkg/apis/remoteread"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; From 01263af5765b6de3e3512c482e5275e1243aeed5 Mon Sep 17 00:00:00 2001 From: joshmeranda Date: Tue, 31 Jan 2023 21:51:24 -0500 Subject: [PATCH 28/43] add discovery tests --- .../prometheuses.monitoring.coreos.yaml | 8931 +++++++++++++++++ plugins/metrics/pkg/agent/discovery.go | 22 +- plugins/metrics/pkg/agent/node.go | 12 +- .../plugins/metrics}/agent_suite_test.go | 4 +- test/plugins/metrics/discovery_test.go | 136 + .../plugins/metrics}/runner_test.go | 52 +- 6 files changed, 9111 insertions(+), 46 deletions(-) create mode 100644 config/crd/prometheus/prometheuses.monitoring.coreos.yaml rename {plugins/metrics/pkg/agent => test/plugins/metrics}/agent_suite_test.go (74%) create mode 100644 test/plugins/metrics/discovery_test.go rename {plugins/metrics/pkg/agent => test/plugins/metrics}/runner_test.go (90%) diff --git a/config/crd/prometheus/prometheuses.monitoring.coreos.yaml b/config/crd/prometheus/prometheuses.monitoring.coreos.yaml new file mode 100644 index 0000000000..33814282c4 --- /dev/null +++ b/config/crd/prometheus/prometheuses.monitoring.coreos.yaml @@ -0,0 +1,8931 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.2 + creationTimestamp: null + name: prometheuses.monitoring.coreos.com +spec: + group: monitoring.coreos.com + names: + categories: + - prometheus-operator + kind: Prometheus + listKind: PrometheusList + plural: prometheuses + shortNames: + - prom + singular: prometheus + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The version of Prometheus + jsonPath: .spec.version + name: Version + type: string + - description: The number of desired replicas + jsonPath: .spec.replicas + name: Desired + type: integer + - description: The number of ready replicas + jsonPath: .status.availableReplicas + name: Ready + type: integer + - jsonPath: .status.conditions[?(@.type == 'Reconciled')].status + name: Reconciled + type: string + - jsonPath: .status.conditions[?(@.type == 'Available')].status + name: Available + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Whether the resource reconciliation is paused or not + jsonPath: .status.paused + name: Paused + priority: 1 + type: boolean + name: v1 + schema: + openAPIV3Schema: + description: Prometheus defines a Prometheus deployment. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: 'Specification of the desired behavior of the Prometheus + cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + additionalAlertManagerConfigs: + description: 'AdditionalAlertManagerConfigs allows specifying a key + of a Secret containing additional Prometheus AlertManager configurations. + AlertManager configurations specified are appended to the configurations + generated by the Prometheus Operator. Job configurations specified + must have the form as specified in the official Prometheus documentation: + https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config. + As AlertManager configs are appended, the user is responsible to + make sure it is valid. Note that using this feature may expose the + possibility to break upgrades of Prometheus. It is advised to review + Prometheus release notes to ensure that no incompatible AlertManager + configs are going to break Prometheus after the upgrade.' + properties: + key: + description: The key of the secret to select from. Must be a + valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + additionalAlertRelabelConfigs: + description: 'AdditionalAlertRelabelConfigs allows specifying a key + of a Secret containing additional Prometheus alert relabel configurations. + Alert relabel configurations specified are appended to the configurations + generated by the Prometheus Operator. Alert relabel configurations + specified must have the form as specified in the official Prometheus + documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs. + As alert relabel configs are appended, the user is responsible to + make sure it is valid. Note that using this feature may expose the + possibility to break upgrades of Prometheus. It is advised to review + Prometheus release notes to ensure that no incompatible alert relabel + configs are going to break Prometheus after the upgrade.' + properties: + key: + description: The key of the secret to select from. Must be a + valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + additionalArgs: + description: AdditionalArgs allows setting additional arguments for + the Prometheus container. It is intended for e.g. activating hidden + flags which are not supported by the dedicated configuration options + yet. The arguments are passed as-is to the Prometheus container + which may cause issues if they are invalid or not supported by the + given Prometheus version. In case of an argument conflict (e.g. + an argument which is already set by the operator itself) or when + providing an invalid argument the reconciliation will fail and an + error will be logged. + items: + description: Argument as part of the AdditionalArgs list. + properties: + name: + description: Name of the argument, e.g. "scrape.discovery-reload-interval". + minLength: 1 + type: string + value: + description: Argument value, e.g. 30s. Can be empty for name-only + arguments (e.g. --storage.tsdb.no-lockfile) + type: string + required: + - name + type: object + type: array + additionalScrapeConfigs: + description: 'AdditionalScrapeConfigs allows specifying a key of a + Secret containing additional Prometheus scrape configurations. Scrape + configurations specified are appended to the configurations generated + by the Prometheus Operator. Job configurations specified must have + the form as specified in the official Prometheus documentation: + https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. + As scrape configs are appended, the user is responsible to make + sure it is valid. Note that using this feature may expose the possibility + to break upgrades of Prometheus. It is advised to review Prometheus + release notes to ensure that no incompatible scrape configs are + going to break Prometheus after the upgrade.' + properties: + key: + description: The key of the secret to select from. Must be a + valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + affinity: + description: If specified, the pod's scheduling constraints. + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + weight: + description: Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + x-kubernetes-map-type: atomic + type: array + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied to the + union of the namespaces selected by this field and + the ones listed in the namespaces field. null selector + and null or empty namespaces list means "this pod's + namespace". An empty selector ({}) matches all namespaces. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + description: namespaces specifies a static list of namespace + names that the term applies to. The term is applied + to the union of the namespaces listed in this field + and the ones selected by namespaceSelector. null or + empty namespaces list and null namespaceSelector means + "this pod's namespace". + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + alerting: + description: Define details regarding alerting. + properties: + alertmanagers: + description: AlertmanagerEndpoints Prometheus should fire alerts + against. + items: + description: AlertmanagerEndpoints defines a selection of a + single Endpoints object containing alertmanager IPs to fire + alerts against. + properties: + apiVersion: + description: Version of the Alertmanager API that Prometheus + uses to send alerts. It can be "v1" or "v2". + type: string + authorization: + description: Authorization section for this alertmanager + endpoint + properties: + credentials: + description: The secret's key that contains the credentials + of the request + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: + description: Set the authentication type. Defaults to + Bearer, Basic will cause an error + type: string + type: object + basicAuth: + description: BasicAuth allow an endpoint to authenticate + over basic authentication + properties: + password: + description: The secret in the service monitor namespace + that contains the password for authentication. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + username: + description: The secret in the service monitor namespace + that contains the username for authentication. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + bearerTokenFile: + description: BearerTokenFile to read from filesystem to + use when authenticating to Alertmanager. + type: string + enableHttp2: + description: Whether to enable HTTP2. + type: boolean + name: + description: Name of Endpoints object in Namespace. + type: string + namespace: + description: Namespace of Endpoints object. + type: string + pathPrefix: + description: Prefix for the HTTP path alerts are pushed + to. + type: string + port: + anyOf: + - type: integer + - type: string + description: Port the Alertmanager API is exposed on. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use when firing alerts. + type: string + timeout: + description: Timeout is a per-target Alertmanager timeout + when pushing alerts. + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + tlsConfig: + description: TLS Config to use for alertmanager connection. + properties: + ca: + description: Certificate authority used when verifying + server certificates. + properties: + configMap: + description: ConfigMap containing data to use for + the targets. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or + its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the + targets. + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + caFile: + description: Path to the CA cert in the Prometheus container + to use for the targets. + type: string + cert: + description: Client certificate to present when doing + client-authentication. + properties: + configMap: + description: ConfigMap containing data to use for + the targets. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or + its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the + targets. + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + certFile: + description: Path to the client cert file in the Prometheus + container for the targets. + type: string + insecureSkipVerify: + description: Disable target certificate validation. + type: boolean + keyFile: + description: Path to the client key file in the Prometheus + container for the targets. + type: string + keySecret: + description: Secret containing the client key file for + the targets. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + serverName: + description: Used to verify the hostname for the targets. + type: string + type: object + required: + - name + - namespace + - port + type: object + type: array + required: + - alertmanagers + type: object + allowOverlappingBlocks: + description: AllowOverlappingBlocks enables vertical compaction and + vertical query merge in Prometheus. This is still experimental in + Prometheus so it may change in any upcoming release. + type: boolean + apiserverConfig: + description: APIServerConfig allows specifying a host and auth methods + to access apiserver. If left empty, Prometheus is assumed to run + inside of the cluster and will discover API servers automatically + and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/. + properties: + authorization: + description: Authorization section for accessing apiserver + properties: + credentials: + description: The secret's key that contains the credentials + of the request + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + credentialsFile: + description: File to read a secret from, mutually exclusive + with Credentials (from SafeAuthorization) + type: string + type: + description: Set the authentication type. Defaults to Bearer, + Basic will cause an error + type: string + type: object + basicAuth: + description: BasicAuth allow an endpoint to authenticate over + basic authentication + properties: + password: + description: The secret in the service monitor namespace that + contains the password for authentication. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + username: + description: The secret in the service monitor namespace that + contains the username for authentication. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + bearerToken: + description: Bearer token for accessing apiserver. + type: string + bearerTokenFile: + description: File to read bearer token for accessing apiserver. + type: string + host: + description: Host of apiserver. A valid string consisting of a + hostname or IP followed by an optional port number + type: string + tlsConfig: + description: TLS Config to use for accessing apiserver. + properties: + ca: + description: Certificate authority used when verifying server + certificates. + properties: + configMap: + description: ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + caFile: + description: Path to the CA cert in the Prometheus container + to use for the targets. + type: string + cert: + description: Client certificate to present when doing client-authentication. + properties: + configMap: + description: ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + certFile: + description: Path to the client cert file in the Prometheus + container for the targets. + type: string + insecureSkipVerify: + description: Disable target certificate validation. + type: boolean + keyFile: + description: Path to the client key file in the Prometheus + container for the targets. + type: string + keySecret: + description: Secret containing the client key file for the + targets. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + serverName: + description: Used to verify the hostname for the targets. + type: string + type: object + required: + - host + type: object + arbitraryFSAccessThroughSMs: + description: ArbitraryFSAccessThroughSMs configures whether configuration + based on a service monitor can access arbitrary files on the file + system of the Prometheus container e.g. bearer token files. + properties: + deny: + type: boolean + type: object + baseImage: + description: 'Base image to use for a Prometheus deployment. Deprecated: + use ''image'' instead' + type: string + configMaps: + description: ConfigMaps is a list of ConfigMaps in the same namespace + as the Prometheus object, which shall be mounted into the Prometheus + Pods. Each ConfigMap is added to the StatefulSet definition as a + volume named `configmap-`. The ConfigMaps are mounted + into /etc/prometheus/configmaps/ in the 'prometheus' + container. + items: + type: string + type: array + containers: + description: 'Containers allows injecting additional containers or + modifying operator generated containers. This can be used to allow + adding an authentication proxy to a Prometheus pod or to change + the behavior of an operator generated container. Containers described + here modify an operator generated container if they share the same + name and modifications are done via a strategic merge patch. The + current container names are: `prometheus`, `config-reloader`, and + `thanos-sidecar`. Overriding containers is entirely outside the + scope of what the maintainers will support and by doing so, you + accept that this behaviour may break at any time without notice.' + items: + description: A single application container that you want to run + within a pod. + properties: + args: + description: 'Arguments to the entrypoint. The container image''s + CMD is used if this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. If a variable + cannot be resolved, the reference in the input string will + be unchanged. Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references + will never be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + command: + description: 'Entrypoint array. Not executed within a shell. + The container image''s ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container''s + environment. If a variable cannot be resolved, the reference + in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: + i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether + the variable exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + env: + description: List of environment variables to set in the container. + Cannot be updated. + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be + a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. + If a variable cannot be resolved, the reference in the + input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) + syntax: i.e. "$$(VAR_NAME)" will produce the string + literal "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable exists + or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or + its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + description: List of sources to populate environment variables + in the container. The keys defined within a source must be + a C_IDENTIFIER. All invalid keys will be reported as an event + when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take + precedence. Values defined by an Env with a duplicate key + will take precedence. Cannot be updated. + items: + description: EnvFromSource represents the source of a set + of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap must be + defined + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + description: An optional identifier to prepend to each + key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management + to default or override container images in workload controllers + like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system should take + in response to container lifecycle events. Cannot be updated. + properties: + postStart: + description: 'PostStart is called immediately after a container + is created. If the handler fails, the container is terminated + and restarted according to its restart policy. Other management + of the container blocks until the hook completes. More + info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's + filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need + to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is + unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is NOT supported + as a LifecycleHandler and kept for the backward compatibility. + There are no validation of this field and lifecycle + hooks will fail in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + description: 'PreStop is called immediately before a container + is terminated due to an API request or management event + such as liveness/startup probe failure, preemption, resource + contention, etc. The handler is not called if the container + crashes or exits. The Pod''s termination grace period + countdown begins before the PreStop hook is executed. + Regardless of the outcome of the handler, the container + will eventually terminate within the Pod''s termination + grace period (unless delayed by finalizers). Other management + of the container blocks until the hook completes or until + the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's + filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need + to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is + unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is NOT supported + as a LifecycleHandler and kept for the backward compatibility. + There are no validation of this field and lifecycle + hooks will fail in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container liveness. Container + will be restarted if the probe fails. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + name: + description: Name of the container specified as a DNS_LABEL. + Each container in a pod must have a unique name (DNS_LABEL). + Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. Not + specifying a port here DOES NOT prevent that port from being + exposed. Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from the network. + Modifying this array with strategic merge patch may corrupt + the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + Cannot be updated. + items: + description: ContainerPort represents a network port in a + single container. + properties: + containerPort: + description: Number of port to expose on the pod's IP + address. This must be a valid port number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the external port to. + type: string + hostPort: + description: Number of port to expose on the host. If + specified, this must be a valid port number, 0 < x < + 65536. If HostNetwork is specified, this must match + ContainerPort. Most containers do not need this. + format: int32 + type: integer + name: + description: If specified, this must be an IANA_SVC_NAME + and unique within the pod. Each named port in a pod + must have a unique name. Name for the port that can + be referred to by services. + type: string + protocol: + default: TCP + description: Protocol for port. Must be UDP, TCP, or SCTP. + Defaults to "TCP". + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe + fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by this container. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + securityContext: + description: 'SecurityContext defines the security options the + container should be run with. If set, the fields of SecurityContext + override the equivalent fields of PodSecurityContext. More + info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether + a process can gain more privileges than its parent process. + This bool directly controls if the no_new_privs flag will + be set on the container process. AllowPrivilegeEscalation + is true always when the container is: 1) run as Privileged + 2) has CAP_SYS_ADMIN Note that this field cannot be set + when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. Note that this field cannot be + set when spec.os.name is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + type: object + privileged: + description: Run container in privileged mode. Processes + in privileged containers are essentially equivalent to + root on the host. Defaults to false. Note that this field + cannot be set when spec.os.name is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to + use for the containers. The default is DefaultProcMount + which uses the container runtime defaults for readonly + paths and masked paths. This requires the ProcMountType + feature flag to be enabled. Note that this field cannot + be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root + filesystem. Default is false. Note that this field cannot + be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container + process. Uses runtime default if unset. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when + spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a + non-root user. If true, the Kubelet will validate the + image at runtime to ensure that it does not run as UID + 0 (root) and fail to start the container if it does. If + unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container + process. Defaults to user specified in image metadata + if unspecified. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a + random SELinux context for each container. May also be + set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when + spec.os.name is windows. + properties: + level: + description: Level is SELinux level label that applies + to the container. + type: string + role: + description: Role is a SELinux role label that applies + to the container. + type: string + type: + description: Type is a SELinux type label that applies + to the container. + type: string + user: + description: User is a SELinux user label that applies + to the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use by this container. + If seccomp options are provided at both the pod & container + level, the container options override the pod options. + Note that this field cannot be set when spec.os.name is + windows. + properties: + localhostProfile: + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile + must be preconfigured on the node to work. Must be + a descending path, relative to the kubelet's configured + seccomp profile location. Must only be set if type + is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - + a profile defined in a file on the node should be + used. RuntimeDefault - the container runtime default + profile should be used. Unconfined - no profile should + be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings applied to all + containers. If unspecified, the options from the PodSecurityContext + will be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + Note that this field cannot be set when spec.os.name is + linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named + by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the + GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should + be run as a 'Host Process' container. This field is + alpha-level and will only be honored by components + that enable the WindowsHostProcessContainers feature + flag. Setting this field without the feature flag + will result in errors when validating the Pod. All + of a Pod's containers must have the same effective + HostProcess value (it is not allowed to have a mix + of HostProcess containers and non-HostProcess containers). In + addition, if HostProcess is true then HostNetwork + must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'StartupProbe indicates that the Pod has successfully + initialized. If specified, no other probes are executed until + this completes successfully. If this probe fails, the Pod + will be restarted, just as if the livenessProbe failed. This + can be used to provide different probe parameters at the beginning + of a Pod''s lifecycle, when it might take a long time to load + data or warm a cache, than during steady-state operation. + This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + stdin: + description: Whether this container should allocate a buffer + for stdin in the container runtime. If this is not set, reads + from stdin in the container will always result in EOF. Default + is false. + type: boolean + stdinOnce: + description: Whether the container runtime should close the + stdin channel after it has been opened by a single attach. + When stdin is true the stdin stream will remain open across + multiple attach sessions. If stdinOnce is set to true, stdin + is opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin + will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to which the + container''s termination message will be written is mounted + into the container''s filesystem. Message written is intended + to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. + The total message length across all containers will be limited + to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message should be + populated. File will use the contents of terminationMessagePath + to populate the container status message on both success and + failure. FallbackToLogsOnError will use the last chunk of + container log output if the termination message file is empty + and the container exited with an error. The log output is + limited to 2048 bytes or 80 lines, whichever is smaller. Defaults + to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate a TTY for + itself, also requires 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block devices to be + used by the container. + items: + description: volumeDevice describes a mapping of a raw block + device within a container. + properties: + devicePath: + description: devicePath is the path inside of the container + that the device will be mapped to. + type: string + name: + description: name must match the name of a persistentVolumeClaim + in the pod + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + description: Pod volumes to mount into the container's filesystem. + Cannot be updated. + items: + description: VolumeMount describes a mounting of a Volume + within a container. + properties: + mountPath: + description: Path within the container at which the volume + should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are + propagated from the host to container and the other + way around. When not set, MountPropagationNone is used. + This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise + (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which + the container's volume should be mounted. Behaves similarly + to SubPath but environment variable references $(VAR_NAME) + are expanded using the container's environment. Defaults + to "" (volume's root). SubPathExpr and SubPath are mutually + exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + description: Container's working directory. If not specified, + the container runtime's default will be used, which might + be configured in the container image. Cannot be updated. + type: string + required: + - name + type: object + type: array + disableCompaction: + description: Disable prometheus compaction. + type: boolean + enableAdminAPI: + description: 'Enable access to prometheus web admin API. Defaults + to the value of `false`. WARNING: Enabling the admin APIs enables + mutating endpoints, to delete data, shutdown Prometheus, and more. + Enabling this should be done with care and the user is advised to + add additional authentication authorization via a proxy to ensure + only clients authorized to perform these actions can do so. For + more information see https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis' + type: boolean + enableFeatures: + description: Enable access to Prometheus disabled features. By default, + no features are enabled. Enabling disabled features is entirely + outside the scope of what the maintainers will support and by doing + so, you accept that this behaviour may break at any time without + notice. For more information see https://prometheus.io/docs/prometheus/latest/disabled_features/ + items: + type: string + type: array + enableRemoteWriteReceiver: + description: 'Enable Prometheus to be used as a receiver for the Prometheus + remote write protocol. Defaults to the value of `false`. WARNING: + This is not considered an efficient way of ingesting samples. Use + it with caution for specific low-volume use cases. It is not suitable + for replacing the ingestion via scraping and turning Prometheus + into a push-based metrics collection system. For more information + see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver + Only valid in Prometheus versions 2.33.0 and newer.' + type: boolean + enforcedBodySizeLimit: + description: 'EnforcedBodySizeLimit defines the maximum size of uncompressed + response body that will be accepted by Prometheus. Targets responding + with a body larger than this many bytes will cause the scrape to + fail. Example: 100MB. If defined, the limit will apply to all service/pod + monitors and probes. This is an experimental feature, this behaviour + could change or be removed in the future. Only valid in Prometheus + versions 2.28.0 and newer.' + pattern: (^0|([0-9]*[.])?[0-9]+((K|M|G|T|E|P)i?)?B)$ + type: string + enforcedLabelLimit: + description: Per-scrape limit on number of labels that will be accepted + for a sample. If more than this number of labels are present post + metric-relabeling, the entire scrape will be treated as failed. + 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. + format: int64 + type: integer + enforcedLabelNameLengthLimit: + description: Per-scrape limit on length of labels name that will be + accepted for a sample. If a label name is longer than this number + post metric-relabeling, the entire scrape will be treated as failed. + 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. + format: int64 + type: integer + enforcedLabelValueLengthLimit: + description: Per-scrape limit on length of labels value that will + be accepted for a sample. If a label value is longer than this number + post metric-relabeling, the entire scrape will be treated as failed. + 0 means no limit. Only valid in Prometheus versions 2.27.0 and newer. + format: int64 + type: integer + enforcedNamespaceLabel: + description: "EnforcedNamespaceLabel If set, a label will be added + to \n 1. all user-metrics (created by `ServiceMonitor`, `PodMonitor` + and `Probe` objects) and 2. in all `PrometheusRule` objects (except + the ones excluded in `prometheusRulesExcludedFromEnforce`) to * + alerting & recording rules and * the metrics used in their expressions + (`expr`). \n Label name is this field's value. Label value is the + namespace of the created object (mentioned above)." + type: string + enforcedSampleLimit: + description: EnforcedSampleLimit defines global limit on number of + scraped samples that will be accepted. This overrides any SampleLimit + set per ServiceMonitor or/and PodMonitor. It is meant to be used + by admins to enforce the SampleLimit to keep overall number of samples/series + under the desired limit. Note that if SampleLimit is lower that + value will be taken instead. + format: int64 + type: integer + enforcedTargetLimit: + description: EnforcedTargetLimit defines a global limit on the number + of scraped targets. This overrides any TargetLimit set per ServiceMonitor + or/and PodMonitor. It is meant to be used by admins to enforce + the TargetLimit to keep the overall number of targets under the + desired limit. Note that if TargetLimit is lower, that value will + be taken instead, except if either value is zero, in which case + the non-zero value will be used. If both values are zero, no limit + is enforced. + format: int64 + type: integer + evaluationInterval: + default: 30s + description: 'Interval between consecutive evaluations. Default: `30s`' + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + excludedFromEnforcement: + description: List of references to PodMonitor, ServiceMonitor, Probe + and PrometheusRule objects to be excluded from enforcing a namespace + label of origin. Applies only if enforcedNamespaceLabel set to true. + items: + description: ObjectReference references a PodMonitor, ServiceMonitor, + Probe or PrometheusRule object. + properties: + group: + default: monitoring.coreos.com + description: Group of the referent. When not specified, it defaults + to `monitoring.coreos.com` + enum: + - monitoring.coreos.com + type: string + name: + description: Name of the referent. When not set, all resources + are matched. + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + minLength: 1 + type: string + resource: + description: Resource of the referent. + enum: + - prometheusrules + - servicemonitors + - podmonitors + - probes + type: string + required: + - namespace + - resource + type: object + type: array + exemplars: + description: Exemplars related settings that are runtime reloadable. + It requires to enable the exemplar storage feature to be effective. + properties: + maxSize: + description: Maximum number of exemplars stored in memory for + all series. If not set, Prometheus uses its default value. A + value of zero or less than zero disables the storage. + format: int64 + type: integer + type: object + externalLabels: + additionalProperties: + type: string + description: The labels to add to any time series or alerts when communicating + with external systems (federation, remote storage, Alertmanager). + type: object + externalUrl: + description: The external URL the Prometheus instances will be available + under. This is necessary to generate correct URLs. This is necessary + if Prometheus is not served from root of a DNS name. + type: string + hostAliases: + description: Pods' hostAliases configuration + items: + description: HostAlias holds the mapping between IP and hostnames + that will be injected as an entry in the pod's hosts file. + properties: + hostnames: + description: Hostnames for the above IP address. + items: + type: string + type: array + ip: + description: IP address of the host file entry. + type: string + required: + - hostnames + - ip + type: object + type: array + x-kubernetes-list-map-keys: + - ip + x-kubernetes-list-type: map + hostNetwork: + description: Use the host's network namespace if true. Make sure to + understand the security implications if you want to enable it. When + hostNetwork is enabled, this will set dnsPolicy to ClusterFirstWithHostNet + automatically. + type: boolean + ignoreNamespaceSelectors: + description: IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector + settings from all PodMonitor, ServiceMonitor and Probe objects. + They will only discover endpoints within the namespace of the PodMonitor, + ServiceMonitor and Probe objects. Defaults to false. + type: boolean + image: + description: Image if specified has precedence over baseImage, tag + and sha combinations. Specifying the version is still necessary + to ensure the Prometheus Operator knows what version of Prometheus + is being configured. + type: string + imagePullPolicy: + description: Image pull policy for the 'prometheus', 'init-config-reloader' + and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy + for more details. + enum: + - "" + - Always + - Never + - IfNotPresent + type: string + imagePullSecrets: + description: An optional list of references to secrets in the same + namespace to use for pulling prometheus and alertmanager images + from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + items: + description: LocalObjectReference contains enough information to + let you locate the referenced object inside the same namespace. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + type: array + initContainers: + description: 'InitContainers allows adding initContainers to the pod + definition. Those can be used to e.g. fetch secrets for injection + into the Prometheus configuration from external sources. Any errors + during the execution of an initContainer will lead to a restart + of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ + InitContainers described here modify an operator generated init + containers if they share the same name and modifications are done + via a strategic merge patch. The current init container name is: + `init-config-reloader`. Overriding init containers is entirely outside + the scope of what the maintainers will support and by doing so, + you accept that this behaviour may break at any time without notice.' + items: + description: A single application container that you want to run + within a pod. + properties: + args: + description: 'Arguments to the entrypoint. The container image''s + CMD is used if this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. If a variable + cannot be resolved, the reference in the input string will + be unchanged. Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". Escaped references + will never be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + command: + description: 'Entrypoint array. Not executed within a shell. + The container image''s ENTRYPOINT is used if this is not provided. + Variable references $(VAR_NAME) are expanded using the container''s + environment. If a variable cannot be resolved, the reference + in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: + i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether + the variable exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + env: + description: List of environment variables to set in the container. + Cannot be updated. + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be + a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in + the container and any service environment variables. + If a variable cannot be resolved, the reference in the + input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) + syntax: i.e. "$$(VAR_NAME)" will produce the string + literal "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable exists + or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap or + its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the + exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's + namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + envFrom: + description: List of sources to populate environment variables + in the container. The keys defined within a source must be + a C_IDENTIFIER. All invalid keys will be reported as an event + when the container is starting. When a key exists in multiple + sources, the value associated with the last source will take + precedence. Values defined by an Env with a duplicate key + will take precedence. Cannot be updated. + items: + description: EnvFromSource represents the source of a set + of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the ConfigMap must be + defined + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + description: An optional identifier to prepend to each + key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + image: + description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management + to default or override container images in workload controllers + like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system should take + in response to container lifecycle events. Cannot be updated. + properties: + postStart: + description: 'PostStart is called immediately after a container + is created. If the handler fails, the container is terminated + and restarted according to its restart policy. Other management + of the container blocks until the hook completes. More + info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's + filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need + to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is + unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is NOT supported + as a LifecycleHandler and kept for the backward compatibility. + There are no validation of this field and lifecycle + hooks will fail in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + description: 'PreStop is called immediately before a container + is terminated due to an API request or management event + such as liveness/startup probe failure, preemption, resource + contention, etc. The handler is not called if the container + crashes or exits. The Pod''s termination grace period + countdown begins before the PreStop hook is executed. + Regardless of the outcome of the handler, the container + will eventually terminate within the Pod''s termination + grace period (unless delayed by finalizers). Other management + of the container blocks until the hook completes or until + the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's + filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need + to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is + unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is NOT supported + as a LifecycleHandler and kept for the backward compatibility. + There are no validation of this field and lifecycle + hooks will fail in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container liveness. Container + will be restarted if the probe fails. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + name: + description: Name of the container specified as a DNS_LABEL. + Each container in a pod must have a unique name (DNS_LABEL). + Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. Not + specifying a port here DOES NOT prevent that port from being + exposed. Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from the network. + Modifying this array with strategic merge patch may corrupt + the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. + Cannot be updated. + items: + description: ContainerPort represents a network port in a + single container. + properties: + containerPort: + description: Number of port to expose on the pod's IP + address. This must be a valid port number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the external port to. + type: string + hostPort: + description: Number of port to expose on the host. If + specified, this must be a valid port number, 0 < x < + 65536. If HostNetwork is specified, this must match + ContainerPort. Most containers do not need this. + format: int32 + type: integer + name: + description: If specified, this must be an IANA_SVC_NAME + and unique within the pod. Each named port in a pod + must have a unique name. Name for the port that can + be referred to by services. + type: string + protocol: + default: TCP + description: Protocol for port. Must be UDP, TCP, or SCTP. + Defaults to "TCP". + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service readiness. + Container will be removed from service endpoints if the probe + fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by this container. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + securityContext: + description: 'SecurityContext defines the security options the + container should be run with. If set, the fields of SecurityContext + override the equivalent fields of PodSecurityContext. More + info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether + a process can gain more privileges than its parent process. + This bool directly controls if the no_new_privs flag will + be set on the container process. AllowPrivilegeEscalation + is true always when the container is: 1) run as Privileged + 2) has CAP_SYS_ADMIN Note that this field cannot be set + when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. Note that this field cannot be + set when spec.os.name is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + type: object + privileged: + description: Run container in privileged mode. Processes + in privileged containers are essentially equivalent to + root on the host. Defaults to false. Note that this field + cannot be set when spec.os.name is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to + use for the containers. The default is DefaultProcMount + which uses the container runtime defaults for readonly + paths and masked paths. This requires the ProcMountType + feature flag to be enabled. Note that this field cannot + be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root + filesystem. Default is false. Note that this field cannot + be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container + process. Uses runtime default if unset. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when + spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a + non-root user. If true, the Kubelet will validate the + image at runtime to ensure that it does not run as UID + 0 (root) and fail to start the container if it does. If + unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container + process. Defaults to user specified in image metadata + if unspecified. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate a + random SELinux context for each container. May also be + set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. Note that this field cannot be set when + spec.os.name is windows. + properties: + level: + description: Level is SELinux level label that applies + to the container. + type: string + role: + description: Role is a SELinux role label that applies + to the container. + type: string + type: + description: Type is a SELinux type label that applies + to the container. + type: string + user: + description: User is a SELinux user label that applies + to the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use by this container. + If seccomp options are provided at both the pod & container + level, the container options override the pod options. + Note that this field cannot be set when spec.os.name is + windows. + properties: + localhostProfile: + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile + must be preconfigured on the node to work. Must be + a descending path, relative to the kubelet's configured + seccomp profile location. Must only be set if type + is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - + a profile defined in a file on the node should be + used. RuntimeDefault - the container runtime default + profile should be used. Unconfined - no profile should + be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings applied to all + containers. If unspecified, the options from the PodSecurityContext + will be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + Note that this field cannot be set when spec.os.name is + linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named + by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the + GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should + be run as a 'Host Process' container. This field is + alpha-level and will only be honored by components + that enable the WindowsHostProcessContainers feature + flag. Setting this field without the feature flag + will result in errors when validating the Pod. All + of a Pod's containers must have the same effective + HostProcess value (it is not allowed to have a mix + of HostProcess containers and non-HostProcess containers). In + addition, if HostProcess is true then HostNetwork + must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'StartupProbe indicates that the Pod has successfully + initialized. If specified, no other probes are executed until + this completes successfully. If this probe fails, the Pod + will be restarted, just as if the livenessProbe failed. This + can be used to provide different probe parameters at the beginning + of a Pod''s lifecycle, when it might take a long time to load + data or warm a cache, than during steady-state operation. + This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', etc) + won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + This is a beta field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC service. Number + must be in the range 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of the service to + place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior + is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container has + started before liveness probes are initiated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for the probe + to be considered successful after having failed. Defaults + to 1. Must be 1 for liveness and startup. Minimum value + is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP + port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port to access on + the container. Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs + to terminate gracefully upon probe failure. The grace + period is the duration in seconds after the processes + running in the pod are sent a termination signal and the + time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. If this value is nil, the pod's + terminationGracePeriodSeconds will be used. Otherwise, + this value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to + shut down). This is a beta field and requires enabling + ProbeTerminationGracePeriod feature gate. Minimum value + is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + stdin: + description: Whether this container should allocate a buffer + for stdin in the container runtime. If this is not set, reads + from stdin in the container will always result in EOF. Default + is false. + type: boolean + stdinOnce: + description: Whether the container runtime should close the + stdin channel after it has been opened by a single attach. + When stdin is true the stdin stream will remain open across + multiple attach sessions. If stdinOnce is set to true, stdin + is opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If this + flag is false, a container processes that reads from stdin + will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to which the + container''s termination message will be written is mounted + into the container''s filesystem. Message written is intended + to be brief final status, such as an assertion failure message. + Will be truncated by the node if greater than 4096 bytes. + The total message length across all containers will be limited + to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message should be + populated. File will use the contents of terminationMessagePath + to populate the container status message on both success and + failure. FallbackToLogsOnError will use the last chunk of + container log output if the termination message file is empty + and the container exited with an error. The log output is + limited to 2048 bytes or 80 lines, whichever is smaller. Defaults + to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate a TTY for + itself, also requires 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block devices to be + used by the container. + items: + description: volumeDevice describes a mapping of a raw block + device within a container. + properties: + devicePath: + description: devicePath is the path inside of the container + that the device will be mapped to. + type: string + name: + description: name must match the name of a persistentVolumeClaim + in the pod + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + description: Pod volumes to mount into the container's filesystem. + Cannot be updated. + items: + description: VolumeMount describes a mounting of a Volume + within a container. + properties: + mountPath: + description: Path within the container at which the volume + should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are + propagated from the host to container and the other + way around. When not set, MountPropagationNone is used. + This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise + (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which + the container's volume should be mounted. Behaves similarly + to SubPath but environment variable references $(VAR_NAME) + are expanded using the container's environment. Defaults + to "" (volume's root). SubPathExpr and SubPath are mutually + exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + description: Container's working directory. If not specified, + the container runtime's default will be used, which might + be configured in the container image. Cannot be updated. + type: string + required: + - name + type: object + type: array + listenLocal: + description: ListenLocal makes the Prometheus server listen on loopback, + so that it does not bind against the Pod IP. + type: boolean + logFormat: + description: Log format for Prometheus to be configured with. + enum: + - "" + - logfmt + - json + type: string + logLevel: + description: Log level for Prometheus to be configured with. + enum: + - "" + - debug + - info + - warn + - error + type: string + minReadySeconds: + description: Minimum number of seconds for which a newly created pod + should be ready without any of its container crashing for it to + be considered available. Defaults to 0 (pod will be considered available + as soon as it is ready) This is an alpha field from kubernetes 1.22 + until 1.24 which requires enabling the StatefulSetMinReadySeconds + feature gate. + format: int32 + type: integer + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + type: object + overrideHonorLabels: + description: When true, Prometheus resolves label conflicts by renaming + the labels in the scraped data to "exported_