From 79bf15a37ead0cd39d014eb3437dd95678e276ac Mon Sep 17 00:00:00 2001 From: legendecas Date: Tue, 25 Jan 2022 15:22:27 +0800 Subject: [PATCH 1/3] Define JavaScript runtimes semantic conventions --- .../resource/semantic_conventions/process.md | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/specification/resource/semantic_conventions/process.md b/specification/resource/semantic_conventions/process.md index 1c62544035d..5cc15ca072a 100644 --- a/specification/resource/semantic_conventions/process.md +++ b/specification/resource/semantic_conventions/process.md @@ -109,16 +109,24 @@ Examples for some Java runtimes ### JavaScript runtimes -TODO(): Confirm the contents here +JavaScript instrumentation should fill in the values by copying from built-in runtime constants. -| Value | Description | -| --- | --- | -| `nodejs` | NodeJS | -| `browser` | Web Browser | -| `iojs` | io.js | -| `graalvm` | GraalVM | +- `process.runtime.name`: + - When the runtime is Node.js, fill in the constant value `nodejs`. + - When the runtime is Web Browser, fill in the constant value `browser`. +- `process.runtime.version`: + - When the runtime is Node.js, fill in the value of `process.versions.node`. + - When the runtime is Web Browser, fill in the value of `navigator.userAgent`. +- `process.runtime.description`: + - When the runtime is Node.js, fill in the values of `"Node.js"`, `process.version` in that order, separated by spaces. + - When the runtime is Web Browser, fill in the constant value `Web Browser`. + +Examples for some JavaScript runtimes -When the value is `browser`, `process.runtime.version` SHOULD be set to the User-Agent header. +| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` | +| --- | --- | --- | --- | +| Node.js | nodejs | 14.15.4 | Node.js v14.15.4 | +| Web Browser | browser | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 | Web Browser | ### .NET Runtimes From 117ccb18dae3311ecb578d49455a2ad93e242a74 Mon Sep 17 00:00:00 2001 From: legendecas Date: Wed, 26 Jan 2022 01:14:12 +0800 Subject: [PATCH 2/3] fixup! --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d54b298f0..bfd5c277ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ release. ### Semantic Conventions +- Define JavaScript runtime semantic conventions. + ([#2290](https://github.com/open-telemetry/opentelemetry-specification/pull/2290)) - Prohibit usage of retired names in semantic conventions. ([#2191](https://github.com/open-telemetry/opentelemetry-specification/pull/2191)) - Add `device.manufacturer` to describe mobile device manufacturers. From d1c7a05c205629f294ae9677270e181752b0bc9e Mon Sep 17 00:00:00 2001 From: legendecas Date: Thu, 27 Jan 2022 00:45:15 +0800 Subject: [PATCH 3/3] fixup! remove redundant runtime description --- .../resource/semantic_conventions/process.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/specification/resource/semantic_conventions/process.md b/specification/resource/semantic_conventions/process.md index 5cc15ca072a..5fddaa078a9 100644 --- a/specification/resource/semantic_conventions/process.md +++ b/specification/resource/semantic_conventions/process.md @@ -117,16 +117,13 @@ JavaScript instrumentation should fill in the values by copying from built-in ru - `process.runtime.version`: - When the runtime is Node.js, fill in the value of `process.versions.node`. - When the runtime is Web Browser, fill in the value of `navigator.userAgent`. -- `process.runtime.description`: - - When the runtime is Node.js, fill in the values of `"Node.js"`, `process.version` in that order, separated by spaces. - - When the runtime is Web Browser, fill in the constant value `Web Browser`. Examples for some JavaScript runtimes -| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` | -| --- | --- | --- | --- | -| Node.js | nodejs | 14.15.4 | Node.js v14.15.4 | -| Web Browser | browser | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 | Web Browser | +| Name | `process.runtime.name` | `process.runtime.version` | +| --- | --- | --- | +| Node.js | nodejs | 14.15.4 | +| Web Browser | browser | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 | ### .NET Runtimes