mirror of
https://github.com/rustfs/rustfs.git
synced 2026-03-17 14:24:08 +00:00
feat(observability): Add grafana dashboard, observability changes (#1770)
Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
@@ -69,6 +69,9 @@ services:
|
|||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
networks:
|
networks:
|
||||||
- rustfs-network
|
- rustfs-network
|
||||||
|
volumes:
|
||||||
|
- ../../.docker/observability/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||||
|
- ../../.docker/observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
||||||
|
|
||||||
node1:
|
node1:
|
||||||
build:
|
build:
|
||||||
@@ -79,7 +82,7 @@ services:
|
|||||||
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
||||||
- RUSTFS_ADDRESS=:9000
|
- RUSTFS_ADDRESS=:9000
|
||||||
- RUSTFS_CONSOLE_ENABLE=true
|
- RUSTFS_CONSOLE_ENABLE=true
|
||||||
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
|
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4318
|
||||||
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
ports:
|
ports:
|
||||||
@@ -96,7 +99,7 @@ services:
|
|||||||
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
||||||
- RUSTFS_ADDRESS=:9000
|
- RUSTFS_ADDRESS=:9000
|
||||||
- RUSTFS_CONSOLE_ENABLE=true
|
- RUSTFS_CONSOLE_ENABLE=true
|
||||||
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
|
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4318
|
||||||
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
ports:
|
ports:
|
||||||
@@ -113,7 +116,7 @@ services:
|
|||||||
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
||||||
- RUSTFS_ADDRESS=:9000
|
- RUSTFS_ADDRESS=:9000
|
||||||
- RUSTFS_CONSOLE_ENABLE=true
|
- RUSTFS_CONSOLE_ENABLE=true
|
||||||
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
|
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4318
|
||||||
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
ports:
|
ports:
|
||||||
@@ -130,7 +133,7 @@ services:
|
|||||||
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4}
|
||||||
- RUSTFS_ADDRESS=:9000
|
- RUSTFS_ADDRESS=:9000
|
||||||
- RUSTFS_CONSOLE_ENABLE=true
|
- RUSTFS_CONSOLE_ENABLE=true
|
||||||
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
|
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4318
|
||||||
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
- RUSTFS_OBS_LOGGER_LEVEL=debug
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
1167
.docker/observability/grafana/dashboards/rustfs.yaml
Normal file
1167
.docker/observability/grafana/dashboards/rustfs.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,6 @@ exporters:
|
|||||||
queue_size: 5000 # Queue size
|
queue_size: 5000 # Queue size
|
||||||
prometheus: # Prometheus exporter for metrics data
|
prometheus: # Prometheus exporter for metrics data
|
||||||
endpoint: "0.0.0.0:8889" # Prometheus scraping endpoint
|
endpoint: "0.0.0.0:8889" # Prometheus scraping endpoint
|
||||||
namespace: "metrics" # indicator prefix
|
|
||||||
send_timestamps: true # Send timestamp
|
send_timestamps: true # Send timestamp
|
||||||
metric_expiration: 5m # Metric expiration time
|
metric_expiration: 5m # Metric expiration time
|
||||||
resource_to_telemetry_conversion:
|
resource_to_telemetry_conversion:
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ pub const DEFAULT_CONSOLE_ENABLE: bool = true;
|
|||||||
/// Default OBS configuration endpoint
|
/// Default OBS configuration endpoint
|
||||||
/// Environment variable: DEFAULT_OBS_ENDPOINT
|
/// Environment variable: DEFAULT_OBS_ENDPOINT
|
||||||
/// Command line argument: --obs-endpoint
|
/// Command line argument: --obs-endpoint
|
||||||
/// Example: DEFAULT_OBS_ENDPOINT="http://localost:4317"
|
/// Example: DEFAULT_OBS_ENDPOINT="http://localost:4318"
|
||||||
/// Example: --obs-endpoint http://localost:4317
|
/// Example: --obs-endpoint http://localost:4318
|
||||||
pub const DEFAULT_OBS_ENDPOINT: &str = "";
|
pub const DEFAULT_OBS_ENDPOINT: &str = "";
|
||||||
|
|
||||||
/// Default TLS key for rustfs
|
/// Default TLS key for rustfs
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
[observability]
|
[observability]
|
||||||
endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified
|
endpoint = "http://localhost:4318" # Default is "http://localhost:4318" if not specified
|
||||||
use_stdout = false # Output with stdout, true output, false no output
|
use_stdout = false # Output with stdout, true output, false no output
|
||||||
sample_ratio = 1
|
sample_ratio = 1
|
||||||
meter_interval = 30
|
meter_interval = 30
|
||||||
@@ -21,4 +21,4 @@ service_name = "rustfs"
|
|||||||
service_version = "0.1.0"
|
service_version = "0.1.0"
|
||||||
environments = "develop"
|
environments = "develop"
|
||||||
logger_level = "debug"
|
logger_level = "debug"
|
||||||
local_logging_enabled = true # Default is false if not specified
|
local_logging_enabled = true # Default is false if not specified
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ use tracing::{Level, error, info, instrument};
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let obs_conf = Some("http://localhost:4317".to_string());
|
let obs_conf = Some("http://localhost:4318".to_string());
|
||||||
let _guard = init_obs(obs_conf).await;
|
let _guard = init_obs(obs_conf).await;
|
||||||
let span = tracing::span!(Level::INFO, "main");
|
let span = tracing::span!(Level::INFO, "main");
|
||||||
let _enter = span.enter();
|
let _enter = span.enter();
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ impl AppConfig {
|
|||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// use rustfs_obs::AppConfig;
|
/// use rustfs_obs::AppConfig;
|
||||||
///
|
///
|
||||||
/// let config = AppConfig::new_with_endpoint(Some("http://localhost:4317".to_string()));
|
/// let config = AppConfig::new_with_endpoint(Some("http://localhost:4318".to_string()));
|
||||||
/// ```
|
/// ```
|
||||||
pub fn new_with_endpoint(endpoint: Option<String>) -> Self {
|
pub fn new_with_endpoint(endpoint: Option<String>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ RUSTFS_SERVER_DOMAINS=127.0.0.1:9000
|
|||||||
# RustFS license content
|
# RustFS license content
|
||||||
RUSTFS_LICENSE="license content"
|
RUSTFS_LICENSE="license content"
|
||||||
# Observability configuration endpoint: RUSTFS_OBS_ENDPOINT
|
# Observability configuration endpoint: RUSTFS_OBS_ENDPOINT
|
||||||
RUSTFS_OBS_ENDPOINT=http://localhost:4317
|
RUSTFS_OBS_ENDPOINT=http://localhost:4318
|
||||||
# TLS certificates directory path: deploy/certs
|
# TLS certificates directory path: deploy/certs
|
||||||
RUSTFS_TLS_PATH=/etc/default/tls
|
RUSTFS_TLS_PATH=/etc/default/tls
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ services:
|
|||||||
- RUSTFS_SECRET_KEY=rustfsadmin
|
- RUSTFS_SECRET_KEY=rustfsadmin
|
||||||
- RUSTFS_OBS_LOGGER_LEVEL=info
|
- RUSTFS_OBS_LOGGER_LEVEL=info
|
||||||
- RUSTFS_TLS_PATH=/opt/tls
|
- RUSTFS_TLS_PATH=/opt/tls
|
||||||
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4317
|
- RUSTFS_OBS_ENDPOINT=http://otel-collector:4318
|
||||||
volumes:
|
volumes:
|
||||||
- ./deploy/data/pro:/data
|
- ./deploy/data/pro:/data
|
||||||
- ./deploy/logs:/app/logs
|
- ./deploy/logs:/app/logs
|
||||||
|
|||||||
Reference in New Issue
Block a user