cortexadmin

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package cortexadmin is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricMetadata_MetricType_name = map[int32]string{
		0: "UNKNOWN",
		1: "COUNTER",
		2: "GAUGE",
		3: "HISTOGRAM",
		4: "GAUGEHISTOGRAM",
		5: "SUMMARY",
		6: "INFO",
		7: "STATESET",
	}
	MetricMetadata_MetricType_value = map[string]int32{
		"UNKNOWN":        0,
		"COUNTER":        1,
		"GAUGE":          2,
		"HISTOGRAM":      3,
		"GAUGEHISTOGRAM": 4,
		"SUMMARY":        5,
		"INFO":           6,
		"STATESET":       7,
	}
)

Enum value maps for MetricMetadata_MetricType.

View Source
var CortexAdmin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cortexadmin.CortexAdmin",
	HandlerType: (*CortexAdminServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AllUserStats",
			Handler:    _CortexAdmin_AllUserStats_Handler,
		},
		{
			MethodName: "WriteMetrics",
			Handler:    _CortexAdmin_WriteMetrics_Handler,
		},
		{
			MethodName: "Query",
			Handler:    _CortexAdmin_Query_Handler,
		},
		{
			MethodName: "QueryRange",
			Handler:    _CortexAdmin_QueryRange_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "plugins/cortex/pkg/apis/cortexadmin/cortexadmin.proto",
}

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

View Source
var File_plugins_cortex_pkg_apis_cortexadmin_cortexadmin_proto protoreflect.FileDescriptor

Functions

func RegisterCortexAdminHandler

func RegisterCortexAdminHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCortexAdminHandler registers the http handlers for service CortexAdmin to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCortexAdminHandlerClient

func RegisterCortexAdminHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CortexAdminClient) error

RegisterCortexAdminHandlerClient registers the http handlers for service CortexAdmin to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CortexAdminClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CortexAdminClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CortexAdminClient" to call the correct interceptors.

func RegisterCortexAdminHandlerFromEndpoint

func RegisterCortexAdminHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCortexAdminHandlerFromEndpoint is same as RegisterCortexAdminHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCortexAdminHandlerServer

func RegisterCortexAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CortexAdminServer) error

RegisterCortexAdminHandlerServer registers the http handlers for service CortexAdmin to "mux". UnaryRPC :call CortexAdminServer 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 RegisterCortexAdminHandlerFromEndpoint instead.

func RegisterCortexAdminServer

func RegisterCortexAdminServer(s grpc.ServiceRegistrar, srv CortexAdminServer)

Types

type AdminClientOption

type AdminClientOption func(*AdminClientOptions)

func WithDialOptions

func WithDialOptions(options ...grpc.DialOption) AdminClientOption

func WithListenAddress

func WithListenAddress(addr string) AdminClientOption

type AdminClientOptions

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

func (*AdminClientOptions) Apply

func (o *AdminClientOptions) Apply(opts ...AdminClientOption)

type CortexAdminClient

type CortexAdminClient interface {
	AllUserStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserIDStatsList, error)
	WriteMetrics(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
	QueryRange(ctx context.Context, in *QueryRangeRequest, opts ...grpc.CallOption) (*QueryResponse, error)
}

CortexAdminClient is the client API for CortexAdmin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewClient

func NewClient(ctx context.Context, opts ...AdminClientOption) (CortexAdminClient, error)

type CortexAdminServer

type CortexAdminServer interface {
	AllUserStats(context.Context, *emptypb.Empty) (*UserIDStatsList, error)
	WriteMetrics(context.Context, *WriteRequest) (*WriteResponse, error)
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	QueryRange(context.Context, *QueryRangeRequest) (*QueryResponse, error)
	// contains filtered or unexported methods
}

CortexAdminServer is the server API for CortexAdmin service. All implementations must embed UnimplementedCortexAdminServer for forward compatibility

type Exemplar

type Exemplar struct {
	Labels      []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	Value       float64  `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	TimestampMs int64    `protobuf:"varint,3,opt,name=timestampMs,proto3" json:"timestampMs,omitempty"`
	// contains filtered or unexported fields
}

func (*Exemplar) Descriptor deprecated

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

Deprecated: Use Exemplar.ProtoReflect.Descriptor instead.

func (*Exemplar) GetLabels

func (x *Exemplar) GetLabels() []*Label

func (*Exemplar) GetTimestampMs

func (x *Exemplar) GetTimestampMs() int64

func (*Exemplar) GetValue

func (x *Exemplar) GetValue() float64

func (*Exemplar) ProtoMessage

func (*Exemplar) ProtoMessage()

func (*Exemplar) ProtoReflect

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

func (*Exemplar) Reset

func (x *Exemplar) Reset()

func (*Exemplar) String

func (x *Exemplar) String() string

type Label

type Label struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Label) Descriptor deprecated

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

Deprecated: Use Label.ProtoReflect.Descriptor instead.

func (*Label) GetName

func (x *Label) GetName() string

func (*Label) GetValue

func (x *Label) GetValue() string

func (*Label) ProtoMessage

func (*Label) ProtoMessage()

func (*Label) ProtoReflect

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

func (*Label) Reset

func (x *Label) Reset()

func (*Label) String

func (x *Label) String() string

type MetricMetadata

type MetricMetadata struct {
	Type             MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=cortexadmin.MetricMetadata_MetricType" json:"type,omitempty"`
	MetricFamilyName string                    `protobuf:"bytes,2,opt,name=metricFamilyName,proto3" json:"metricFamilyName,omitempty"`
	Help             string                    `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"`
	Unit             string                    `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"`
	// contains filtered or unexported fields
}

func (*MetricMetadata) Descriptor deprecated

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

Deprecated: Use MetricMetadata.ProtoReflect.Descriptor instead.

func (*MetricMetadata) GetHelp

func (x *MetricMetadata) GetHelp() string

func (*MetricMetadata) GetMetricFamilyName

func (x *MetricMetadata) GetMetricFamilyName() string

func (*MetricMetadata) GetType

func (*MetricMetadata) GetUnit

func (x *MetricMetadata) GetUnit() string

func (*MetricMetadata) ProtoMessage

func (*MetricMetadata) ProtoMessage()

func (*MetricMetadata) ProtoReflect

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

func (*MetricMetadata) Reset

func (x *MetricMetadata) Reset()

func (*MetricMetadata) String

func (x *MetricMetadata) String() string

type MetricMetadata_MetricType

type MetricMetadata_MetricType int32
const (
	MetricMetadata_UNKNOWN        MetricMetadata_MetricType = 0
	MetricMetadata_COUNTER        MetricMetadata_MetricType = 1
	MetricMetadata_GAUGE          MetricMetadata_MetricType = 2
	MetricMetadata_HISTOGRAM      MetricMetadata_MetricType = 3
	MetricMetadata_GAUGEHISTOGRAM MetricMetadata_MetricType = 4
	MetricMetadata_SUMMARY        MetricMetadata_MetricType = 5
	MetricMetadata_INFO           MetricMetadata_MetricType = 6
	MetricMetadata_STATESET       MetricMetadata_MetricType = 7
)

func (MetricMetadata_MetricType) Descriptor

func (MetricMetadata_MetricType) Enum

func (MetricMetadata_MetricType) EnumDescriptor deprecated

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

Deprecated: Use MetricMetadata_MetricType.Descriptor instead.

func (MetricMetadata_MetricType) Number

func (MetricMetadata_MetricType) String

func (x MetricMetadata_MetricType) String() string

func (MetricMetadata_MetricType) Type

type QueryRangeRequest

type QueryRangeRequest struct {
	Tenants []string               `protobuf:"bytes,1,rep,name=tenants,proto3" json:"tenants,omitempty"`
	Query   string                 `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	Start   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start,proto3" json:"start,omitempty"`
	End     *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=end,proto3" json:"end,omitempty"`
	Step    *durationpb.Duration   `protobuf:"bytes,5,opt,name=step,proto3" json:"step,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRangeRequest) Descriptor deprecated

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

Deprecated: Use QueryRangeRequest.ProtoReflect.Descriptor instead.

func (*QueryRangeRequest) GetEnd

func (*QueryRangeRequest) GetQuery

func (x *QueryRangeRequest) GetQuery() string

func (*QueryRangeRequest) GetStart

func (x *QueryRangeRequest) GetStart() *timestamppb.Timestamp

func (*QueryRangeRequest) GetStep

func (x *QueryRangeRequest) GetStep() *durationpb.Duration

func (*QueryRangeRequest) GetTenants

func (x *QueryRangeRequest) GetTenants() []string

func (*QueryRangeRequest) ProtoMessage

func (*QueryRangeRequest) ProtoMessage()

func (*QueryRangeRequest) ProtoReflect

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

func (*QueryRangeRequest) Reset

func (x *QueryRangeRequest) Reset()

func (*QueryRangeRequest) String

func (x *QueryRangeRequest) String() string

type QueryRequest

type QueryRequest struct {
	Tenants []string `protobuf:"bytes,1,rep,name=tenants,proto3" json:"tenants,omitempty"`
	Query   string   `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetQuery

func (x *QueryRequest) GetQuery() string

func (*QueryRequest) GetTenants

func (x *QueryRequest) GetTenants() []string

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

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

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResponse) Descriptor deprecated

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

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetData

func (x *QueryResponse) GetData() []byte

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoReflect

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

func (*QueryResponse) Reset

func (x *QueryResponse) Reset()

func (*QueryResponse) String

func (x *QueryResponse) String() string

type Sample

type Sample struct {
	TimestampMs int64   `protobuf:"varint,1,opt,name=timestampMs,proto3" json:"timestampMs,omitempty"`
	Value       float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Sample) Descriptor deprecated

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

Deprecated: Use Sample.ProtoReflect.Descriptor instead.

func (*Sample) GetTimestampMs

func (x *Sample) GetTimestampMs() int64

func (*Sample) GetValue

func (x *Sample) GetValue() float64

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) ProtoReflect

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

func (*Sample) Reset

func (x *Sample) Reset()

func (*Sample) String

func (x *Sample) String() string

type TimeSeries

type TimeSeries struct {
	Labels    []*Label    `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	Samples   []*Sample   `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples,omitempty"`
	Exemplars []*Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars,omitempty"`
	// contains filtered or unexported fields
}

func (*TimeSeries) Descriptor deprecated

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

Deprecated: Use TimeSeries.ProtoReflect.Descriptor instead.

func (*TimeSeries) GetExemplars

func (x *TimeSeries) GetExemplars() []*Exemplar

func (*TimeSeries) GetLabels

func (x *TimeSeries) GetLabels() []*Label

func (*TimeSeries) GetSamples

func (x *TimeSeries) GetSamples() []*Sample

func (*TimeSeries) ProtoMessage

func (*TimeSeries) ProtoMessage()

func (*TimeSeries) ProtoReflect

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

func (*TimeSeries) Reset

func (x *TimeSeries) Reset()

func (*TimeSeries) String

func (x *TimeSeries) String() string

type UnimplementedCortexAdminServer

type UnimplementedCortexAdminServer struct {
}

UnimplementedCortexAdminServer must be embedded to have forward compatible implementations.

func (UnimplementedCortexAdminServer) AllUserStats

func (UnimplementedCortexAdminServer) Query

func (UnimplementedCortexAdminServer) QueryRange

func (UnimplementedCortexAdminServer) WriteMetrics

type UnsafeCortexAdminServer

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

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

type UserIDStats

type UserIDStats struct {
	UserID            string  `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
	IngestionRate     float64 `protobuf:"fixed64,2,opt,name=ingestionRate,proto3" json:"ingestionRate,omitempty"`
	NumSeries         uint64  `protobuf:"varint,3,opt,name=numSeries,proto3" json:"numSeries,omitempty"`
	APIIngestionRate  float64 `protobuf:"fixed64,4,opt,name=APIIngestionRate,proto3" json:"APIIngestionRate,omitempty"`
	RuleIngestionRate float64 `protobuf:"fixed64,5,opt,name=RuleIngestionRate,proto3" json:"RuleIngestionRate,omitempty"`
	// contains filtered or unexported fields
}

func (*UserIDStats) Descriptor deprecated

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

Deprecated: Use UserIDStats.ProtoReflect.Descriptor instead.

func (*UserIDStats) GetAPIIngestionRate

func (x *UserIDStats) GetAPIIngestionRate() float64

func (*UserIDStats) GetIngestionRate

func (x *UserIDStats) GetIngestionRate() float64

func (*UserIDStats) GetNumSeries

func (x *UserIDStats) GetNumSeries() uint64

func (*UserIDStats) GetRuleIngestionRate

func (x *UserIDStats) GetRuleIngestionRate() float64

func (*UserIDStats) GetUserID

func (x *UserIDStats) GetUserID() string

func (*UserIDStats) ProtoMessage

func (*UserIDStats) ProtoMessage()

func (*UserIDStats) ProtoReflect

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

func (*UserIDStats) Reset

func (x *UserIDStats) Reset()

func (*UserIDStats) String

func (x *UserIDStats) String() string

type UserIDStatsList

type UserIDStatsList struct {
	Items []*UserIDStats `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*UserIDStatsList) Descriptor deprecated

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

Deprecated: Use UserIDStatsList.ProtoReflect.Descriptor instead.

func (*UserIDStatsList) GetItems

func (x *UserIDStatsList) GetItems() []*UserIDStats

func (*UserIDStatsList) ProtoMessage

func (*UserIDStatsList) ProtoMessage()

func (*UserIDStatsList) ProtoReflect

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

func (*UserIDStatsList) Reset

func (x *UserIDStatsList) Reset()

func (*UserIDStatsList) String

func (x *UserIDStatsList) String() string

type WriteRequest

type WriteRequest struct {
	ClusterID  string            `protobuf:"bytes,1,opt,name=clusterID,proto3" json:"clusterID,omitempty"`
	Timeseries []*TimeSeries     `protobuf:"bytes,2,rep,name=timeseries,proto3" json:"timeseries,omitempty"`
	Metadata   []*MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteRequest) Descriptor deprecated

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

Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.

func (*WriteRequest) GetClusterID

func (x *WriteRequest) GetClusterID() string

func (*WriteRequest) GetMetadata

func (x *WriteRequest) GetMetadata() []*MetricMetadata

func (*WriteRequest) GetTimeseries

func (x *WriteRequest) GetTimeseries() []*TimeSeries

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) ProtoReflect

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

func (*WriteRequest) Reset

func (x *WriteRequest) Reset()

func (*WriteRequest) String

func (x *WriteRequest) String() string

type WriteResponse

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

func (*WriteResponse) Descriptor deprecated

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

Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.

func (*WriteResponse) ProtoMessage

func (*WriteResponse) ProtoMessage()

func (*WriteResponse) ProtoReflect

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

func (*WriteResponse) Reset

func (x *WriteResponse) Reset()

func (*WriteResponse) String

func (x *WriteResponse) String() string

Jump to

Keyboard shortcuts

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