This commit is contained in:
John Smith
2022-06-15 15:03:13 -04:00
parent c33f78ac8b
commit a3e43ef68b
6 changed files with 41 additions and 21 deletions

View File

@@ -66,7 +66,7 @@ fn do_clap_matches(default_config_path: &OsStr) -> Result<clap::ArgMatches, clap
.long("otlp")
.takes_value(true)
.value_name("endpoint")
.default_missing_value("http://localhost:4317")
.default_missing_value("localhost:4317")
.help("Turn on OpenTelemetry tracing"),
)
.arg(
@@ -207,15 +207,13 @@ pub fn process_command_line() -> Result<(Settings, ArgMatches), String> {
}
if matches.occurrences_of("otlp") != 0 {
settingsrw.logging.otlp.enabled = true;
settingsrw.logging.otlp.grpc_endpoint = Some(
ParsedUrl::from_str(
&matches
.value_of("otlp")
.expect("should not be null because of default missing value")
.to_string(),
)
.map_err(|e| format!("failed to parse OTLP url: {}", e))?,
);
settingsrw.logging.otlp.grpc_endpoint = NamedSocketAddrs::from_str(
&matches
.value_of("otlp")
.expect("should not be null because of default missing value")
.to_string(),
)
.map_err(|e| format!("failed to parse OTLP address: {}", e))?;
settingsrw.logging.otlp.level = LogLevel::Trace;
}
if matches.is_present("attach") {