Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedRemoteRuler ¶
type CachedRemoteRuler struct {
// contains filtered or unexported fields
}
CachedRemoteRuler is a thread-safe ruler that retrieves rules from an external service. It has a per-tenant cache: rulesPerTenant
func (*CachedRemoteRuler) RecordingRules ¶
func (r *CachedRemoteRuler) RecordingRules(tenant string) []*model.RecordingRule
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled"`
RulesSource struct {
ClientAddress string `yaml:"client_address"`
} `yaml:"rules_source"`
RemoteWriteAddress string `yaml:"remote_write_address"`
}
func (*Config) RegisterFlags ¶
type Exporter ¶
type Exporter interface {
Send(tenant string, series []prompb.TimeSeries) error
Flush()
}
func NewExporter ¶ added in v1.13.3
func NewExporter(remoteWriteAddress string, logger log.Logger, reg prometheus.Registerer) (Exporter, error)
type RecordingRulesClient ¶
type RecordingRulesClient interface {
RecordingRules(tenant string) ([]*model.RecordingRule, error)
}
type RoundTripper ¶ added in v1.13.3
type RoundTripper struct {
// contains filtered or unexported fields
}
type Ruler ¶
type Ruler interface {
// RecordingRules return a validated set of rules for a tenant, with the following guarantees:
// - a "__name__" label is present among ExternalLabels. It contains a valid prometheus metric name.
// - a matcher with name "__profile__type__" is present in Matchers
RecordingRules(tenant string) []*phlaremodel.RecordingRule
}
func NewCachedRemoteRuler ¶
func NewCachedRemoteRuler(client RecordingRulesClient, logger log.Logger) (Ruler, error)
func NewStaticRulerFromOverrides ¶
func NewStaticRulerFromOverrides(overrides *validation.Overrides) Ruler
type SampleObserver ¶
type SampleObserver struct {
// contains filtered or unexported fields
}
func NewSampleObserver ¶
func (*SampleObserver) Close ¶
func (o *SampleObserver) Close()
func (*SampleObserver) Observe ¶
func (o *SampleObserver) Observe(row block.ProfileEntry)
Observe manages two kind of states.
- Per tenant state: Gets initialized on first/new tenant. It fetches tenant's rules and creates a new recording for each rule. Data of old state is flushed to the exporter.
- recording states, per batch of rows: Every recording (hence every rule) has a state that is scoped to every batch of rows of the same fingerprint. When a new row fingerprint is detected, new state is computed for every recording. That state holds whether the rule matches the new batch of rows, and a reference of the sample to be aggregated to. Note that every rule will eventually create multiple single-sample (aggregated) series, depending on the rule.GroupBy space. More info in initState
This call is not thread-safe
type StaticExporter ¶
type StaticExporter struct {
// contains filtered or unexported fields
}
func (*StaticExporter) Flush ¶
func (e *StaticExporter) Flush()
func (*StaticExporter) Send ¶
func (e *StaticExporter) Send(tenantId string, data []prompb.TimeSeries) error
type StaticRuler ¶
type StaticRuler struct {
// contains filtered or unexported fields
}
func (StaticRuler) RecordingRules ¶
func (ruler StaticRuler) RecordingRules(tenant string) []*model.RecordingRule
Click to show internal directories.
Click to hide internal directories.