diff options
author | snek <snek@deno.com> | 2024-11-13 11:38:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 10:38:46 +0000 |
commit | aa546189be730163ee5370029e4dfdb3b454ab96 (patch) | |
tree | 4407643e6908f82c9ac31d9ae5faf04b3ab8d413 /cli/args | |
parent | 7becd83a3828b35331d0fcb82c64146e520f154b (diff) |
feat: OpenTelemetry Tracing API and Exporting (#26710)
Initial import of OTEL code supporting tracing. Metrics soon to come.
Implements APIs for https://jsr.io/@deno/otel so that code using
OpenTelemetry.js just works tm.
There is still a lot of work to do with configuration and adding
built-in tracing to core APIs, which will come in followup PRs.
---------
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'cli/args')
-rw-r--r-- | cli/args/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index e19025f8b..3aaf2bd43 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -27,6 +27,7 @@ use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot; use deno_npm::NpmSystemInfo; use deno_path_util::normalize_path; +use deno_runtime::ops::otel::OtelConfig; use deno_semver::npm::NpmPackageReqReference; use import_map::resolve_import_map_value_from_specifier; @@ -1129,6 +1130,23 @@ impl CliOptions { } } + pub fn otel_config(&self) -> Option<OtelConfig> { + if self + .flags + .unstable_config + .features + .contains(&String::from("otel")) + { + Some(OtelConfig { + runtime_name: Cow::Borrowed("deno"), + runtime_version: Cow::Borrowed(crate::version::DENO_VERSION_INFO.deno), + ..Default::default() + }) + } else { + None + } + } + pub fn env_file_name(&self) -> Option<&String> { self.flags.env_file.as_ref() } |