(t *testing.T, protobuf []byte, isV2 bool)
| 1151 | } |
| 1152 | |
| 1153 | func createRequest(t *testing.T, protobuf []byte, isV2 bool) *http.Request { |
| 1154 | t.Helper() |
| 1155 | inoutBytes := snappy.Encode(nil, protobuf) |
| 1156 | req, err := http.NewRequest("POST", "http://localhost/", bytes.NewReader(inoutBytes)) |
| 1157 | require.NoError(t, err) |
| 1158 | |
| 1159 | req.Header.Add("Content-Encoding", "snappy") |
| 1160 | |
| 1161 | if isV2 { |
| 1162 | req.Header.Set("Content-Type", appProtoV2ContentType) |
| 1163 | req.Header.Set("X-Prometheus-Remote-Write-Version", remoteWriteVersion20HeaderValue) |
| 1164 | return req |
| 1165 | } |
| 1166 | |
| 1167 | req.Header.Set("Content-Type", appProtoContentType) |
| 1168 | req.Header.Set("X-Prometheus-Remote-Write-Version", remoteWriteVersion1HeaderValue) |
| 1169 | return req |
| 1170 | } |
| 1171 | |
| 1172 | func createCortexRemoteWriteV2Protobuf(t *testing.T, skipLabelNameValidation bool, source cortexpb.SourceEnum) []byte { |
| 1173 | t.Helper() |
no test coverage detected