VictoriaMetrics/app
ccliu d134a310f3
vmagent: resolve the issue where usePromCompatibleNaming is not working (#6776)
Describe Your Changes
When I use usePromCompatibleNaming with vmagent to process data that
needs to be formatted from different sources such as InfluxDB, I find
that it doesn’t work

However, it works in vminsert. I found that vminsert uses the
HasRelabeling method to determine whether to relabel.
```go
func HasRelabeling() bool {
	pcs := pcsGlobal.Load()
	return pcs.Len() > 0 || *usePromCompatibleNaming
}
```
in vmagent, the decision to relabel is determined only by
pcsGlobal.Len() > 0. However, in the applyRelabeling method, the
usePromCompatibleNaming logic is also used to determine whether to
relabel in the error handling.
```go
func (rctx *relabelCtx) applyRelabeling(tss []prompbmarshal.TimeSeries, pcs *promrelabel.ParsedConfigs) []prompbmarshal.TimeSeries {
	if pcs.Len() == 0 && !*usePromCompatibleNaming {
		// Nothing to change.
		return tss
	}
```
So I think that the logic for determining whether to relabel in vmagent
is not as expected.

Checklist
The following checks are mandatory:

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

---------

Co-authored-by: Roman Khavronenko <hagen1778@gmail.com>
2024-08-13 10:32:05 -04:00
..
victoria-logs app/victoria-logs/Makefile: add make victoria-logs-linux-loong64 build rule 2024-07-12 23:12:48 +02:00
victoria-metrics app: consistently use t.Fatal* instead of t.Error* (except of app/vmalert and app/vmctl - these packages will be processed in a separate commit) 2024-07-11 15:59:08 +02:00
vlinsert app/vlinsert/elasticsearch: add fake response for logstash requests (#6742) 2024-08-06 15:43:33 +02:00
vlogsgenerator all: consistently use stringsutil.JSONString() for formatting JSON strings with fmt.* functions instead of using "%q" formatter 2024-07-17 13:52:13 +02:00
vlselect app/{vmselect,vlselect}: run make vmui-update vmui-logs-update after efd70b2c52 2024-07-27 13:50:31 +02:00
vlstorage vendor: update github.com/VictoriaMetrics/metrics from v1.34.1 to v1.35.0 2024-07-15 10:43:37 +02:00
vmagent vmagent: resolve the issue where usePromCompatibleNaming is not working (#6776) 2024-08-13 10:32:05 -04:00
vmalert app/vmalert: rm unnecessary err check 2024-08-07 09:09:24 +02:00
vmalert-tool app/vmalert-tool/Makefile: add make vmalert-tool-linux-loong64 build rule 2024-07-12 23:19:04 +02:00
vmauth app/vmauth: verify how backend response headers are propagated to vmauth client 2024-07-27 13:44:49 +02:00
vmbackup app: consistently use t.Fatal* instead of t.Error* (except of app/vmalert and app/vmctl - these packages will be processed in a separate commit) 2024-07-11 15:59:08 +02:00
vmbackupmanager all: replace old https://docs.victoriametrics.com/vmbackupmanager.html url with the new one - https://docs.victoriametrics.com/vmbackupmanager/ 2024-04-18 02:03:58 +02:00
vmctl vmctl: add --backoff-retries, --backoff-factor, --backoff-min-duration global command-line flags (#6639) 2024-08-03 19:12:48 +02:00
vmgateway all: replace old https://docs.victoriametrics.com/vmgateway.html url with the new one - https://docs.victoriametrics.com/vmgateway/ 2024-04-18 02:08:18 +02:00
vminsert app/{vminsert,vmagent}: add healthcheck for influx ingestion endpoints (#6749) 2024-08-05 09:34:54 +02:00
vmrestore deployment: build image for vmagent streamaggr benchmark (#6515) 2024-06-24 16:28:50 +02:00
vmselect fix typos in comments 2024-08-06 14:54:49 +02:00
vmstorage all: consistently use stringsutil.JSONString() for formatting JSON strings with fmt.* functions instead of using "%q" formatter 2024-07-17 13:52:13 +02:00
vmui vlogs: add select/deselect all button to table settings in UI (#6680) 2024-08-13 10:20:07 -04:00