docs: follow-up after 491287ed15

491287ed15
Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
hagen1778 2024-01-27 19:11:38 +01:00
parent 491287ed15
commit c20d68e28d
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640
5 changed files with 28 additions and 30 deletions

View file

@ -196,7 +196,7 @@ Snap package for VictoriaMetrics is available [here](https://snapcraft.io/victor
Command-line flags for Snap package can be set with following command: Command-line flags for Snap package can be set with following command:
```text ```sh
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics snap restart victoriametrics
``` ```
@ -205,7 +205,7 @@ Do not change value for `-storageDataPath` flag, because snap package has limite
Changing scrape configuration is possible with text editor: Changing scrape configuration is possible with text editor:
```text ```sh
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
``` ```

View file

@ -199,7 +199,7 @@ Snap package for VictoriaMetrics is available [here](https://snapcraft.io/victor
Command-line flags for Snap package can be set with following command: Command-line flags for Snap package can be set with following command:
```text ```sh
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics snap restart victoriametrics
``` ```
@ -208,7 +208,7 @@ Do not change value for `-storageDataPath` flag, because snap package has limite
Changing scrape configuration is possible with text editor: Changing scrape configuration is possible with text editor:
```text ```sh
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
``` ```
@ -525,7 +525,7 @@ or via [configuration file](https://docs.datadoghq.com/agent/guide/agent-configu
To configure DataDog agent via ENV variable add the following prefix: To configure DataDog agent via ENV variable add the following prefix:
```text ```sh
DD_DD_URL=http://victoriametrics:8428/datadog DD_DD_URL=http://victoriametrics:8428/datadog
``` ```
@ -535,7 +535,7 @@ _Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/
To configure DataDog agent via [configuration file](https://github.com/DataDog/datadog-agent/blob/878600ef7a55c5ef0efb41ed0915f020cf7e3bd0/pkg/config/config_template.yaml#L33) To configure DataDog agent via [configuration file](https://github.com/DataDog/datadog-agent/blob/878600ef7a55c5ef0efb41ed0915f020cf7e3bd0/pkg/config/config_template.yaml#L33)
add the following line: add the following line:
```text ```yaml
dd_url: http://victoriametrics:8428/datadog dd_url: http://victoriametrics:8428/datadog
``` ```
@ -547,12 +547,12 @@ pick [single-node or cluster URL](https://docs.victoriametrics.com/url-examples.
DataDog allows configuring [Dual Shipping](https://docs.datadoghq.com/agent/guide/dual-shipping/) for metrics DataDog allows configuring [Dual Shipping](https://docs.datadoghq.com/agent/guide/dual-shipping/) for metrics
sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `additional_endpoints`. sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `additional_endpoints`.
<img src="Single-server-VictoriaMetrics-sending_DD_metrics_to_VM_and_DD.webp" > <img src="Single-server-VictoriaMetrics-sending_DD_metrics_to_VM_and_DD.webp">
Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver: Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver:
```text ```
DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\": [\"apikey\"]}' DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\": [\"apikey\"]}'
``` ```
@ -565,7 +565,7 @@ To configure DataDog Dual Shipping via [configuration file](https://docs.datadog
add the following line: add the following line:
```yaml ```
additional_endpoints: additional_endpoints:
"http://victoriametrics:8428/datadog": "http://victoriametrics:8428/datadog":
- apikey - apikey
@ -805,7 +805,6 @@ curl -H 'Content-Type: application/json' -d '{"metric":"x.y.z","value":45.34,"ta
Example for writing multiple data points in a single request: Example for writing multiple data points in a single request:
```console ```console
curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put
``` ```

View file

@ -207,7 +207,7 @@ Snap package for VictoriaMetrics is available [here](https://snapcraft.io/victor
Command-line flags for Snap package can be set with following command: Command-line flags for Snap package can be set with following command:
```text ```sh
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics snap restart victoriametrics
``` ```
@ -216,7 +216,7 @@ Do not change value for `-storageDataPath` flag, because snap package has limite
Changing scrape configuration is possible with text editor: Changing scrape configuration is possible with text editor:
```text ```sh
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
``` ```
@ -533,7 +533,7 @@ or via [configuration file](https://docs.datadoghq.com/agent/guide/agent-configu
To configure DataDog agent via ENV variable add the following prefix: To configure DataDog agent via ENV variable add the following prefix:
```text ```sh
DD_DD_URL=http://victoriametrics:8428/datadog DD_DD_URL=http://victoriametrics:8428/datadog
``` ```
@ -543,7 +543,7 @@ _Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/
To configure DataDog agent via [configuration file](https://github.com/DataDog/datadog-agent/blob/878600ef7a55c5ef0efb41ed0915f020cf7e3bd0/pkg/config/config_template.yaml#L33) To configure DataDog agent via [configuration file](https://github.com/DataDog/datadog-agent/blob/878600ef7a55c5ef0efb41ed0915f020cf7e3bd0/pkg/config/config_template.yaml#L33)
add the following line: add the following line:
```text ```yaml
dd_url: http://victoriametrics:8428/datadog dd_url: http://victoriametrics:8428/datadog
``` ```
@ -560,7 +560,7 @@ sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `ad
Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver: Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver:
```text ```
DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\": [\"apikey\"]}' DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\": [\"apikey\"]}'
``` ```
@ -573,7 +573,7 @@ To configure DataDog Dual Shipping via [configuration file](https://docs.datadog
add the following line: add the following line:
```yaml ```
additional_endpoints: additional_endpoints:
"http://victoriametrics:8428/datadog": "http://victoriametrics:8428/datadog":
- apikey - apikey
@ -813,7 +813,6 @@ curl -H 'Content-Type: application/json' -d '{"metric":"x.y.z","value":45.34,"ta
Example for writing multiple data points in a single request: Example for writing multiple data points in a single request:
```console ```console
curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put
``` ```

View file

@ -26,7 +26,7 @@ aliases:
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/) - [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/)
- [Node exporter](https://github.com/prometheus/node_exporter#node-exporter)(v1.7.0) and [Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/)(v0.25.0) - [Node exporter](https://github.com/prometheus/node_exporter#node-exporter)(v1.7.0) and [Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/)(v0.25.0)
<img alt="vmanomaly typical setup diagramm" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert_overview.webp"> <img alt="vmanomaly typical setup diagramm" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert_overview.webp">
> **Note: Configurations used throughout this guide can be found [here](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/vmanomaly/vmanomaly-integration/)** > **Note: Configurations used throughout this guide can be found [here](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker/vmanomaly/vmanomaly-integration/)**
@ -103,7 +103,7 @@ These modes are mutually exclusive. A high _iowait_ means that you are disk or n
The metric `node_cpu_seconds_total` is a [counter](https://docs.victoriametrics.com/keyConcepts.html#counter) type of metric. If we'd like to see how much time CPU spent in each of the nodes, we need to calculate the per-second values change via [rate function](https://docs.victoriametrics.com/MetricsQL.html#rate): `rate(node_cpu_seconds_total)`. To aggregate data by mode we'll use median or 50% quantile function. Resulting query will look likt this: `quantile by (mode) (0.5, rate(node_cpu_seconds_total[5m])` The metric `node_cpu_seconds_total` is a [counter](https://docs.victoriametrics.com/keyConcepts.html#counter) type of metric. If we'd like to see how much time CPU spent in each of the nodes, we need to calculate the per-second values change via [rate function](https://docs.victoriametrics.com/MetricsQL.html#rate): `rate(node_cpu_seconds_total)`. To aggregate data by mode we'll use median or 50% quantile function. Resulting query will look likt this: `quantile by (mode) (0.5, rate(node_cpu_seconds_total[5m])`
Here is how this query may look like in Grafana: Here is how this query may look like in Grafana:
<img alt="node_cpu_rate_graph" src="guide-vmanomaly-vmalert-query.webp"> <img alt="node_cpu_rate_graph" src="guide-vmanomaly-vmalert-query.webp">
This query result will generate 8 time series per each cpu, and we will use them as an input for our VM Anomaly Detection. vmanomaly will start learning configured model type separately for each of the time series. This query result will generate 8 time series per each cpu, and we will use them as an input for our VM Anomaly Detection. vmanomaly will start learning configured model type separately for each of the time series.
@ -476,7 +476,7 @@ Each of these metrics will contain same labels our query `quantile by (mode) (0.
### Anomaly scores for each metric with its according labels. ### Anomaly scores for each metric with its according labels.
Query: `anomaly_score` Query: `anomaly_score`
<img alt="Anomaly score graph" src="guide-vmanomaly-vmalert-anomaly-score.webp"> <img alt="Anomaly score graph" src="guide-vmanomaly-vmalert-anomaly-score.webp">
<br>Check out if the anomaly score is high for datapoints you think are anomalies. If not, you can try other parameters in the config file or try other model type. <br>Check out if the anomaly score is high for datapoints you think are anomalies. If not, you can try other parameters in the config file or try other model type.
@ -487,7 +487,7 @@ As you may notice a lot of data shows anomaly score greater than 1. It is expect
Queries: `yhat_lower`, `yhat_upper` and `yhat` Queries: `yhat_lower`, `yhat_upper` and `yhat`
<img alt="yhat lower and yhat upper" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert-boundaries.webp"> <img alt="yhat lower and yhat upper" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert-boundaries.webp">
Boundaries of 'normal' metric values according to model inference. Boundaries of 'normal' metric values according to model inference.
@ -495,10 +495,10 @@ Boundaries of 'normal' metric values according to model inference.
On the page `http://localhost:8880/vmalert/groups` you can find our configured Alerting rule: On the page `http://localhost:8880/vmalert/groups` you can find our configured Alerting rule:
<img alt="alert rule" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert_alert-rule.webp"> <img alt="alert rule" src="guide-vmanomaly-vmalert/guide-vmanomaly-vmalert_alert-rule.webp">
According to the rule configured for vmalert we will see Alert when anomaly score exceed 1. You will see an alert on Alert tab. `http://localhost:8880/vmalert/alerts`: According to the rule configured for vmalert we will see Alert when anomaly score exceed 1. You will see an alert on Alert tab. `http://localhost:8880/vmalert/alerts`:
<img alt="alerts firing" src="guide-vmanomaly-vmalert_alerts-firing.webp"> <img alt="alerts firing" src="guide-vmanomaly-vmalert_alerts-firing.webp">
## 10. Conclusion ## 10. Conclusion

View file

@ -820,7 +820,7 @@ Each `vmagent` instance in the cluster must use identical `-promscrape.config` f
in the range `0 ... N-1`, where `N` is the number of `vmagent` instances in the cluster specified via `-promscrape.cluster.membersCount`. in the range `0 ... N-1`, where `N` is the number of `vmagent` instances in the cluster specified via `-promscrape.cluster.membersCount`.
For example, the following commands spread scrape targets among a cluster of two `vmagent` instances: For example, the following commands spread scrape targets among a cluster of two `vmagent` instances:
```text ```sh
/path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=0 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=0 -promscrape.config=/path/to/config.yml ...
/path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=1 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=1 -promscrape.config=/path/to/config.yml ...
``` ```
@ -832,7 +832,7 @@ By default, each scrape target is scraped only by a single `vmagent` instance in
then `-promscrape.cluster.replicationFactor` command-line flag must be set to the desired number of replicas. For example, the following commands then `-promscrape.cluster.replicationFactor` command-line flag must be set to the desired number of replicas. For example, the following commands
start a cluster of three `vmagent` instances, where each target is scraped by two `vmagent` instances: start a cluster of three `vmagent` instances, where each target is scraped by two `vmagent` instances:
```text ```sh
/path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=0 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=0 -promscrape.config=/path/to/config.yml ...
/path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=1 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=1 -promscrape.config=/path/to/config.yml ...
/path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=2 -promscrape.config=/path/to/config.yml ... /path/to/vmagent -promscrape.cluster.membersCount=3 -promscrape.cluster.replicationFactor=2 -promscrape.cluster.memberNum=2 -promscrape.config=/path/to/config.yml ...
@ -859,7 +859,7 @@ The `-promscrape.cluster.memberLabel` command-line flag allows specifying a name
The value of the `member num` label is set to `-promscrape.cluster.memberNum`. For example, the following config instructs adding `vmagent_instance="0"` label The value of the `member num` label is set to `-promscrape.cluster.memberNum`. For example, the following config instructs adding `vmagent_instance="0"` label
to all the metrics scraped by the given `vmagent` instance: to all the metrics scraped by the given `vmagent` instance:
```text ```sh
/path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=0 -promscrape.cluster.memberLabel=vmagent_instance /path/to/vmagent -promscrape.cluster.membersCount=2 -promscrape.cluster.memberNum=0 -promscrape.cluster.memberLabel=vmagent_instance
``` ```
@ -1248,7 +1248,7 @@ These command-line flags are available only in [enterprise](https://docs.victori
which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page
(see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix. (see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix.
```text ```console
-gcp.pubsub.subscribe.credentialsFile string -gcp.pubsub.subscribe.credentialsFile string
Path to file with GCP credentials to use for PubSub client. If not set, default credentials are used (see Workload Identity for K8S or https://cloud.google.com/docs/authentication/application-default-credentials ). See https://docs.victoriametrics.com/vmagent.html#reading-metrics-from-pubsub . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html Path to file with GCP credentials to use for PubSub client. If not set, default credentials are used (see Workload Identity for K8S or https://cloud.google.com/docs/authentication/application-default-credentials ). See https://docs.victoriametrics.com/vmagent.html#reading-metrics-from-pubsub . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html
-gcp.pubsub.subscribe.defaultMessageFormat string -gcp.pubsub.subscribe.defaultMessageFormat string
@ -1282,7 +1282,7 @@ These command-line flags are available only in [enterprise](https://docs.victori
which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page
(see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix. (see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix.
```text ```console
-gcp.pubsub.publish.byteThreshold int -gcp.pubsub.publish.byteThreshold int
Publish a batch when its size in bytes reaches this value. See https://docs.victoriametrics.com/vmagent.html#writing-metrics-to-pubsub . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html (default 1000000) Publish a batch when its size in bytes reaches this value. See https://docs.victoriametrics.com/vmagent.html#writing-metrics-to-pubsub . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html (default 1000000)
-gcp.pubsub.publish.countThreshold int -gcp.pubsub.publish.countThreshold int
@ -1366,7 +1366,7 @@ These command-line flags are available only in [enterprise](https://docs.victori
which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page which can be downloaded for evaluation from [releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) page
(see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix. (see `vmutils-...-enterprise.tar.gz` archives) and from [docker images](https://hub.docker.com/r/victoriametrics/vmagent/tags) with tags containing `enterprise` suffix.
```text ```console
-kafka.consumer.topic array -kafka.consumer.topic array
Kafka topic names for data consumption. See https://docs.victoriametrics.com/vmagent.html#reading-metrics-from-kafka . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html Kafka topic names for data consumption. See https://docs.victoriametrics.com/vmagent.html#reading-metrics-from-kafka . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html
Supports an array of values separated by comma or specified via multiple flags. Supports an array of values separated by comma or specified via multiple flags.
@ -1506,7 +1506,7 @@ It is safe sharing the collected profiles from security point of view, since the
`vmagent` can be fine-tuned with various command-line flags. Run `./vmagent -help` in order to see the full list of these flags with their descriptions and default values: `vmagent` can be fine-tuned with various command-line flags. Run `./vmagent -help` in order to see the full list of these flags with their descriptions and default values:
```text ```console
./vmagent -help ./vmagent -help
vmagent collects metrics data via popular data ingestion protocols and routes them to VictoriaMetrics. vmagent collects metrics data via popular data ingestion protocols and routes them to VictoriaMetrics.