Documentation ¶
Index ¶
- func Alerts(conf *Config, updateMetrics updateMetricCallback) http.Handler
- func Delete(conf *Config, client *pgclient.Client) http.Handler
- func GenerateRouter(apiConf *Config, promqlConf *query.Config, client *pgclient.Client, ...) (*mux.Router, error)
- func Health(hc health.HealthCheckerFn) http.HandlerFunc
- func LabelValues(conf *Config, queryable promql.Queryable) http.Handler
- func Labels(conf *Config, queryable promql.Queryable) http.Handler
- func MetricMetadata(conf *Config, client *pgclient.Client) http.Handler
- func NewTraceServer(i ingestor.DBInserter) ptraceotlp.GRPCServer
- func Query(conf *Config, queryEngine *promql.Engine, queryable promql.Queryable, ...) http.Handler
- func QueryExemplar(conf *Config, queryable promql.Queryable, updateMetrics updateMetricCallback) http.Handler
- func QueryRange(conf *Config, promqlConf *query.Config, queryEngine *promql.Engine, ...) http.Handler
- func Read(config *Config, reader querier.Reader, metrics *Metrics, ...) http.Handler
- func RegisterTelemetryMetrics(t telemetry.Engine) error
- func Reload(reload func() error, webAdmin bool) http.HandlerFunc
- func Rules(conf *Config, updateMetrics updateMetricCallback) http.Handler
- func Series(conf *Config, queryable promql.Queryable) http.Handler
- func Validate(cfg *Config) error
- func Write(inserter ingestor.DBInserter, dataParser *parser.DefaultParser, ...) http.Handler
- type Alert
- type AlertDiscovery
- type AlertingRule
- type Config
- type Metrics
- type RecordingRule
- type Rule
- type RuleDiscovery
- type RuleGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRouter ¶
func GenerateRouter(apiConf *Config, promqlConf *query.Config, client *pgclient.Client, store *jaegerStore.Store, authWrapper mux.MiddlewareFunc, reload func() error) (*mux.Router, error)
TODO: Refactor this function to reduce number of paramaters.
func Health ¶
func Health(hc health.HealthCheckerFn) http.HandlerFunc
func NewTraceServer ¶
func NewTraceServer(i ingestor.DBInserter) ptraceotlp.GRPCServer
func QueryExemplar ¶
func QueryRange ¶
func Write ¶
func Write( inserter ingestor.DBInserter, dataParser *parser.DefaultParser, updateMetrics func(code string, duration, receivedSamples, receivedMetadata float64), ) http.Handler
Write returns an http.Handler that is responsible for data ingest.
Types ¶
type Alert ¶
type Alert struct { Labels labels.Labels `json:"labels"` Annotations labels.Labels `json:"annotations"` State string `json:"state"` ActiveAt *time.Time `json:"activeAt,omitempty"` Value string `json:"value"` }
Alert has info for an alert.
type AlertDiscovery ¶
type AlertDiscovery struct {
Alerts []*Alert `json:"alerts"`
}
AlertDiscovery has info for all active alerts.
type AlertingRule ¶
type AlertingRule struct { // State can be "pending", "firing", "inactive". State string `json:"state"` Name string `json:"name"` Query string `json:"query"` Duration float64 `json:"duration"` Labels labels.Labels `json:"labels"` Annotations labels.Labels `json:"annotations"` Alerts []*Alert `json:"alerts"` Health prom_rules.RuleHealth `json:"health"` LastError string `json:"lastError,omitempty"` EvaluationTime float64 `json:"evaluationTime"` LastEvaluation time.Time `json:"lastEvaluation"` // Type of an alertingRule is always "alerting". Type string `json:"type"` }
type Config ¶
type Metrics ¶
type Metrics struct { // Using the first word in struct to ensure proper alignment in 32-bit systems. // Reference: https://golang.org/pkg/sync/atomic/#pkg-note-BUG LastRequestUnixNano int64 HTTPRequestDuration *prometheus.HistogramVec RemoteReadReceivedQueries prometheus.Counter }
func InitMetrics ¶
func InitMetrics() *Metrics
InitMetrics sets up and returns the Prometheus metrics which Promscale exposes. This needs to be set before calling objects from the api package.
type RecordingRule ¶
type RecordingRule struct { Name string `json:"name"` Query string `json:"query"` Labels labels.Labels `json:"labels,omitempty"` Health prom_rules.RuleHealth `json:"health"` LastError string `json:"lastError,omitempty"` EvaluationTime float64 `json:"evaluationTime"` LastEvaluation time.Time `json:"lastEvaluation"` // Type of a recordingRule is always "recording". Type string `json:"type"` }
type RuleDiscovery ¶
type RuleDiscovery struct {
RuleGroups []*RuleGroup `json:"groups"`
}
RuleDiscovery has info for all rules
type RuleGroup ¶
type RuleGroup struct { Name string `json:"name"` File string `json:"file"` // In order to preserve rule ordering, while exposing type (alerting or recording) // specific properties, both alerting and recording rules are exposed in the // same array. Rules []Rule `json:"rules"` Interval float64 `json:"interval"` Limit int `json:"limit"` EvaluationTime float64 `json:"evaluationTime"` LastEvaluation time.Time `json:"lastEvaluation"` }
RuleGroup has info for rules which are part of a group
Source Files ¶
Click to show internal directories.
Click to hide internal directories.