From 6faf1bcb04aec0f45ef1db3304cc73c076ad2395 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Thu, 18 Dec 2025 11:22:35 +0800 Subject: [PATCH 1/2] chore: update proto to include native histogram --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/common/telemetry/src/metric.rs | 9 +++++++++ src/servers/src/prom_store.rs | 6 +++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 783c044ba6..b90cc5286c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5459,7 +5459,7 @@ dependencies = [ [[package]] name = "greptime-proto" version = "0.1.0" -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=0423fa30203187c75e2937a668df1da699c8b96c#0423fa30203187c75e2937a668df1da699c8b96c" +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=5b7d43d7bfd9bc491501b9491570f120d01a7588#5b7d43d7bfd9bc491501b9491570f120d01a7588" dependencies = [ "prost 0.13.5", "prost-types 0.13.5", diff --git a/Cargo.toml b/Cargo.toml index 4eaf5c4586..6e565f8a67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,7 +150,7 @@ etcd-client = { git = "https://github.com/GreptimeTeam/etcd-client", rev = "f62d fst = "0.4.7" futures = "0.3" futures-util = "0.3" -greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "0423fa30203187c75e2937a668df1da699c8b96c" } +greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "5b7d43d7bfd9bc491501b9491570f120d01a7588" } hex = "0.4" http = "1" humantime = "2.1" diff --git a/src/common/telemetry/src/metric.rs b/src/common/telemetry/src/metric.rs index b9262290a8..84af76a020 100644 --- a/src/common/telemetry/src/metric.rs +++ b/src/common/telemetry/src/metric.rs @@ -71,6 +71,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }), MetricType::GAUGE => timeseries.push(TimeSeries { labels: convert_label(m.get_label(), mf_name, None), @@ -79,6 +80,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }), MetricType::HISTOGRAM => { let h = m.get_histogram(); @@ -97,6 +99,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); if upper_bound.is_sign_positive() && upper_bound.is_infinite() { inf_seen = true; @@ -114,6 +117,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); } timeseries.push(TimeSeries { @@ -127,6 +131,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); timeseries.push(TimeSeries { labels: convert_label( @@ -139,6 +144,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); } MetricType::SUMMARY => { @@ -155,6 +161,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); } timeseries.push(TimeSeries { @@ -168,6 +175,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); timeseries.push(TimeSeries { labels: convert_label( @@ -180,6 +188,7 @@ pub fn convert_metric_to_write_request( timestamp, }], exemplars: vec![], + histograms: vec![], }); } MetricType::UNTYPED => { diff --git a/src/servers/src/prom_store.rs b/src/servers/src/prom_store.rs index 92c1815145..9ed2d00268 100644 --- a/src/servers/src/prom_store.rs +++ b/src/servers/src/prom_store.rs @@ -26,7 +26,7 @@ use arrow::datatypes::{Float64Type, TimestampMillisecondType}; use common_grpc::precision::Precision; use common_query::prelude::{greptime_timestamp, greptime_value}; use common_recordbatch::{RecordBatch, RecordBatches}; -use common_telemetry::tracing; +use common_telemetry::{tracing, warn}; use datafusion::dataframe::DataFrame; use datafusion::prelude::{Expr, col, lit, regexp_match}; use datafusion_common::ScalarValue; @@ -415,6 +415,10 @@ pub fn to_grpc_row_insert_requests(request: &WriteRequest) -> Result<(RowInsertR table_data.add_row(one_row); } } + + if !series.histograms.is_empty() { + warn!("Native histograms are not supported yet, data ignored"); + } } Ok(multi_table_data.into_row_insert_requests()) From 223a978b17eee781de7e56adac19d1531dbd6a40 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Thu, 18 Dec 2025 14:46:00 +0800 Subject: [PATCH 2/2] chore: update proto --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b90cc5286c..b910b7c475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5459,7 +5459,7 @@ dependencies = [ [[package]] name = "greptime-proto" version = "0.1.0" -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=5b7d43d7bfd9bc491501b9491570f120d01a7588#5b7d43d7bfd9bc491501b9491570f120d01a7588" +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=173efe5ec62722089db7c531c0b0d470a072b915#173efe5ec62722089db7c531c0b0d470a072b915" dependencies = [ "prost 0.13.5", "prost-types 0.13.5", diff --git a/Cargo.toml b/Cargo.toml index 6e565f8a67..3b76727f0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,7 +150,7 @@ etcd-client = { git = "https://github.com/GreptimeTeam/etcd-client", rev = "f62d fst = "0.4.7" futures = "0.3" futures-util = "0.3" -greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "5b7d43d7bfd9bc491501b9491570f120d01a7588" } +greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "173efe5ec62722089db7c531c0b0d470a072b915" } hex = "0.4" http = "1" humantime = "2.1"