diff options
author | haturau <135221985+haturatu@users.noreply.github.com> | 2024-11-20 01:20:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 01:20:47 +0900 |
commit | 85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch) | |
tree | face0aecaac53e93ce2f23b53c48859bcf1a36ec /runtime/worker_bootstrap.rs | |
parent | 67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff) | |
parent | 186b52731c6bb326c4d32905c5e732d082e83465 (diff) |
Merge branch 'denoland:main' into main
Diffstat (limited to 'runtime/worker_bootstrap.rs')
-rw-r--r-- | runtime/worker_bootstrap.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/worker_bootstrap.rs b/runtime/worker_bootstrap.rs index 3f3c25c5e..3f5c245a0 100644 --- a/runtime/worker_bootstrap.rs +++ b/runtime/worker_bootstrap.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use crate::ops::otel::OtelConfig; use deno_core::v8; use deno_core::ModuleSpecifier; use serde::Serialize; @@ -118,6 +119,8 @@ pub struct BootstrapOptions { // Used by `deno serve` pub serve_port: Option<u16>, pub serve_host: Option<String>, + // OpenTelemetry output options. If `None`, OpenTelemetry is disabled. + pub otel_config: Option<OtelConfig>, } impl Default for BootstrapOptions { @@ -152,6 +155,7 @@ impl Default for BootstrapOptions { mode: WorkerExecutionMode::None, serve_port: Default::default(), serve_host: Default::default(), + otel_config: None, } } } @@ -193,6 +197,8 @@ struct BootstrapV8<'a>( Option<bool>, // serve worker count Option<usize>, + // OTEL config + Box<[u8]>, ); impl BootstrapOptions { @@ -219,6 +225,11 @@ impl BootstrapOptions { self.serve_host.as_deref(), serve_is_main, serve_worker_count, + if let Some(otel_config) = self.otel_config.as_ref() { + Box::new([otel_config.console as u8, otel_config.deterministic as u8]) + } else { + Box::new([]) + }, ); bootstrap.serialize(ser).unwrap() |