From c20d68e28d743c0965c78bf36084ea3f5bb6d897 Mon Sep 17 00:00:00 2001 From: hagen1778 Date: Sat, 27 Jan 2024 19:11:38 +0100 Subject: [PATCH] docs: follow-up after 491287ed1552798161c6e197fbf391770602d2b9 https://github.com/VictoriaMetrics/VictoriaMetrics/commit/491287ed1552798161c6e197fbf391770602d2b9 Signed-off-by: hagen1778 --- README.md | 4 ++-- docs/README.md | 15 +++++++-------- docs/Single-server-VictoriaMetrics.md | 13 ++++++------- .../guides/guide-vmanomaly-vmalert.md | 12 ++++++------ docs/vmagent.md | 14 +++++++------- 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 1b1d29ae6..ad60ba68c 100644 --- a/README.md +++ b/README.md @@ -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: -```text +```sh echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags 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: -```text +```sh vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml ``` diff --git a/docs/README.md b/docs/README.md index 4eb5900ec..efe0f2c9b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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: -```text +```sh echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags 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: -```text +```sh 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: -```text +```sh 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) add the following line: -```text +```yaml 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 sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `additional_endpoints`. - + Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver: -```text +``` 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: -```yaml +``` additional_endpoints: "http://victoriametrics:8428/datadog": - 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: - ```console curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put ``` diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index 763ec9c40..42d9b8a60 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -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: -```text +```sh echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags 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: -```text +```sh 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: -```text +```sh 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) add the following line: -```text +```yaml 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: -```text +``` 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: -```yaml +``` additional_endpoints: "http://victoriametrics:8428/datadog": - 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: - ```console curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put ``` diff --git a/docs/anomaly-detection/guides/guide-vmanomaly-vmalert.md b/docs/anomaly-detection/guides/guide-vmanomaly-vmalert.md index bebcbc162..cb577d67b 100644 --- a/docs/anomaly-detection/guides/guide-vmanomaly-vmalert.md +++ b/docs/anomaly-detection/guides/guide-vmanomaly-vmalert.md @@ -26,7 +26,7 @@ aliases: - [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) -vmanomaly typical setup diagramm +vmanomaly typical setup diagramm > **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])` Here is how this query may look like in Grafana: -node_cpu_rate_graph +node_cpu_rate_graph 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. Query: `anomaly_score` -Anomaly score graph +Anomaly score graph
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` -yhat lower and yhat upper +yhat lower and yhat upper 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: -alert rule +alert rule 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`: -alerts firing +alerts firing ## 10. Conclusion diff --git a/docs/vmagent.md b/docs/vmagent.md index 5f7325fd6..d8ba98f98 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -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`. 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=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 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=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 ... @@ -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 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 ``` @@ -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 (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 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 @@ -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 (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 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 @@ -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 (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 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. @@ -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: -```text +```console ./vmagent -help vmagent collects metrics data via popular data ingestion protocols and routes them to VictoriaMetrics.