remotewrite

package
v1.97.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrQueueFullHTTPRetry must be returned when TryPush() returns false.
	ErrQueueFullHTTPRetry = &httpserver.ErrorWithStatusCode{
		Err: fmt.Errorf("remote storage systems cannot keep up with the data ingestion rate; retry the request later " +
			"or remove -remoteWrite.disableOnDiskQueue from vmagent command-line flags, so it could save pending data to -remoteWrite.tmpDataPath; " +
			"see https://docs.victoriametrics.com/vmagent.html#disabling-on-disk-persistence"),
		StatusCode: http.StatusTooManyRequests,
	}
)

Functions

func CheckRelabelConfigs added in v1.35.6

func CheckRelabelConfigs() error

CheckRelabelConfigs checks -remoteWrite.relabelConfig and -remoteWrite.urlRelabelConfig.

func CheckStreamAggrConfigs added in v1.90.0

func CheckStreamAggrConfigs() error

CheckStreamAggrConfigs checks configs pointed by -remoteWrite.streamAggr.config

func Init

func Init()

Init initializes remotewrite.

It must be called after flag.Parse().

Stop must be called for graceful shutdown.

func InitSecretFlags added in v1.42.0

func InitSecretFlags()

InitSecretFlags must be called after flag.Parse and before any logging.

func MultitenancyEnabled added in v1.64.0

func MultitenancyEnabled() bool

MultitenancyEnabled returns true if -enableMultitenantHandlers or -remoteWrite.multitenantURL is specified.

func PushDropSamplesOnFailure added in v1.96.0

func PushDropSamplesOnFailure(at *auth.Token, wr *prompbmarshal.WriteRequest)

PushDropSamplesOnFailure pushes wr to the configured remote storage systems set via -remoteWrite.url and -remoteWrite.multitenantURL

If at is nil, then the data is pushed to the configured -remoteWrite.url. If at isn't nil, the data is pushed to the configured -remoteWrite.multitenantURL.

PushDropSamplesOnFailure can modify wr contents.

func Stop

func Stop()

Stop stops remotewrite.

It is expected that nobody calls TryPush during and after the call to this func.

func TryPush added in v1.96.0

func TryPush(at *auth.Token, wr *prompbmarshal.WriteRequest) bool

TryPush tries sending wr to the configured remote storage systems set via -remoteWrite.url and -remoteWrite.multitenantURL

If at is nil, then the data is pushed to the configured -remoteWrite.url. If at isn't nil, the data is pushed to the configured -remoteWrite.multitenantURL.

TryPush can modify wr contents, so the caller must re-initialize wr before calling TryPush() after unsuccessful attempt. TryPush may send partial data from wr on unsuccessful attempt, so repeated call for the same wr may send the data multiple times.

The caller must return ErrQueueFullHTTPRetry to the client, which sends wr, if TryPush returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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