mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
fix otlp tls
This commit is contained in:
parent
2ad9417417
commit
cb7657116c
1 changed files with 3 additions and 4 deletions
|
|
@ -101,11 +101,10 @@ fn setup() -> Result<Config, SetupError> {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.filter(|tracing_cfg| !tracing_cfg.endpoint.is_empty())
|
.filter(|tracing_cfg| !tracing_cfg.endpoint.is_empty())
|
||||||
{
|
{
|
||||||
let tls_config = tonic::transport::ClientTlsConfig::new().with_webpki_roots();
|
let mut tls_config = ClientTlsConfig::new().with_webpki_roots();
|
||||||
|
|
||||||
let mut otlp_exporter = opentelemetry_otlp::new_exporter()
|
let mut otlp_exporter = opentelemetry_otlp::new_exporter()
|
||||||
.tonic()
|
.tonic()
|
||||||
.with_tls_config(tls_config)
|
|
||||||
.with_endpoint(&tracing_cfg.endpoint);
|
.with_endpoint(&tracing_cfg.endpoint);
|
||||||
|
|
||||||
if let Some(tracing_ident) = tracing_cfg.tls.as_ref().map(|tracing_tls_cfg| {
|
if let Some(tracing_ident) = tracing_cfg.tls.as_ref().map(|tracing_tls_cfg| {
|
||||||
|
|
@ -113,9 +112,9 @@ fn setup() -> Result<Config, SetupError> {
|
||||||
let cert = load(&tracing_tls_cfg.cert_file)?;
|
let cert = load(&tracing_tls_cfg.cert_file)?;
|
||||||
Result::<_, SetupError>::Ok(Identity::from_pem(cert, key))
|
Result::<_, SetupError>::Ok(Identity::from_pem(cert, key))
|
||||||
}) {
|
}) {
|
||||||
let tls_config = ClientTlsConfig::new().identity(tracing_ident?);
|
tls_config = tls_config.identity(tracing_ident?);
|
||||||
otlp_exporter = otlp_exporter.with_tls_config(tls_config);
|
|
||||||
}
|
}
|
||||||
|
otlp_exporter = otlp_exporter.with_tls_config(tls_config);
|
||||||
|
|
||||||
let tracer = opentelemetry_otlp::new_pipeline()
|
let tracer = opentelemetry_otlp::new_pipeline()
|
||||||
.tracing()
|
.tracing()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue