Skip to content

Commit

Permalink
Define JavaScript runtimes semantic conventions (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas authored Mar 2, 2022
1 parent e456dbb commit 9faecf4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ release.

### Semantic Conventions

- Define JavaScript runtime semantic conventions.
([#2290](https://github.com/open-telemetry/opentelemetry-specification/pull/2290))

### Compatibility

### OpenTelemetry Protocol
Expand Down
21 changes: 13 additions & 8 deletions specification/resource/semantic_conventions/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,21 @@ 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.

| 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`.

When the value is `browser`, `process.runtime.version` SHOULD be set to the User-Agent header.
Examples for some JavaScript runtimes

| 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

Expand Down

0 comments on commit 9faecf4

Please sign in to comment.