VictoriaMetrics/app/vmagent/remotewrite
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
..
client.go lib/{httputils,netutil}: move httputils.GetStatDialFunc to netutil.NewStatDialFunc 2024-07-15 23:02:34 +02:00
pendingseries.go Revert "Exemplar support (#5982)" 2024-07-03 15:30:21 +02:00
pendingseries_test.go Revert "Exemplar support (#5982)" 2024-07-03 15:30:21 +02:00
pendingseries_timing_test.go lib/prompbmarshal: switch to github.com/VictoriaMetrics/easyproto 2024-01-14 23:04:45 +02:00
relabel.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +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:24:00 +02:00
remotewrite.go vmagent: resolve the issue where usePromCompatibleNaming is not working (#6776) 2024-08-13 10:32:05 -04:00
remotewrite_test.go app/vmagent/remotewrite: follow-up for f153f54d11 2024-07-15 20:24:01 +02:00
streamaggr.go stream aggregation: do not allow to enable -stream.keepInput and `k… (#6723) 2024-08-13 08:54:35 -04:00