receive

package
v0.0.0-...-98dad3e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRequestLimit = 128 * 1024

DefaultRequestLimit is the size limit of a request body coming in

Variables

View Source
var (
	ErrRequiredLabelMissing        = fmt.Errorf("a required label is missing from the metric")
	ErrRequiredLabelValueIncorrect = fmt.Errorf("a required label value is incorrect")
)

Functions

func PrompbLabelsToPromLabels

func PrompbLabelsToPromLabels(lset []prompb.Label) labels.Labels

Types

type ClusterAuthorizer

type ClusterAuthorizer interface {
	AuthorizeCluster(token, cluster string) (subject string, err error)
}

ClusterAuthorizer authorizes a cluster by its token and id, returning a subject or error

type Handler

type Handler struct {
	ForwardURL string
	// contains filtered or unexported fields
}

Handler knows the forwardURL for all requests

func NewHandler

func NewHandler(logger log.Logger, forwardURL string, client *http.Client, reg prometheus.Registerer, tenantID string,
	whitelistRules []string, elideLabels []string, requiredLabelValsFromCtx map[string]interface{}) (*Handler, error)

NewHandler returns a new Handler with a http client

func (*Handler) LimitBodySize

func (h *Handler) LimitBodySize(limit int64, next http.Handler) http.HandlerFunc

LimitBodySize is a middleware that check that the request body is not bigger than the limit

func (*Handler) Receive

func (h *Handler) Receive(w http.ResponseWriter, r *http.Request)

Receive a remote-write request after it has been authenticated and forward it to Thanos

func (*Handler) TransformAndValidateWriteRequest

func (h *Handler) TransformAndValidateWriteRequest(next http.Handler, labels ...string) http.HandlerFunc

Jump to

Keyboard shortcuts

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