36 lines
909 B
Rust
36 lines
909 B
Rust
use clap::Parser;
|
|
|
|
#[derive(Parser, Debug)]
|
|
#[command(name = "metrics-aggregator")]
|
|
#[command(version)]
|
|
pub struct Args {
|
|
#[arg(long, default_value = "9090", env = "METRICS_AGGREGATOR_PORT")]
|
|
pub port: u16,
|
|
|
|
#[arg(long, env = "OTEL_EXPORTER_OTLP_ENDPOINT")]
|
|
pub otel_endpoint: Option<String>,
|
|
|
|
#[arg(long, env = "LOKI_URL")]
|
|
pub loki_url: Option<String>,
|
|
|
|
#[arg(long, default_value = "15", env = "SCRAPE_INTERVAL_SECS")]
|
|
pub scrape_interval_secs: u64,
|
|
|
|
/// JSON file with scrape targets.
|
|
#[arg(long, env = "SCRAPE_TARGETS_FILE")]
|
|
pub targets_file: Option<String>,
|
|
|
|
#[arg(long, default_value = "info", env = "LOG_LEVEL")]
|
|
pub log_level: String,
|
|
|
|
/// Comma-separated list of app names to scrape.
|
|
#[arg(long, env = "SCRAPE_APPS")]
|
|
pub scrape_apps: Option<String>,
|
|
|
|
#[arg(long)]
|
|
pub no_otel: bool,
|
|
|
|
#[arg(long)]
|
|
pub no_loki: bool,
|
|
}
|