From 54fe207cc02fed13c84e9a95855cd150559f5bc1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 8 Mar 2023 01:26:53 -0800 Subject: [PATCH] all: follow-up for 7a3e16e77476a8b678be455728c0e47611359261 - Sync the description for -httpListenAddr.useProxyProtocol command-line flag at vmagent and vmauth, so it is consistent with the description at vmauth and victoria-metrics - Add a sample of panic text to docs/CHANGELOG.md, so it could be googled - Mention the -httpListenAddr.useProxyProtocol command-line flag in the description for the bugfix Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335 --- app/vmagent/main.go | 3 ++- app/vmalert/main.go | 3 ++- app/vmauth/main.go | 4 ++-- app/vminsert/main.go | 3 ++- app/vmselect/main.go | 3 ++- app/vmstorage/main.go | 3 ++- docs/CHANGELOG.md | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index ce6e6ebcf5..9c4a6adda1 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -46,7 +46,8 @@ var ( "Set this flag to empty value in order to disable listening on any port. This mode may be useful for running multiple vmagent instances on the same server. "+ "Note that /targets and /metrics pages aren't available if -httpListenAddr=''. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") influxListenAddr = flag.String("influxListenAddr", "", "TCP and UDP address to listen for InfluxDB line protocol data. Usually :8089 must be set. Doesn't work if empty. "+ "This flag isn't needed when ingesting data over HTTP - just send it to http://:8429/write . "+ "See also -influxListenAddr.useProxyProtocol") diff --git a/app/vmalert/main.go b/app/vmalert/main.go index 33f3e74e37..8f382a23f5 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -57,7 +57,8 @@ absolute path to all .tpl files in root.`) httpListenAddr = flag.String("httpListenAddr", ":8880", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") evaluationInterval = flag.Duration("evaluationInterval", time.Minute, "How often to evaluate the rules") validateTemplates = flag.Bool("rule.validateTemplates", true, "Whether to validate annotation and label templates") diff --git a/app/vmauth/main.go b/app/vmauth/main.go index 5591080764..4b400c0631 100644 --- a/app/vmauth/main.go +++ b/app/vmauth/main.go @@ -28,8 +28,8 @@ import ( var ( httpListenAddr = flag.String("httpListenAddr", ":8427", "TCP address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt."+ - "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing.") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host. "+ "See also -maxConcurrentRequests") responseTimeout = flag.Duration("responseTimeout", 5*time.Minute, "The timeout for receiving a response from backend") diff --git a/app/vminsert/main.go b/app/vminsert/main.go index 170e720888..406d434a55 100644 --- a/app/vminsert/main.go +++ b/app/vminsert/main.go @@ -68,7 +68,8 @@ var ( "at -opentsdbHTTPListenAddr . See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") httpListenAddr = flag.String("httpListenAddr", ":8480", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") maxLabelsPerTimeseries = flag.Int("maxLabelsPerTimeseries", 30, "The maximum number of labels accepted per time series. Superfluous labels are dropped. In this case the vm_metrics_with_dropped_labels_total metric at /metrics page is incremented") maxLabelValueLen = flag.Int("maxLabelValueLen", 16*1024, "The maximum length of label values in the accepted time series. Longer label values are truncated. In this case the vm_too_long_label_values_total metric at /metrics page is incremented") storageNodes = flagutil.NewArrayString("storageNode", "Comma-separated addresses of vmstorage nodes; usage: -storageNode=vmstorage-host1,...,vmstorage-hostN . "+ diff --git a/app/vmselect/main.go b/app/vmselect/main.go index da58b92102..81ff4b33d5 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -40,7 +40,8 @@ import ( var ( httpListenAddr = flag.String("httpListenAddr", ":8481", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") cacheDataPath = flag.String("cacheDataPath", "", "Path to directory for cache files. Cache isn't saved if empty") maxConcurrentRequests = flag.Int("search.maxConcurrentRequests", getDefaultMaxConcurrentRequests(), "The maximum number of concurrent search requests. "+ "It shouldn't be high, since a single request can saturate all the CPU cores, while many concurrently executed requests may require high amounts of memory. "+ diff --git a/app/vmstorage/main.go b/app/vmstorage/main.go index ab7423e252..b4670cea56 100644 --- a/app/vmstorage/main.go +++ b/app/vmstorage/main.go @@ -29,7 +29,8 @@ var ( retentionPeriod = flagutil.NewDuration("retentionPeriod", "1", "Data with timestamps outside the retentionPeriod is automatically deleted. See also -retentionFilter") httpListenAddr = flag.String("httpListenAddr", ":8482", "Address to listen for http connections. See also -httpListenAddr.useProxyProtocol") useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+ - "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt") + "See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+ + "With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing") storageDataPath = flag.String("storageDataPath", "vmstorage-data", "Path to storage data") vminsertAddr = flag.String("vminsertAddr", ":8400", "TCP address to accept connections from vminsert services") vmselectAddr = flag.String("vmselectAddr", ":8401", "TCP address to accept connections from vmselect services") diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index acbb94d7b5..f11ec8b9b7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -24,7 +24,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): stop showing `Please enter a valid Query and execute it` error message on the first load of vmui. * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): properly process `Run in VMUI` button click in [VictoriaMetrics datasource plugin for Grafana](https://github.com/VictoriaMetrics/grafana-datasource). * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix the display of the selected value for dropdowns on `Explore` page. -* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html) fixes possible panic with enabled proxy-protocol. It was introduced at [v1.87.0](https://docs.victoriametrics.com/CHANGELOG.html#v1870) when implementing [this feature](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). +* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): fix `cannot serve http` panic when plain HTTP request is sent to `vmauth` configured to accept requests over [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt)-encoded request (e.g. when `vmauth` runs with `-httpListenAddr.useProxyProtocol` command-line flag). The issue has been introduced at [v1.87.0](https://docs.victoriametrics.com/CHANGELOG.html#v1870) when implementing [this feature](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). ## [v1.88.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.88.1)