Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPrometheus ¶
func NewPrometheus( queryable storage.SampleAndChunkQueryable, appendable storage.Appendable, maxConcurrent int, metricRegistry prometheus.Registerer, useThanosPromQLEngine bool, apiLogger zerolog.Logger, ) *v1.API
NewPrometheus returns a new initialized Prometheus web API. Only remote read/write and PromQL endpoints are implemented. appendable can be empty if remote write is not used.
Types ¶
type API ¶
type API struct { ListenAddress string ReadOnly bool Index types.Index Reader types.MetricReader Writer types.MetricWriter MutableLabelWriter MutableLabelInterface FlushCallback func() error PreAggregateCallback func(ctx context.Context, thread int, from, to time.Time, matchers []*labels.Matcher) error MaxConcurrentRemoteRequests int // MaxRequestBodySizeBytes defines the maximum size of incoming requests body. MaxRequestBodySizeBytes int64 PromQLMaxEvaluatedPoints uint64 MetricRegistry prometheus.Registerer PromQLMaxEvaluatedSeries uint32 TenantLabelName string MutableLabelDetector remotestorage.MutableLabelDetector // When enabled, return an response to queries and write // requests that don't provide the tenant header. RequireTenantHeader bool UseThanosPromQLEngine bool Logger zerolog.Logger FuturePointsBackdateOffset time.Duration // contains filtered or unexported fields }
API it the SquirrelDB HTTP API server.
func (*API) ListenPort ¶
ListenPort return the port listenning on. Should not be used before Run() signalled its readiness. This is useful for tests that use port "0" to known the actual listenning port.
type MutableLabelInterface ¶
type MutableLabelInterface interface { WriteLabelValues(ctx context.Context, lbls []mutable.LabelWithValues) error DeleteLabelValues(ctx context.Context, lbls []mutable.Label) error WriteLabelNames(ctx context.Context, lbls []mutable.LabelWithName) error DeleteLabelNames(ctx context.Context, names []mutable.LabelKey) error Dump(ctx context.Context, w io.Writer) error Import(ctx context.Context, r io.Reader, w io.Writer, dryRun bool) error }
Click to show internal directories.
Click to hide internal directories.