Skip to content

Instantly share code, notes, and snippets.

@skyrocknroll
Last active August 7, 2020 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyrocknroll/fad4870d8383f79896179f3d131998d2 to your computer and use it in GitHub Desktop.
Save skyrocknroll/fad4870d8383f79896179f3d131998d2 to your computer and use it in GitHub Desktop.
[victoriametrics] #victoria #metrics
If i refer to the doc, vmagent stores the data in a buffer reference by "-remoteWrite.tmpDataPath". Am I right?
	Correct.
There for where are the data collected by vmagent stored when vmstorage doesn't respond?
	If vminsert fails to send data to a particular vmstorage node, then it falls back by sending the data to the remaining vmstorage nodes. This prevents from data loss on ingestion path. If all the vmstorage nodes are unavailable, then vminsert starts buffering incoming data in memory in the hope vmstorage nodes will appear soon. The buffer size is limited by -memory.allowedPercent command-line flag. When the buffer becomes full, then vminsert starts dropping newly incoming data and responding with 503 Service Unavailable status code. Conforming clients such as vmagent must retry sending the data if they receive responses with such status code.
For converting all the hyphens to underscores in label names you should use the following relabeling config:
- action: labelmap_all
  regex: "-"
  replacement: "_"
Other options aren't needed in this config.
For converting all the hyphens to underscores in metric name you should use a separate relabeleing config:
- action: replace_all
  source_labels: [__name__]
  regex: "-"
  replacement: "_"
You need to use both relabeling configs for converting hyphens to underscores in metric names and label names.
See more details about relabeling configs at https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config and at https://victoriametrics.github.io/vmagent.html#relabeling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment