diff --git a/proxy/src/http/prom.rs b/proxy/src/http/prom.rs index 64a958c19a..a27e0010c9 100644 --- a/proxy/src/http/prom.rs +++ b/proxy/src/http/prom.rs @@ -407,7 +407,8 @@ fn convert_write_request(req: WriteRequest) -> Result> { .unzip(); req_by_metric - .entry(metric.to_string()) + // fields with same tag names will be grouped together + .entry((metric.clone(), tag_names.clone())) .or_insert_with(|| WriteTableRequest { table: metric, tag_names, diff --git a/proxy/src/influxdb/types.rs b/proxy/src/influxdb/types.rs index c55213e8a7..2280e4a11d 100644 --- a/proxy/src/influxdb/types.rs +++ b/proxy/src/influxdb/types.rs @@ -491,12 +491,16 @@ pub(crate) fn convert_write_request(req: WriteRequest) -> Result>(); let req_for_one_measurement = req_by_measurement - .entry(line.series.measurement.to_string()) + // fields with same tag names will be grouped together + .entry((line.series.measurement.to_string(), tag_names.clone())) .or_insert_with(|| WriteTableRequest { table: line.series.measurement.to_string(), - tag_names: tag_set.iter().map(|(tagk, _)| tagk.to_string()).collect(), + tag_names, field_names: line .field_set .iter()