Documentation
¶
Index ¶
- func CortexAggregationSelector(ik sdkmetric.InstrumentKind) aggregation.Aggregation
- func PartitionById[T any](arr []*T, idForElement func(int) string, ...)
- func RegisterMeterProvider(mp *sdkmetric.MeterProvider)
- type ClientSet
- type CompactorClient
- type ConfigClient
- type ConfigMode
- type CortexAdminServer
- func (p *CortexAdminServer) AllUserStats(ctx context.Context, _ *emptypb.Empty) (*cortexadmin.UserIDStatsList, error)
- func (p *CortexAdminServer) DeleteRule(ctx context.Context, in *cortexadmin.DeleteRuleRequest) (*emptypb.Empty, error)
- func (p *CortexAdminServer) ExtractRawSeries(ctx context.Context, request *cortexadmin.MatcherRequest) (*cortexadmin.QueryResponse, error)
- func (p *CortexAdminServer) FlushBlocks(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (p *CortexAdminServer) GetCortexConfig(ctx context.Context, req *cortexadmin.ConfigRequest) (*cortexadmin.ConfigResponse, error)
- func (p *CortexAdminServer) GetCortexStatus(ctx context.Context, _ *emptypb.Empty) (*cortexadmin.CortexStatus, error)
- func (p *CortexAdminServer) GetMetricLabelSets(ctx context.Context, request *cortexadmin.LabelRequest) (*cortexadmin.MetricLabels, error)
- func (p *CortexAdminServer) GetMetricMetadata(ctx context.Context, req *cortexadmin.MetricMetadataRequest) (*cortexadmin.MetricMetadata, error)
- func (p *CortexAdminServer) GetRule(ctx context.Context, in *cortexadmin.GetRuleRequest) (*cortexadmin.QueryResponse, error)
- func (p *CortexAdminServer) GetSeriesMetrics(ctx context.Context, request *cortexadmin.SeriesRequest) (*cortexadmin.SeriesInfoList, error)
- func (p *CortexAdminServer) Initialize(conf CortexAdminServerConfig)
- func (p *CortexAdminServer) ListRules(ctx context.Context, req *cortexadmin.ListRulesRequest) (*cortexadmin.ListRulesResponse, error)
- func (p *CortexAdminServer) LoadRules(ctx context.Context, in *cortexadmin.LoadRuleRequest) (*emptypb.Empty, error)
- func (p *CortexAdminServer) Query(ctx context.Context, in *cortexadmin.QueryRequest) (*cortexadmin.QueryResponse, error)
- func (p *CortexAdminServer) QueryRange(ctx context.Context, in *cortexadmin.QueryRangeRequest) (*cortexadmin.QueryResponse, error)
- func (p *CortexAdminServer) WriteMetrics(ctx context.Context, in *cortexadmin.WriteRequest) (*cortexadmin.WriteResponse, error)
- type CortexAdminServerConfig
- type DataFormat
- type DistributorClient
- type HTTPClientOption
- type HTTPClientOptions
- type HttpApiServer
- type HttpApiServerConfig
- type IngesterClient
- type InterceptorConfig
- type MemberlistStatusClient
- type MultiTenantRuleAggregator
- type Partition
- type PurgerClient
- type QuerierClient
- type QueryFrontendClient
- type RemoteWriteForwarder
- func (f *RemoteWriteForwarder) Initialize(conf RemoteWriteForwarderConfig)
- func (f *RemoteWriteForwarder) Push(ctx context.Context, writeReq *cortexpb.WriteRequest) (_ *cortexpb.WriteResponse, pushErr error)
- func (f *RemoteWriteForwarder) SyncRules(ctx context.Context, payload *remotewrite.Payload) (_ *emptypb.Empty, syncErr error)
- type RemoteWriteForwarderConfig
- type RequestInterceptor
- type RingStatusClient
- type RulerClient
- type ServicesStatusClient
- type StoreGatewayClient
- type UninstallTaskRunner
- type UninstallTaskRunnerConfig
- type WriteHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CortexAggregationSelector ¶ added in v0.11.0
func CortexAggregationSelector(ik sdkmetric.InstrumentKind) aggregation.Aggregation
func PartitionById ¶ added in v0.9.1
func PartitionById[T any](arr []*T, idForElement func(int) string, callback func(id string, start, end int))
PartitionById arranges the elements of a slice into any number of partitions, where each partition contains elements grouped by a common ID. This function returns a list of partitions, where each has a start and end index and corresponding ID. The partition slice returned from this function should be reused by calling ReusePartitionSlice.
The order of partitions (by ID) are as follows:
1. The first partition ID is the ID at index 0.
2. Subsequent partition IDs are in the inverse order of appearance when
iterating backwards through the array.
For example:
IDs: A | D B A C A D A D E D D E B D E F C G D H A A H J D C C C I A
Index: 0 | 9 8 7 6 5 4 3 2 1
| -> partition order order of appearance <-
Partition Order: A B E F G H J D C I
func RegisterMeterProvider ¶ added in v0.11.0
func RegisterMeterProvider(mp *sdkmetric.MeterProvider)
Types ¶
type ClientSet ¶
type ClientSet interface {
Distributor() DistributorClient
Ingester() IngesterClient
Ruler() RulerClient
Purger() PurgerClient
Compactor() CompactorClient
StoreGateway() StoreGatewayClient
QueryFrontend() QueryFrontendClient
Querier() QuerierClient
HTTP(options ...HTTPClientOption) *http.Client
}
func NewClientSet ¶
type CompactorClient ¶
type CompactorClient interface {
Status(ctx context.Context) (*cortexadmin.CompactorStatus, error)
}
type ConfigClient ¶
type ConfigClient interface {
Config(ctx context.Context, mode ...ConfigMode) (string, error)
}
type ConfigMode ¶
type ConfigMode string
const ( Diff ConfigMode = "diff" Defaults ConfigMode = "defaults" )
type CortexAdminServer ¶
type CortexAdminServer struct {
cortexadmin.UnsafeCortexAdminServer
CortexAdminServerConfig
util.Initializer
}
func (*CortexAdminServer) AllUserStats ¶
func (p *CortexAdminServer) AllUserStats(ctx context.Context, _ *emptypb.Empty) (*cortexadmin.UserIDStatsList, error)
func (*CortexAdminServer) DeleteRule ¶
func (p *CortexAdminServer) DeleteRule( ctx context.Context, in *cortexadmin.DeleteRuleRequest, ) (*emptypb.Empty, error)
func (*CortexAdminServer) ExtractRawSeries ¶
func (p *CortexAdminServer) ExtractRawSeries(ctx context.Context, request *cortexadmin.MatcherRequest) (*cortexadmin.QueryResponse, error)
func (*CortexAdminServer) FlushBlocks ¶
func (*CortexAdminServer) GetCortexConfig ¶
func (p *CortexAdminServer) GetCortexConfig(ctx context.Context, req *cortexadmin.ConfigRequest) (*cortexadmin.ConfigResponse, error)
func (*CortexAdminServer) GetCortexStatus ¶
func (p *CortexAdminServer) GetCortexStatus(ctx context.Context, _ *emptypb.Empty) (*cortexadmin.CortexStatus, error)
func (*CortexAdminServer) GetMetricLabelSets ¶
func (p *CortexAdminServer) GetMetricLabelSets(ctx context.Context, request *cortexadmin.LabelRequest) (*cortexadmin.MetricLabels, error)
func (*CortexAdminServer) GetMetricMetadata ¶ added in v0.9.1
func (p *CortexAdminServer) GetMetricMetadata(ctx context.Context, req *cortexadmin.MetricMetadataRequest) (*cortexadmin.MetricMetadata, error)
func (*CortexAdminServer) GetRule ¶
func (p *CortexAdminServer) GetRule(ctx context.Context, in *cortexadmin.GetRuleRequest, ) (*cortexadmin.QueryResponse, error)
func (*CortexAdminServer) GetSeriesMetrics ¶
func (p *CortexAdminServer) GetSeriesMetrics(ctx context.Context, request *cortexadmin.SeriesRequest) (*cortexadmin.SeriesInfoList, error)
func (*CortexAdminServer) Initialize ¶
func (p *CortexAdminServer) Initialize(conf CortexAdminServerConfig)
func (*CortexAdminServer) ListRules ¶
func (p *CortexAdminServer) ListRules(ctx context.Context, req *cortexadmin.ListRulesRequest) (*cortexadmin.ListRulesResponse, error)
func (*CortexAdminServer) LoadRules ¶
func (p *CortexAdminServer) LoadRules(ctx context.Context, in *cortexadmin.LoadRuleRequest, ) (*emptypb.Empty, error)
LoadRules This method is responsible for Creating and Updating Rules
func (*CortexAdminServer) Query ¶
func (p *CortexAdminServer) Query( ctx context.Context, in *cortexadmin.QueryRequest, ) (*cortexadmin.QueryResponse, error)
func (*CortexAdminServer) QueryRange ¶
func (p *CortexAdminServer) QueryRange( ctx context.Context, in *cortexadmin.QueryRangeRequest, ) (*cortexadmin.QueryResponse, error)
func (*CortexAdminServer) WriteMetrics ¶
func (p *CortexAdminServer) WriteMetrics(ctx context.Context, in *cortexadmin.WriteRequest) (*cortexadmin.WriteResponse, error)
type CortexAdminServerConfig ¶
type CortexAdminServerConfig struct {
CortexClientSet ClientSet `validate:"required"`
Config *v1beta1.GatewayConfigSpec `validate:"required"`
Logger *slog.Logger `validate:"required"`
}
type DataFormat ¶
type DataFormat string
const ( // Rule data formatted as a single YAML document containing yaml-encoded // []rulefmt.RuleGroup keyed by tenant ID: // <tenantID>: // - name: ... // rules: [...] NamespaceKeyedYAML DataFormat = "namespace-keyed-yaml" // Rule data formatted as JSON containing the prometheus response metadata // and a list of rule groups, each of which has a field "file" containing // the tenant ID: // {"status":"success","data":{"groups":["file":"<tenantID>", ...]}} PrometheusRuleGroupsJSON DataFormat = "prometheus-rule-groups-json" )
type DistributorClient ¶
type DistributorClient interface {
distributorpb.DistributorClient
ConfigClient
Status(ctx context.Context) (*cortexadmin.DistributorStatus, error)
}
type HTTPClientOption ¶
type HTTPClientOption func(*HTTPClientOptions)
func WithServerNameOverride ¶
func WithServerNameOverride(serverNameOverride string) HTTPClientOption
type HTTPClientOptions ¶
type HTTPClientOptions struct {
// contains filtered or unexported fields
}
type HttpApiServer ¶
type HttpApiServer struct {
HttpApiServerConfig
util.Initializer
}
func (*HttpApiServer) ConfigureRoutes ¶
func (p *HttpApiServer) ConfigureRoutes(router *gin.Engine)
func (*HttpApiServer) Initialize ¶
func (p *HttpApiServer) Initialize(config HttpApiServerConfig)
type HttpApiServerConfig ¶
type HttpApiServerConfig struct {
PluginContext context.Context `validate:"required"`
ManagementClient managementv1.ManagementClient `validate:"required"`
CortexClientSet ClientSet `validate:"required"`
Config *v1beta1.GatewayConfigSpec `validate:"required"`
CortexTLSConfig *tls.Config `validate:"required"`
Logger *slog.Logger `validate:"required"`
StorageBackend storage.Backend `validate:"required"`
AuthMiddlewares map[string]auth.Middleware `validate:"required"`
}
type IngesterClient ¶
type IngesterClient interface {
Status(ctx context.Context) (*cortexadmin.IngesterStatus, error)
}
type InterceptorConfig ¶ added in v0.9.1
type InterceptorConfig struct {
// The label to use as the tenant ID
IdLabelName string
}
type MemberlistStatusClient ¶
type MemberlistStatusClient interface {
MemberlistStatus(ctx context.Context) (*cortexadmin.MemberlistStatus, error)
}
type MultiTenantRuleAggregator ¶
type MultiTenantRuleAggregator struct {
// contains filtered or unexported fields
}
func NewMultiTenantRuleAggregator ¶
func NewMultiTenantRuleAggregator( client managementv1.ManagementClient, cortexClient *http.Client, headerCodec rbac.HeaderCodec, format DataFormat, ) *MultiTenantRuleAggregator
func (*MultiTenantRuleAggregator) Handle ¶
func (a *MultiTenantRuleAggregator) Handle(c *gin.Context)
type PurgerClient ¶
type PurgerClient interface {
Status(ctx context.Context) (*cortexadmin.PurgerStatus, error)
}
type QuerierClient ¶
type QuerierClient interface {
Status(ctx context.Context) (*cortexadmin.QuerierStatus, error)
}
type QueryFrontendClient ¶
type QueryFrontendClient interface {
Status(ctx context.Context) (*cortexadmin.QueryFrontendStatus, error)
}
type RemoteWriteForwarder ¶
type RemoteWriteForwarder struct {
remotewrite.UnsafeRemoteWriteServer
RemoteWriteForwarderConfig
util.Initializer
// contains filtered or unexported fields
}
func (*RemoteWriteForwarder) Initialize ¶
func (f *RemoteWriteForwarder) Initialize(conf RemoteWriteForwarderConfig)
func (*RemoteWriteForwarder) Push ¶
func (f *RemoteWriteForwarder) Push(ctx context.Context, writeReq *cortexpb.WriteRequest) (_ *cortexpb.WriteResponse, pushErr error)
func (*RemoteWriteForwarder) SyncRules ¶
func (f *RemoteWriteForwarder) SyncRules(ctx context.Context, payload *remotewrite.Payload) (_ *emptypb.Empty, syncErr error)
type RemoteWriteForwarderConfig ¶
type RemoteWriteForwarderConfig struct {
CortexClientSet ClientSet `validate:"required"`
Config *v1beta1.GatewayConfigSpec `validate:"required"`
Logger *slog.Logger `validate:"required"`
}
type RequestInterceptor ¶ added in v0.9.1
type RequestInterceptor interface {
Intercept(ctx context.Context, req *cortexpb.WriteRequest, handler WriteHandlerFunc) (*cortexpb.WriteResponse, error)
}
func NewFederatingInterceptor ¶ added in v0.9.1
func NewFederatingInterceptor(conf InterceptorConfig) RequestInterceptor
type RingStatusClient ¶
type RingStatusClient interface {
RingStatus(ctx context.Context) (*cortexadmin.RingStatus, error)
}
type RulerClient ¶
type RulerClient interface {
ruler.RulerClient
Status(ctx context.Context) (*cortexadmin.RulerStatus, error)
}
type ServicesStatusClient ¶
type ServicesStatusClient interface {
ServicesStatus(ctx context.Context) (*cortexadmin.ServiceStatusList, error)
}
type StoreGatewayClient ¶
type StoreGatewayClient interface {
Status(ctx context.Context) (*cortexadmin.StoreGatewayStatus, error)
}
type UninstallTaskRunner ¶
type UninstallTaskRunner struct {
uninstall.DefaultPendingHandler
UninstallTaskRunnerConfig
util.Initializer
}
func (*UninstallTaskRunner) Initialize ¶
func (a *UninstallTaskRunner) Initialize(conf UninstallTaskRunnerConfig)
func (*UninstallTaskRunner) OnTaskCompleted ¶
func (a *UninstallTaskRunner) OnTaskCompleted(ctx context.Context, ti task.ActiveTask, state task.State, args ...any)
func (*UninstallTaskRunner) OnTaskRunning ¶
func (a *UninstallTaskRunner) OnTaskRunning(ctx context.Context, ti task.ActiveTask) error
type UninstallTaskRunnerConfig ¶
type UninstallTaskRunnerConfig struct {
CortexClientSet ClientSet `validate:"required"`
Config *v1beta1.GatewayConfigSpec `validate:"required"`
StorageBackend storage.Backend `validate:"required"`
}
type WriteHandlerFunc ¶ added in v0.9.1
type WriteHandlerFunc = func(context.Context, *cortexpb.WriteRequest, ...grpc.CallOption) (*cortexpb.WriteResponse, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.