Skip to content

Commit 8952223

Browse files
committed
fix(js): dont throw errors when endpoint is not provided
1 parent 76a1729 commit 8952223

File tree

1 file changed

+2
-5
lines changed
  • services/js-poc/deno_telemetry

1 file changed

+2
-5
lines changed

services/js-poc/deno_telemetry/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ use std::time::{Duration, SystemTime};
1616
use std::{env, thread};
1717

1818
use config::TelemetryConfig;
19-
use deno_core::anyhow::{self, bail};
2019
use deno_core::futures::channel::mpsc;
2120
use deno_core::futures::channel::mpsc::UnboundedSender;
2221
use deno_core::futures::future::BoxFuture;
2322
use deno_core::futures::{stream, FutureExt, Stream, StreamExt};
2423
use deno_core::v8::DataError;
25-
use deno_core::{op2, v8, GarbageCollected, OpState};
24+
use deno_core::{anyhow, op2, v8, GarbageCollected, OpState};
2625
use deno_error::{JsError, JsErrorBox};
2726
use once_cell::sync::Lazy;
2827
use opentelemetry::logs::{AnyValue, LogRecord as LogRecordTrait, Severity};
@@ -543,9 +542,7 @@ pub fn init(
543542
) -> deno_core::anyhow::Result<OtelGlobals> {
544543
let protocol = config.protocol;
545544

546-
let Some(endpoint) = config.endpoint else {
547-
bail!("missing endpoint");
548-
};
545+
let endpoint = config.endpoint.unwrap_or("".to_string());
549546
let endpoint = endpoint.trim_end_matches("/").to_string(); // normalize endpoint
550547

551548
// Define the resource attributes that will be attached to all log records.

0 commit comments

Comments
 (0)