Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define JavaScript runtimes semantic conventions #2290

Merged
merged 10 commits into from
Mar 2, 2022
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 16 additions & 8 deletions specification/resource/semantic_conventions/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,24 @@ Examples for some Java runtimes

### JavaScript runtimes

TODO(<https://github.com/open-telemetry/opentelemetry-js/issues/1544>): Confirm the contents here
JavaScript instrumentation should fill in the values by copying from built-in runtime constants.
legendecas marked this conversation as resolved.
Show resolved Hide resolved

| 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`.
legendecas marked this conversation as resolved.
Show resolved Hide resolved
- `process.runtime.description`:
- When the runtime is Node.js, fill in the values of `"Node.js"`, `process.version` in that order, separated by spaces.
legendecas marked this conversation as resolved.
Show resolved Hide resolved
legendecas marked this conversation as resolved.
Show resolved Hide resolved
legendecas marked this conversation as resolved.
Show resolved Hide resolved
- 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

Expand Down