docs: add spellcheck command (#6562)

### Describe Your Changes

Implement spellcheck command:
  - add cspell configuration files
  - dockerize spellchecking process
  - add Makefile targets

This PR adds a standalone `make spellcheck` target to check `docs/*.md` files for spelling
errors. The target process is dockerized to be run in a separate npm environment.

Some `docs/` typo fixes also included.

### Checklist

The following checks are **mandatory**:

- [x] My change adheres [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/contributing/).

---------

Signed-off-by: Arkadii Yakovets <ark@victoriametrics.com>
Signed-off-by: hagen1778 <roman@victoriametrics.com>
Co-authored-by: hagen1778 <roman@victoriametrics.com>
(cherry picked from commit fabf0b928e)
This commit is contained in:
Arkadii Yakovets 2024-07-11 03:39:42 -07:00 committed by hagen1778
parent 2ea575e776
commit 8645b2cc8e
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640
13 changed files with 1470 additions and 8 deletions

1
.gitignore vendored
View file

@ -24,3 +24,4 @@ _site
*.tmp *.tmp
/docs/.jekyll-metadata /docs/.jekyll-metadata
coverage.txt coverage.txt
cspell.json

View file

@ -17,6 +17,7 @@ GO_BUILDINFO = -X '$(PKG_PREFIX)/lib/buildinfo.Version=$(APP_NAME)-$(DATEINFO_TA
.PHONY: $(MAKECMDGOALS) .PHONY: $(MAKECMDGOALS)
include app/*/Makefile include app/*/Makefile
include cspell/Makefile
include docs/Makefile include docs/Makefile
include deployment/*/Makefile include deployment/*/Makefile
include dashboards/Makefile include dashboards/Makefile

12
cspell/Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM node:lts-alpine3.20
ENV PATH="/home/node/node_modules/.bin:$PATH"
WORKDIR /home/node
COPY package.json .
COPY package-lock.json .
RUN npm ci
WORKDIR /victoriametrics

25
cspell/Makefile Normal file
View file

@ -0,0 +1,25 @@
# These commands must be run from the VictoriaMetrics repository root.
# Builds cspell image.
cspell-install:
@ (docker inspect cspell > /dev/null) || (docker build cspell --tag cspell)
# Checks for spelling errors.
cspell-check: cspell-install
@CMD="cspell --no-progress" $(MAKE) cspell-run-command
# Runs spelling error check.
# A user facing alias to cspell-check command.
spellcheck: cspell-check
# Runs cspell container commands.
cspell-run-command:
@cp cspell/cspell.json cspell.json
@-docker run \
--entrypoint /bin/sh \
--mount type=bind,src=".",dst=/victoriametrics \
--rm \
--tty \
cspell -c "$(CMD)"
@rm cspell.json

11
cspell/README.md Normal file
View file

@ -0,0 +1,11 @@
# Spell checking
This directory contains configuration and instructions for spell checking in
[docs](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/docs) folder.
To run execute the following command:
```sh
make cspell-check
```
This command required Docker to build `cspell` image and run the spell checks.

67
cspell/cspell.json Normal file
View file

@ -0,0 +1,67 @@
{
"allowCompoundWords": true,
"caseSensitive": false,
"language": "en,ru,uk",
"minWordLength": 3,
"dictionaryDefinitions": [
{
"addWords": true,
"name": "custom-dict",
"path": "cspell/custom-dict.txt"
}
],
"dictionaries": [
"aws",
"bash",
"companies",
"cpp",
"css",
"custom-dict",
"data-science",
"docker",
"dotnet",
"en_us",
"en-common-misspelling",
"fonts",
"fullstack",
"golang",
"html",
"k8s",
"makefile",
"misc",
"npm",
"people-names",
"python",
"ru_RU",
"rust",
"software-terms",
"uk_UA",
"win32"
],
"enabled": true,
"files": ["docs/**/*.md"],
"ignoreRegExpList": [
// Github usernames
"/@[a-zA-Z0-9-_]+/i",
// Tokens
"/Authorization:\\sBearer\\s[a-zA-Z0-9-_=]+\\.[a-zA-Z0-9-_=]+\\.[a-zA-Z0-9-_=]+/",
"/(user|password|token):\\s\"?[a-zA-Z0-9-_<>=\\.]+\"?/",
// Victoria Metrics related names
"/vm[a-zA-Z0-9-_]+/i"
],
"import": [
"/home/node/node_modules/@cspell/dict-aws/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-companies/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-data-science/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-en_us/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-fullstack/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-golang/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-k8s/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-people-names/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-ru_ru/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-software-terms/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-uk-ua/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-win32/cspell-ext.json"
],
"useGitignore": true
}

25
cspell/custom-dict.txt Normal file
View file

@ -0,0 +1,25 @@
Aecio
ampl
Amz
apiextensionsv
appsv
aps
Asafs124142
ays
betav
bxc
crds
eeks
Folz
giv
jimmidyson
keyсoncepts
metav
MHI
nn
otlpmetric
otlpmetrichttp
sgn
xzf
ошиб
vcpu

1304
cspell/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

16
cspell/package.json Normal file
View file

@ -0,0 +1,16 @@
{
"devDependencies": {
"@cspell/dict-aws": "^4.0.2",
"@cspell/dict-data-science": "^2.0.1",
"@cspell/dict-en_us": "^4.3.21",
"@cspell/dict-fullstack": "^3.1.8",
"@cspell/dict-golang": "^6.0.9",
"@cspell/dict-k8s": "^1.0.5",
"@cspell/dict-people-names": "^1.0.3",
"@cspell/dict-ru_ru": "^2.2.1",
"@cspell/dict-software-terms": "^3.4.5",
"@cspell/dict-uk-ua": "^4.0.1",
"@cspell/dict-win32": "^2.0.3",
"cspell": "^8.8.4"
}
}

View file

@ -72,7 +72,7 @@ Released at 2024-06-27
* FEATURE: add `/select/logsql/stream_ids` HTTP endpoint, which can be used for returning [`_stream_id` values](https://docs.victoriametrics.com/victorialogs/keyconcepts/#stream-fields) with the number of hits for the given [LogsQL query](https://docs.victoriametrics.com/victorialogs/logsql/). See [these docs](https://docs.victoriametrics.com/victorialogs/querying/#querying-stream_ids) for details. * FEATURE: add `/select/logsql/stream_ids` HTTP endpoint, which can be used for returning [`_stream_id` values](https://docs.victoriametrics.com/victorialogs/keyconcepts/#stream-fields) with the number of hits for the given [LogsQL query](https://docs.victoriametrics.com/victorialogs/logsql/). See [these docs](https://docs.victoriametrics.com/victorialogs/querying/#querying-stream_ids) for details.
* FEATURE: add `-retention.maxDiskSpaceUsageBytes` command-line flag, which allows limiting disk space usage for [VictoriaLogs data](https://docs.victoriametrics.com/victorialogs/#storage) by automatic dropping the oldest per-day partitions if the storage disk space usage becomes bigger than the `-retention.maxDiskSpaceUsageBytes`. See [these docs](https://docs.victoriametrics.com/victorialogs/#retention-by-disk-space-usage). * FEATURE: add `-retention.maxDiskSpaceUsageBytes` command-line flag, which allows limiting disk space usage for [VictoriaLogs data](https://docs.victoriametrics.com/victorialogs/#storage) by automatic dropping the oldest per-day partitions if the storage disk space usage becomes bigger than the `-retention.maxDiskSpaceUsageBytes`. See [these docs](https://docs.victoriametrics.com/victorialogs/#retention-by-disk-space-usage).
* BUGFIX: properly take into account query timeout specified via `-search.maxQueryDuration` command-line flag and/or via `timeout` query arg. Previously these timeouts could be ingored during query execution. * BUGFIX: properly take into account query timeout specified via `-search.maxQueryDuration` command-line flag and/or via `timeout` query arg. Previously these timeouts could be ignored during query execution.
* BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix the update of the relative time range when `Execute Query` is clicked. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6345). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix the update of the relative time range when `Execute Query` is clicked. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6345).
## [v0.23.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.23.0-victorialogs) ## [v0.23.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.23.0-victorialogs)
@ -116,7 +116,7 @@ Released at 2024-06-18
Released at 2024-06-17 Released at 2024-06-17
* FEATURE: add ability to accept logs in [Syslog format](https://en.wikipedia.org/wiki/Syslog). See [these docs](https://docs.victoriametrics.com/victorialogs/data-ingestion/syslog/). * FEATURE: add ability to accept logs in [Syslog format](https://en.wikipedia.org/wiki/Syslog). See [these docs](https://docs.victoriametrics.com/victorialogs/data-ingestion/syslog/).
* FEATURE: add abitlity to specify timezone offset when parsing [rfc3164](https://datatracker.ietf.org/doc/html/rfc3164) syslog messages with [`unpack_syslog` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_syslog-pipe). * FEATURE: add ability to specify timezone offset when parsing [rfc3164](https://datatracker.ietf.org/doc/html/rfc3164) syslog messages with [`unpack_syslog` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_syslog-pipe).
* FEATURE: add [`top` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#top-pipe) for returning top N sets of the given fields with the maximum number of matching log entries. * FEATURE: add [`top` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#top-pipe) for returning top N sets of the given fields with the maximum number of matching log entries.
## [v0.19.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.19.0-victorialogs) ## [v0.19.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.19.0-victorialogs)

View file

@ -1783,7 +1783,7 @@ It has the following format:
``` ```
Where `exprX` is one of the supported math expressions mentioned below, while `resultNameX` is the name of the field to store the calculated result to. Where `exprX` is one of the supported math expressions mentioned below, while `resultNameX` is the name of the field to store the calculated result to.
The `as` keyword is optional. The result name can be omitted. In this case the result is stored to a field with the name equal to string represenation The `as` keyword is optional. The result name can be omitted. In this case the result is stored to a field with the name equal to string representation
of the corresponding math expression. of the corresponding math expression.
`exprX` may reference `resultNameY` calculated before the given `exprX`. `exprX` may reference `resultNameY` calculated before the given `exprX`.
@ -2328,7 +2328,7 @@ The following query returns up to 5 additional logs in front of every log messag
_time:5m stacktrace | stream_context before 5 _time:5m stacktrace | stream_context before 5
``` ```
The following query returns up to 2 logs in frount of the log message with the `error` [word](#word) and up to 5 logs after this log message The following query returns up to 2 logs in front of the log message with the `error` [word](#word) and up to 5 logs after this log message
across all the logs for the last 5 minutes: across all the logs for the last 5 minutes:
```logsql ```logsql
@ -2666,7 +2666,7 @@ See also:
#### Conditional unpack_syslog #### Conditional unpack_syslog
If the [`unpack_syslog` pipe](#unpack_syslog-pipe) musn't be applied to every [log entry](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model), If the [`unpack_syslog` pipe](#unpack_syslog-pipe) mustn't be applied to every [log entry](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model),
then add `if (<filters>)` after `unpack_syslog`. then add `if (<filters>)` after `unpack_syslog`.
The `<filters>` can contain arbitrary [filters](#filters). For example, the following query unpacks syslog message fields from `foo` field The `<filters>` can contain arbitrary [filters](#filters). For example, the following query unpacks syslog message fields from `foo` field
only if `hostname` field in the current log entry isn't set or empty: only if `hostname` field in the current log entry isn't set or empty:

View file

@ -47,7 +47,7 @@ menu:
- **Small usability fix is better than non-trivial feature.** Usability fix makes happy existing users. - **Small usability fix is better than non-trivial feature.** Usability fix makes happy existing users.
Non-trivial feature may make happy some new users, while it may make upset a big share of existing users Non-trivial feature may make happy some new users, while it may make upset a big share of existing users
if the feature breaks some essential functionaly of VictoriaMetrics components or makes it less efficient. if the feature breaks some essential functionality of VictoriaMetrics components or makes it less efficient.
- **Good docs are better than new shiny feature.** Good docs help users discovering new functionality and dealing - **Good docs are better than new shiny feature.** Good docs help users discovering new functionality and dealing
with VictoriaMetrics components in the most efficient way. Nobody uses new shiny feature if it isn't documented properly. with VictoriaMetrics components in the most efficient way. Nobody uses new shiny feature if it isn't documented properly.

View file

@ -133,7 +133,7 @@ outside the current [aggregation interval](#stream-aggregation-config) must be i
Streaming aggregation results may be incorrect for some time after the restart of [vmagent](https://docs.victoriametrics.com/vmagent/) Streaming aggregation results may be incorrect for some time after the restart of [vmagent](https://docs.victoriametrics.com/vmagent/)
or [single-node VictoriaMetrics](https://docs.victoriametrics.com/) until all the buffered [samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) or [single-node VictoriaMetrics](https://docs.victoriametrics.com/) until all the buffered [samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples)
are sent from remote sources to the `vmagent` or single-node VictoriaMetrics via [supported data ingestion protocols](https://docs.victoriametrics.com/vmagent/#how-to-push-data-to-vmagent). are sent from remote sources to the `vmagent` or single-node VictoriaMetrics via [supported data ingestion protocols](https://docs.victoriametrics.com/vmagent/#how-to-push-data-to-vmagent).
In this case it may be a good idea to drop the aggregated data during the first `N` [aggrgation intervals](#stream-aggregation-config) In this case it may be a good idea to drop the aggregated data during the first `N` [aggregation intervals](#stream-aggregation-config)
just after the restart of `vmagent` or single-node VictoriaMetrics. This can be done via the following options: just after the restart of `vmagent` or single-node VictoriaMetrics. This can be done via the following options:
- The `-streamAggr.ignoreFirstIntervals=N` command-line flag at `vmagent` and single-node VictoriaMetrics. This flag instructs skipping the first `N` - The `-streamAggr.ignoreFirstIntervals=N` command-line flag at `vmagent` and single-node VictoriaMetrics. This flag instructs skipping the first `N`