Commit graph

2795 commits

Author SHA1 Message Date
Roman Khavronenko
adfc6539ca
vmctl: mention replicationFactor during migration (#4633)
Addresses https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4624

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-07-14 10:52:39 +02:00
Aliaksandr Valialkin
71f3898f84
docs/CHANGELOG.md: refer to the commit 7094fa38bc 2023-07-13 16:14:28 -07:00
Aliaksandr Valialkin
7094fa38bc
lib/storage: switch from global to per-day index for MetricName -> TSID mapping
Previously all the newly ingested time series were registered in global `MetricName -> TSID` index.
This index was used during data ingestion for locating the TSID (internal series id)
for the given canonical metric name (the canonical metric name consists of metric name plus all its labels sorted by label names).

The `MetricName -> TSID` index is stored on disk in order to make sure that the data
isn't lost on VictoriaMetrics restart or unclean shutdown.

The lookup in this index is relatively slow, since VictoriaMetrics needs to read the corresponding
data block from disk, unpack it, put the unpacked block into `indexdb/dataBlocks` cache,
and then search for the given `MetricName -> TSID` entry there. So VictoriaMetrics
uses in-memory cache for speeding up the lookup for active time series.
This cache is named `storage/tsid`. If this cache capacity is enough for all the currently ingested
active time series, then VictoriaMetrics works fast, since it doesn't need to read the data from disk.

VictoriaMetrics starts reading data from `MetricName -> TSID` on-disk index in the following cases:

- If `storage/tsid` cache capacity isn't enough for active time series.
  Then just increase available memory for VictoriaMetrics or reduce the number of active time series
  ingested into VictoriaMetrics.

- If new time series is ingested into VictoriaMetrics. In this case it cannot find
  the needed entry in the `storage/tsid` cache, so it needs to consult on-disk `MetricName -> TSID` index,
  since it doesn't know that the index has no the corresponding entry too.
  This is a typical event under high churn rate, when old time series are constantly substituted
  with new time series.

Reading the data from `MetricName -> TSID` index is slow, so inserts, which lead to reading this index,
are counted as slow inserts, and they can be monitored via `vm_slow_row_inserts_total` metric exposed by VictoriaMetrics.

Prior to this commit the `MetricName -> TSID` index was global, e.g. it contained entries sorted by `MetricName`
for all the time series ever ingested into VictoriaMetrics during the configured -retentionPeriod.
This index can become very large under high churn rate and long retention. VictoriaMetrics
caches data from this index in `indexdb/dataBlocks` in-memory cache for speeding up index lookups.
The `indexdb/dataBlocks` cache may occupy significant share of available memory for storing
recently accessed blocks at `MetricName -> TSID` index when searching for newly ingested time series.

This commit switches from global `MetricName -> TSID` index to per-day index. This allows significantly
reducing the amounts of data, which needs to be cached in `indexdb/dataBlocks`, since now VictoriaMetrics
consults only the index for the current day when new time series is ingested into it.

The downside of this change is increased indexdb size on disk for workloads without high churn rate,
e.g. with static time series, which do no change over time, since now VictoriaMetrics needs to store
identical `MetricName -> TSID` entries for static time series for every day.

This change removes an optimization for reducing CPU and disk IO spikes at indexdb rotation,
since it didn't work correctly - see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1401 .

At the same time the change fixes the issue, which could result in lost access to time series,
which stop receving new samples during the first hour after indexdb rotation - see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2698

The issue with the increased CPU and disk IO usage during indexdb rotation will be addressed
in a separate commit according to https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1401#issuecomment-1553488685

This is a follow-up for 1f28b46ae9
2023-07-13 16:07:30 -07:00
Aliaksandr Valialkin
8eeaf9b1f6
docs/CHANGELOG.md: clarify the description of the bugfix at 177a0c1ca9
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4555
2023-07-13 12:20:03 -07:00
Dmytro Kozlov
c76084b529
app/vmctl: fix panic --remote-read-filter-time-start flag not defined (#4605)
* app/vmctl: fix panic `--remote-read-filter-time-start` flag not defined

* app/vmctl: update CHANGELOG.md

---------

Co-authored-by: Nikolay <nik@victoriametrics.com>
2023-07-13 17:14:43 +02:00
Dmytro Kozlov
177a0c1ca9
app/vmctl: fix issue with adding many seconds (#4617)
* app/vmctl: fix issue with adding many seconds

* app/vmagent: add CHANGELOG.md
2023-07-13 17:11:48 +02:00
Roman Khavronenko
cbc28ccdb2
vmalert: check for negative offset for missed rounds (#4628)
It could happen for low evaluation intervals and irregular
delays during execution that evaluation time would get
a negative offset. This could result into cumulative
discrepancy between the actual time and evaluation time for rules.

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-07-13 17:11:22 +02:00
Alexander Marshalov
41b58a8e55
fixed typo (#4622)
Signed-off-by: Alexander Marshalov <_@marshalov.org>
2023-07-12 18:14:41 +02:00
Alexander Marshalov
0b9fadb02c
add info about using stream aggregation as statsd alternative (#4600) (#4621)
Signed-off-by: Alexander Marshalov <_@marshalov.org>
2023-07-12 16:53:25 +02:00
Aliaksandr Valialkin
2b9e288a03
docs/VictoriaLogs/FAQ.md: small fixes 2023-07-12 01:10:32 -07:00
Aliaksandr Valialkin
30cdcc751d
all: update Go builder from 1.20.5 to 1.20.6
See https://github.com/golang/go/issues?q=milestone%3AGo1.20.6+label%3ACherryPickApproved
2023-07-12 00:59:59 -07:00
Aliaksandr Valialkin
0953e48c3a
docs/keyConcepts.md: cosmetic fixes after b67bd156d5 2023-07-12 00:28:44 -07:00
Aliaksandr Valialkin
dc5e50451d
docs/VictoriaLogs: add FAQ 2023-07-12 00:25:05 -07:00
Aliaksandr Valialkin
a46c0146c9
docs/VictoriaLogs/README.md: make it clear that VictoriaLogs is open source 2023-07-12 00:25:04 -07:00
Alexander Marshalov
e3bb0afe82
follow up for #4612 and #4584 (#4614)
Signed-off-by: Alexander Marshalov <_@marshalov.org>
2023-07-11 13:59:46 +04:00
Zakhar Bessarab
195b9386cb
doc: fix image src after b67bd156 (#4612)
Followup for b67bd156d5

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
2023-07-11 13:19:05 +04:00
Alexander Marshalov
b67bd156d5
added info about search.latencyOffset to key concepts (#4567) (#4584)
Signed-off-by: Alexander Marshalov <_@marshalov.org>
Co-authored-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
2023-07-11 09:57:36 +02:00
Aliaksandr Valialkin
a0ff5c2627
docs/VictoriaLogs: make more prominent the information about returned log fields in query responses
Thanks to @candlerb for suggestions on how to improve VictoriaLogs docs
at https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4609#issuecomment-1629758426
2023-07-10 15:01:20 -07:00
Dmytro Kozlov
a0a76d7b48
app/vmctl: remove undefined flag from the documentation. See: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4552. (#4606) 2023-07-10 19:20:31 +04:00
Aliaksandr Valialkin
7d45fc1f99
app/vmselect/netstorage: follow-up after 173ccf4333
- Clarify docs about -replicationFactor command-line flag at vmselect
- Clarify description for -replicationFactor and -search.skipSlowReplicas command-line flags
- Fix the logic for returning responses if -search.skipSlowReplicas command-line flag
  is enabled. The logic was broken in the 173ccf4333,
  so it could return responses only if some of vmstorage nodes return error,
  while it should return when query results are successfully collected from more than
  (len(storageNodes) - replicationFactor) vmstorage nodes.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1207
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2023-07-09 12:40:06 -07:00
Roman Khavronenko
fb03762d4d
vmselect: introduce search.skipSlowReplicas cmd-line flag (#4538)
* vmselect: introduce `search.skipSlowReplicas` cmd-line flag

vmselect has two logical conditions during request processing when
`-replicationFactor` cmd-line flag is set:
1. If at least `len(storageNodes) - replicationFactor` responded, it could skip
waiting for the rest of nodes to respond. This could lead to problems described
here https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1207.
2. Mark response as partial if less than `len(storageNodes) - replicationFactor` responded
without an error.

The P1 showed itself error-prone and became the main reason why
`-replicationFactor` wasn't recommended to use at vmselect level.
However, this optimization could be still very useful in situations
when there are slow and fast replicas in cluster.

But P2 remains viable and important conditionless.
Hiding P1 behind the feature-flag `search.skipSlowReplicas`
should make `-replicationFactor` flag usable again. And let users
choose whether they want P1 to be respected.

Related issues
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1207
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711

Signed-off-by: hagen1778 <roman@victoriametrics.com>

* docs: update changelog

Signed-off-by: hagen1778 <roman@victoriametrics.com>

---------

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-07-09 12:30:06 -07:00
Aliaksandr Valialkin
45cec4728c
docs/Single-server-VictoriaMetrics.md: mention how to use Prometheus config file with unsupported options
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4274
2023-07-09 11:28:36 -07:00
Aliaksandr Valialkin
9fb553aafe
docs/vmalert.md: run make docs-sync after 7c8a215a7c 2023-07-09 11:28:02 -07:00
Aliaksandr Valialkin
fe57e99a5b
docs/VictoriaLogs: small clarifications 2023-07-09 11:00:49 -07:00
Zakhar Bessarab
51a9cc9783
docs: make httpAuth.* flags description less ambiguous (#4588)
* docs: make `httpAuth.*` flags description less ambiguous

Currently, it may confuse users whether `httpAuth.*` flags are used by HTTP client or server configuration(see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4586 for example).

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>

* docs: fix a typo

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>

---------

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
2023-07-07 13:50:13 +02:00
Haleygo
20e7db47ee
vmselect: fix result in Prometheus query when time is small (#4578)
vmselect: fix result in Prometheus query when time is small

Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
2023-07-07 11:48:05 +02:00
Haleygo
bca8ae034f
vmalert:fix query request using rfc3339 format (#4577)
vmalert: consistently use time.RFC3339 format for time in queries

Co-authored-by: hagen1778 <roman@victoriametrics.com>
2023-07-07 10:39:25 +02:00
Artem Navoiev
8f1f80c4f8
update logo width in cluster doc to 300
Signed-off-by: Artem Navoiev <tenmozes@gmail.com>
2023-07-06 23:16:01 -07:00
Aliaksandr Valialkin
d32780de5c
docs/vmgateway.md: update -help output 2023-07-06 23:13:07 -07:00
Aliaksandr Valialkin
5c36935b8b
docs/Cluster-VictoriaMetrics.md: update -help output 2023-07-06 23:13:07 -07:00
Aliaksandr Valialkin
8a45a2e770
docs/vmbackupmanager.md: update -help output 2023-07-06 23:13:06 -07:00
Aliaksandr Valialkin
c6bf60e2cc
docs/vmrestore.md: update -help output 2023-07-06 23:13:06 -07:00
Aliaksandr Valialkin
02a81da3ca
docs/vmbackup.md: update -help output 2023-07-06 23:13:05 -07:00
Aliaksandr Valialkin
81f5f118ce
docs/vmauth.md: update -help output 2023-07-06 23:13:05 -07:00
Aliaksandr Valialkin
9fa8e3895a
docs/vmalert.md: update -help output 2023-07-06 23:13:04 -07:00
Aliaksandr Valialkin
009af1ce90
docs/vmagent.md: update -help output 2023-07-06 23:13:04 -07:00
Aliaksandr Valialkin
d856fa73a2
docs/Single-server-VictoriaMetrics.md: update -help output 2023-07-06 23:13:03 -07:00
Roman Khavronenko
7c8a215a7c
vmalert: allow disabling of step param attached to instant queries (#4574)
vmalert: allow disabling of `step` param attached to instant queries

This might be useful for using vmalert with datasources that to not support this param,
unlike VictoriaMetrics.

See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4573

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-07-07 07:44:34 +02:00
Aliaksandr Valialkin
152ca00fb8
docs/CHANGELOG.md: clarify description for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4336 bugfix
This is a follow-up for 5eb5df96e2
2023-07-06 17:09:03 -07:00
Aliaksandr Valialkin
c851d78c93
docs/CHANGELOG.md: use the proper link to the issue related to the commit 7a92263459
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4402
2023-07-06 16:59:49 -07:00
Aliaksandr Valialkin
4991d9b299
docs/CHANGELOG.md: remove redundant info from the url to consulagent_sd_configs docs
This is a follow-up for 40d12be607
2023-07-06 16:53:05 -07:00
Aliaksandr Valialkin
c473dcaac8
docs/CHANGELOG.md: clarify the description of the bugfix at ce7141383d 2023-07-06 16:24:03 -07:00
Aliaksandr Valialkin
10a0533417
docs/CHANGELOG.md: remove the change regarding http2 support at vmagent
This is a follow-up for 8a07621a0c

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4283
2023-07-06 16:06:30 -07:00
Aliaksandr Valialkin
7f3b5431a1
app/vmselect/graphite: follow-up after c7884f8686
- Consistently use -search.maxGraphiteTagValues for limiting tag values from auto-complete API
- Use -search.maxGraphiteSeries for limiting paths (aka series), which can be returned from Graphite series API
- Clarify the change in docs/CHANGELOG.md

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4339
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2841
2023-07-06 15:21:56 -07:00
Alexander Marshalov
af53c7cc78
fix removing storage data dir before restoring from backup (#598)
* fix removing storage data dir before restoring from backup

Signed-off-by: Alexander Marshalov <_@marshalov.org>

* fix review comment

Signed-off-by: Alexander Marshalov <_@marshalov.org>

* fix review comment

Signed-off-by: Alexander Marshalov <_@marshalov.org>

* fixes after merge with `enterprise-single-node` branch

Signed-off-by: Alexander Marshalov <_@marshalov.org>

---------

Signed-off-by: Alexander Marshalov <_@marshalov.org>
2023-07-06 14:16:18 -07:00
Aliaksandr Valialkin
792860db10
lib/promscrape/discoveryutils: re-use checkRedirect function for both client and blockingClient
Also document follow_redirects option at https://docs.victoriametrics.com/sd_configs.html#http-api-client-options

This is a follow-up for b3d0ff463a

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4282
2023-07-06 10:51:33 -07:00
Aliaksandr Valialkin
3d28357bd3
app/vmselect/netstorage: follow-up after 11ac551d52
- Clarify the scope of the fix at docs/CHANGELOG.md
- Handle the case when -search.maxSamplesPerSeries limit is exceeded
  in the same way as the -search.maxSamplesPerQuery limit.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4472
2023-07-05 21:25:06 -07:00
Roman Khavronenko
922bbabd25
docs: explicitly mention errors processing for import APIs (#4583)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-07-06 00:21:56 +02:00
Denys Holius
0e4b883341
docs: adds curl commands to clear the query cache (#4468)
adds curl commands to clear query cache on vmselect/VM Single
2023-07-05 09:43:12 +02:00
Aliaksandr Valialkin
c93cf8dba4
docs/VictoriaLogs/LogsQL.md: various fixes according to https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4579 2023-07-04 14:13:38 -07:00