VictoriaMetrics/app/vmagent/remotewrite
ccliu 8729052623
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>
(cherry picked from commit d134a310f3)
2024-08-13 10:33:55 -04:00
..
client.go lib/{httputils,netutil}: move httputils.GetStatDialFunc to netutil.NewStatDialFunc 2024-07-15 23:05:46 +02:00
pendingseries_test.go Revert "Exemplar support (#5982)" 2024-07-03 16:09:18 +02:00
pendingseries_timing_test.go lib/prompbmarshal: switch to github.com/VictoriaMetrics/easyproto 2024-01-16 20:48:30 +02:00
pendingseries.go Revert "Exemplar support (#5982)" 2024-07-03 16:09:18 +02:00
relabel_test.go app/vmagent/remotewrite: fix data race when extra labels are added to samples before sending them to multiple remote storage systems 2023-09-08 23:26:40 +02:00
relabel.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:23:26 +02:00
remotewrite_test.go app/vmagent/remotewrite: follow-up for f153f54d11 2024-07-15 20:25:36 +02:00
remotewrite.go vmagent: resolve the issue where usePromCompatibleNaming is not working (#6776) 2024-08-13 10:33:55 -04:00
streamaggr.go stream aggregation: do not allow to enable -stream.keepInput and `k… (#6723) 2024-08-13 09:08:27 -04:00