Skip to content

Commit 7043e09

Browse files
committed
refactor: remove export_metrics feature and related configuration/docs
1 parent 16febbd commit 7043e09

File tree

21 files changed

+8
-170
lines changed

21 files changed

+8
-170
lines changed

config/datanode.example.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -672,20 +672,7 @@ otlp_export_protocol = "http"
672672
[logging.tracing_sample_ratio]
673673
default_ratio = 1.0
674674

675-
## The datanode can export its metrics and send to Prometheus compatible service (e.g. `greptimedb` itself) from remote-write API.
676-
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
677-
[export_metrics]
678-
## whether enable export metrics.
679-
enable = false
680-
## The interval of export metrics.
681-
write_interval = "30s"
682-
683-
[export_metrics.remote_write]
684-
## The prometheus remote write endpoint that the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`.
685-
url = ""
686-
687-
## HTTP headers of Prometheus remote-write carry.
688-
headers = { }
675+
## Exporting internal metrics via remote-write has been removed. Please use external Prometheus/OTel/VMA to scrape metrics.
689676

690677
## The tracing options. Only effect when compiled with `tokio-console` feature.
691678
#+ [tracing]

config/frontend.example.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,7 @@ sample_ratio = 1.0
305305
## The TTL of the `slow_queries` system table. Default is `90d` when `record_type` is `system_table`.
306306
ttl = "90d"
307307

308-
## The frontend can export its metrics and send to Prometheus compatible service (e.g. `greptimedb` itself) from remote-write API.
309-
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
310-
[export_metrics]
311-
## whether enable export metrics.
312-
enable = false
313-
## The interval of export metrics.
314-
write_interval = "30s"
315-
316-
[export_metrics.remote_write]
317-
## The prometheus remote write endpoint that the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`.
318-
url = ""
319-
320-
## HTTP headers of Prometheus remote-write carry.
321-
headers = { }
308+
## Exporting internal metrics via remote-write has been removed. Please use external Prometheus/OTel/VMA to scrape metrics.
322309

323310
## The tracing options. Only effect when compiled with `tokio-console` feature.
324311
#+ [tracing]

config/metasrv.example.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -325,20 +325,7 @@ otlp_export_protocol = "http"
325325
[logging.tracing_sample_ratio]
326326
default_ratio = 1.0
327327

328-
## The metasrv can export its metrics and send to Prometheus compatible service (e.g. `greptimedb` itself) from remote-write API.
329-
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
330-
[export_metrics]
331-
## whether enable export metrics.
332-
enable = false
333-
## The interval of export metrics.
334-
write_interval = "30s"
335-
336-
[export_metrics.remote_write]
337-
## The prometheus remote write endpoint that the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`.
338-
url = ""
339-
340-
## HTTP headers of Prometheus remote-write carry.
341-
headers = { }
328+
## Exporting internal metrics via remote-write has been removed. Please use external Prometheus/OTel/VMA to scrape metrics.
342329

343330
## The tracing options. Only effect when compiled with `tokio-console` feature.
344331
#+ [tracing]

config/standalone.example.toml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -768,26 +768,7 @@ default_ratio = 1.0
768768
## @toml2docs:none-default
769769
#+ sample_ratio = 1.0
770770

771-
## The standalone can export its metrics and send to Prometheus compatible service (e.g. `greptimedb`) from remote-write API.
772-
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
773-
[export_metrics]
774-
## whether enable export metrics.
775-
enable = false
776-
## The interval of export metrics.
777-
write_interval = "30s"
778-
779-
## For `standalone` mode, `self_import` is recommended to collect metrics generated by itself
780-
## You must create the database before enabling it.
781-
[export_metrics.self_import]
782-
## @toml2docs:none-default
783-
db = "greptime_metrics"
784-
785-
[export_metrics.remote_write]
786-
## The prometheus remote write endpoint that the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`.
787-
url = ""
788-
789-
## HTTP headers of Prometheus remote-write carry.
790-
headers = { }
771+
## Exporting internal metrics via remote-write has been removed. Please use external Prometheus/OTel/VMA to scrape metrics.
791772

792773
## The tracing options. Only effect when compiled with `tokio-console` feature.
793774
#+ [tracing]

src/catalog/src/system_schema/information_schema.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ mod procedure_info;
2222
pub mod process_list;
2323
pub mod region_peers;
2424
mod region_statistics;
25-
mod runtime_metrics;
2625
pub mod schemata;
2726
mod table_constraints;
2827
mod table_names;
@@ -61,7 +60,6 @@ use crate::system_schema::information_schema::information_memory_table::get_sche
6160
use crate::system_schema::information_schema::key_column_usage::InformationSchemaKeyColumnUsage;
6261
use crate::system_schema::information_schema::partitions::InformationSchemaPartitions;
6362
use crate::system_schema::information_schema::region_peers::InformationSchemaRegionPeers;
64-
use crate::system_schema::information_schema::runtime_metrics::InformationSchemaMetrics;
6563
use crate::system_schema::information_schema::schemata::InformationSchemaSchemata;
6664
use crate::system_schema::information_schema::table_constraints::InformationSchemaTableConstraints;
6765
use crate::system_schema::information_schema::tables::InformationSchemaTables;
@@ -211,7 +209,6 @@ impl SystemSchemaProviderInner for InformationSchemaProvider {
211209
self.catalog_name.clone(),
212210
self.catalog_manager.clone(),
213211
)) as _),
214-
RUNTIME_METRICS => Some(Arc::new(InformationSchemaMetrics::new())),
215212
PARTITIONS => Some(Arc::new(InformationSchemaPartitions::new(
216213
self.catalog_name.clone(),
217214
self.catalog_manager.clone(),
@@ -297,10 +294,6 @@ impl InformationSchemaProvider {
297294
// authentication details, and other critical information.
298295
// Only put these tables under `greptime` catalog to prevent info leak.
299296
if self.catalog_name == DEFAULT_CATALOG_NAME {
300-
tables.insert(
301-
RUNTIME_METRICS.to_string(),
302-
self.build_table(RUNTIME_METRICS).unwrap(),
303-
);
304297
tables.insert(
305298
BUILD_INFO.to_string(),
306299
self.build_table(BUILD_INFO).unwrap(),

src/catalog/src/system_schema/information_schema/table_names.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub const TABLE_PRIVILEGES: &str = "table_privileges";
3838
pub const TRIGGERS: &str = "triggers";
3939
pub const GLOBAL_STATUS: &str = "global_status";
4040
pub const SESSION_STATUS: &str = "session_status";
41-
pub const RUNTIME_METRICS: &str = "runtime_metrics";
4241
pub const PARTITIONS: &str = "partitions";
4342
pub const REGION_PEERS: &str = "region_peers";
4443
pub const TABLE_CONSTRAINTS: &str = "table_constraints";

src/cmd/src/frontend.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use frontend::instance::builder::FrontendBuilder;
4040
use frontend::server::Services;
4141
use meta_client::{MetaClientOptions, MetaClientType};
4242
use servers::addrs;
43-
use servers::export_metrics::ExportMetricsTask;
4443
use servers::grpc::GrpcOptions;
4544
use servers::tls::{TlsMode, TlsOption};
4645
use snafu::{OptionExt, ResultExt};
@@ -443,9 +442,6 @@ impl StartCommand {
443442
.context(error::StartFrontendSnafu)?;
444443
let instance = Arc::new(instance);
445444

446-
let export_metrics_task = ExportMetricsTask::try_new(&opts.export_metrics, Some(&plugins))
447-
.context(error::ServersSnafu)?;
448-
449445
let servers = Services::new(opts, instance.clone(), plugins)
450446
.build()
451447
.context(error::StartFrontendSnafu)?;
@@ -454,7 +450,6 @@ impl StartCommand {
454450
instance,
455451
servers,
456452
heartbeat_task,
457-
export_metrics_task,
458453
};
459454

460455
Ok(Instance::new(frontend, guard))

src/cmd/src/standalone.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ use meta_srv::metasrv::{FLOW_ID_SEQ, TABLE_ID_SEQ};
7575
use mito2::config::MitoConfig;
7676
use query::options::QueryOptions;
7777
use serde::{Deserialize, Serialize};
78-
use servers::export_metrics::{ExportMetricsOption, ExportMetricsTask};
7978
use servers::grpc::GrpcOptions;
8079
use servers::http::HttpOptions;
8180
use servers::tls::{TlsMode, TlsOption};
@@ -152,7 +151,6 @@ pub struct StandaloneOptions {
152151
pub user_provider: Option<String>,
153152
/// Options for different store engines.
154153
pub region_engine: Vec<RegionEngineConfig>,
155-
pub export_metrics: ExportMetricsOption,
156154
pub tracing: TracingOptions,
157155
pub init_regions_in_background: bool,
158156
pub init_regions_parallelism: usize,
@@ -181,7 +179,6 @@ impl Default for StandaloneOptions {
181179
procedure: ProcedureConfig::default(),
182180
flow: FlowConfig::default(),
183181
logging: LoggingOptions::default(),
184-
export_metrics: ExportMetricsOption::default(),
185182
user_provider: None,
186183
region_engine: vec![
187184
RegionEngineConfig::Mito(MitoConfig::default()),
@@ -230,8 +227,6 @@ impl StandaloneOptions {
230227
meta_client: None,
231228
logging: cloned_opts.logging,
232229
user_provider: cloned_opts.user_provider,
233-
// Handle the export metrics task run by standalone to frontend for execution
234-
export_metrics: cloned_opts.export_metrics,
235230
max_in_flight_write_bytes: cloned_opts.max_in_flight_write_bytes,
236231
slow_query: cloned_opts.slow_query,
237232
..Default::default()
@@ -694,9 +689,6 @@ impl StartCommand {
694689
.context(StartFlownodeSnafu)?;
695690
flow_streaming_engine.set_frontend_invoker(invoker).await;
696691

697-
let export_metrics_task = ExportMetricsTask::try_new(&opts.export_metrics, Some(&plugins))
698-
.context(error::ServersSnafu)?;
699-
700692
let servers = Services::new(opts, fe_instance.clone(), plugins.clone())
701693
.build()
702694
.context(error::StartFrontendSnafu)?;
@@ -705,7 +697,6 @@ impl StartCommand {
705697
instance: fe_instance,
706698
servers,
707699
heartbeat_task: None,
708-
export_metrics_task,
709700
};
710701

711702
#[cfg(feature = "enterprise")]

src/cmd/tests/load_config_test.rs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use meta_srv::selector::SelectorType;
3131
use metric_engine::config::EngineConfig as MetricEngineConfig;
3232
use mito2::config::MitoConfig;
3333
use query::options::QueryOptions;
34-
use servers::export_metrics::ExportMetricsOption;
3534
use servers::grpc::GrpcOptions;
3635
use servers::http::HttpOptions;
3736
use servers::tls::{TlsMode, TlsOption};
@@ -88,11 +87,7 @@ fn test_load_datanode_example_config() {
8887
tracing_sample_ratio: Some(Default::default()),
8988
..Default::default()
9089
},
91-
export_metrics: ExportMetricsOption {
92-
self_import: None,
93-
remote_write: Some(Default::default()),
94-
..Default::default()
95-
},
90+
9691
grpc: GrpcOptions::default()
9792
.with_bind_addr("127.0.0.1:3001")
9893
.with_server_addr("127.0.0.1:3001"),
@@ -138,11 +133,7 @@ fn test_load_frontend_example_config() {
138133
..Default::default()
139134
},
140135
},
141-
export_metrics: ExportMetricsOption {
142-
self_import: None,
143-
remote_write: Some(Default::default()),
144-
..Default::default()
145-
},
136+
146137
grpc: GrpcOptions::default()
147138
.with_bind_addr("127.0.0.1:4001")
148139
.with_server_addr("127.0.0.1:4001"),
@@ -187,11 +178,7 @@ fn test_load_metasrv_example_config() {
187178
tcp_nodelay: true,
188179
},
189180
},
190-
export_metrics: ExportMetricsOption {
191-
self_import: None,
192-
remote_write: Some(Default::default()),
193-
..Default::default()
194-
},
181+
195182
backend_tls: Some(TlsOption {
196183
mode: TlsMode::Prefer,
197184
cert_path: String::new(),
@@ -300,11 +287,7 @@ fn test_load_standalone_example_config() {
300287
tracing_sample_ratio: Some(Default::default()),
301288
..Default::default()
302289
},
303-
export_metrics: ExportMetricsOption {
304-
self_import: Some(Default::default()),
305-
remote_write: Some(Default::default()),
306-
..Default::default()
307-
},
290+
308291
http: HttpOptions {
309292
cors_allowed_origins: vec!["https://example.com".to_string()],
310293
..Default::default()

src/common/catalog/src/consts.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ pub const INFORMATION_SCHEMA_TRIGGERS_TABLE_ID: u32 = 24;
8484
pub const INFORMATION_SCHEMA_GLOBAL_STATUS_TABLE_ID: u32 = 25;
8585
/// id for information_schema.SESSION_STATUS
8686
pub const INFORMATION_SCHEMA_SESSION_STATUS_TABLE_ID: u32 = 26;
87-
/// id for information_schema.RUNTIME_METRICS
88-
pub const INFORMATION_SCHEMA_RUNTIME_METRICS_TABLE_ID: u32 = 27;
8987
/// id for information_schema.PARTITIONS
9088
pub const INFORMATION_SCHEMA_PARTITIONS_TABLE_ID: u32 = 28;
9189
/// id for information_schema.REGION_PEERS

0 commit comments

Comments
 (0)