Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(risedev): add some configs for monitoring #15354

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions risedev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,9 @@ template:
# Frontend used by this Prometheus instance
provide-frontend: "frontend*"

# How frequently Prometheus scrape targets (collect metrics)
scrape-interval: 15s
xxchan marked this conversation as resolved.
Show resolved Hide resolved

frontend:
# Advertise address of frontend
address: "127.0.0.1"
Expand Down Expand Up @@ -1233,6 +1236,8 @@ template:
# gRPC listen port of the OTLP collector
otlp-port: 4317

max-bytes-per-trace: 5000000

opendal:
id: opendal

Expand Down
2 changes: 2 additions & 0 deletions src/risedevtool/src/config_gen/grafana_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ impl GrafanaGen {
[server]
http_addr = {grafana_host}
http_port = {grafana_port}
grpc-max-recv-msg-size-bytes = 104857600 # 100 Mb
grpc-max-send-msg-size-bytes = 104857600 # 100 Mb
[users]
default_theme = light
Expand Down
3 changes: 2 additions & 1 deletion src/risedevtool/src/config_gen/prometheus_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl PrometheusGen {
pub fn gen_prometheus_yml(&self, config: &PrometheusConfig) -> String {
let prometheus_host = &config.address;
let prometheus_port = &config.port;
let scrape_interval = &config.scrape_interval;
let compute_node_targets = config
.provide_compute_node
.as_ref()
Expand Down Expand Up @@ -104,7 +105,7 @@ remote_write:
format!(
r#"# --- THIS FILE IS AUTO GENERATED BY RISEDEV ---
global:
scrape_interval: 15s
scrape_interval: {scrape_interval}
evaluation_interval: 60s
external_labels:
rw_cluster: {now}
Expand Down
24 changes: 23 additions & 1 deletion src/risedevtool/src/config_gen/tempo_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,41 @@ impl TempoGen {
let otlp_host = &config.listen_address;
let otlp_port = config.otlp_port;

let max_bytes_per_trace = config.max_bytes_per_trace;

format!(
r#"# --- THIS FILE IS AUTO GENERATED BY RISEDEV ---
server:
http_listen_address: "{http_listen_address}"
http_listen_port: {http_listen_port}
grpc_server_max_recv_msg_size: 104857600 # 100 Mb
grpc_server_max_send_msg_size: 104857600 # 100 Mb
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "{otlp_host}:{otlp_port}"
"#
# Overrides configuration block
overrides:
# Global ingestion limits configurations
defaults:
# Global enforced overrides
global:
# Maximum size of a single trace in bytes. A value of 0 disables the size
# check.
# This limit is used in 3 places:
# - During search, traces will be skipped when they exceed this threshold.
# - During ingestion, traces that exceed this threshold will be refused.
# - During compaction, traces that exceed this threshold will be partially dropped.
# During ingestion, exceeding the threshold results in errors like
# TRACE_TOO_LARGE: max size of trace (5000000) exceeded while adding 387 bytes
max_bytes_per_trace: {max_bytes_per_trace}
"#
)
}
}
3 changes: 3 additions & 0 deletions src/risedevtool/src/service_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ pub struct PrometheusConfig {
pub remote_write_region: String,
pub remote_write_url: String,

pub scrape_interval: String,

pub provide_compute_node: Option<Vec<ComputeNodeConfig>>,
pub provide_meta_node: Option<Vec<MetaNodeConfig>>,
pub provide_minio: Option<Vec<MinioConfig>>,
Expand Down Expand Up @@ -221,6 +223,7 @@ pub struct TempoConfig {
pub address: String,
pub port: u16,
pub otlp_port: u16,
pub max_bytes_per_trace: usize,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/tempo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extend = "common.toml"
[env]
TEMPO_SYSTEM = "${SYSTEM_UNDERSCORE}"
TEMPO_DOWNLOAD_PATH = "${PREFIX_TMP}/tempo.tar.gz"
TEMPO_VERSION = "2.1.1"
TEMPO_VERSION = "2.3.1"
TEMPO_RELEASE = "tempo_${TEMPO_VERSION}_${TEMPO_SYSTEM}"
TEMPO_DOWNLOAD_TAR_GZ = "https://github.com/grafana/tempo/releases/download/v${TEMPO_VERSION}/${TEMPO_RELEASE}.tar.gz"

Expand Down
Loading