fix otlp
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user