Skip to content

Commit

Permalink
.NET runtime process resource attributes (open-telemetry#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek authored and pyohannes committed Jan 17, 2024
1 parent 4255d8a commit 9a6b86e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ release.
([#21](https://github.com/open-telemetry/semantic-conventions/pull/21))
- Add `messaging.gcp_pubsub.message.ordering_key` attribute.
([#528](https://github.com/open-telemetry/semantic-conventions/pull/528))
- Define how to set `process.runtime.name`, `process.runtime.version`,
`process.runtime.description` for .NET runtime.
([#561](https://github.com/open-telemetry/semantic-conventions/pull/561))
- Add `db.instance.id` attribute.
([#345](https://github.com/open-telemetry/semantic-conventions/pull/345))
- Add messaging metrics
Expand Down
36 changes: 25 additions & 11 deletions docs/resource/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Example:

### Go Runtimes

Go Runtimes should fill in the as follows:
Go Runtimes SHOULD fill in the as follows:

- `process.runtime.name` - Fill in an interpretation of Go's [`runtime.Compiler`](https://pkg.go.dev/runtime#Compiler) constant, according to the following rule:
If the value is `gc`, fill in `go`. Otherwise, fill in the exact value of `runtime.Compiler`.
Expand Down Expand Up @@ -116,7 +116,7 @@ Examples for some Go compilers/runtimes:

### Java runtimes

Java instrumentation should fill in the values by copying from system properties.
Java instrumentation SHOULD fill in the values by copying from system properties.

- `process.runtime.name` - Fill in the value of `java.runtime.name` as is
- `process.runtime.version` - Fill in the value of `java.runtime.version` as is
Expand All @@ -138,7 +138,7 @@ Examples for some Java runtimes

### JavaScript runtimes

JavaScript instrumentation should fill in the values by copying from built-in runtime constants.
JavaScript instrumentation SHOULD fill in the values by copying from built-in runtime constants.

- `process.runtime.name`:
- When the runtime is Node.js, fill in the constant value `nodejs`.
Expand All @@ -156,17 +156,31 @@ Examples for some JavaScript runtimes

### .NET Runtimes

TODO(<https://github.com/open-telemetry/opentelemetry-dotnet/issues/1281>): Confirm the contents here
.NET instrumentation SHOULD fill in the values by following values:

| Value | Description |
| --- | --- |
| `dotnet-core` | .NET Core, .NET 5+ |
| `dotnet-framework` | .NET Framework |
| `mono` | Mono |
- `process.runtime.name` - Fill in the value by the name of runtime.
- `process.runtime.version` - Fill in the value of `System.Environment.Version` for .NET,
determine version based on the [registry values](https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#query-the-registry-using-code)
for .NET Framework
- `process.runtime.description` - Fill in the values of `System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription`.

`process.runtime.name` has the following list of well-known values. If one of them applies, then the respective value SHOULD be used, otherwise a custom value SHOULD be used.

- .NET Framework
- .NET
- .NET Core
- .NET Native

Examples for some .NET runtimes

| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- | --- |
| .NET Framework | .NET Framework | 4.8 | .NET Framework 4.8.9195.0 |
| .NET | .NET | 7.0.14 | .NET 7.0.14 |

### Python Runtimes

Python instrumentation should fill in the values as follows:
Python instrumentation SHOULD fill in the values as follows:

- `process.runtime.name` -
Fill in the value of [`sys.implementation.name`][py_impl]
Expand Down Expand Up @@ -207,7 +221,7 @@ Pypy provided a CPython-compatible version in `sys.implementation.version` inste

### Ruby Runtimes

Ruby instrumentation should fill in the values by copying from built-in runtime constants.
Ruby instrumentation SHOULD fill in the values by copying from built-in runtime constants.

- `process.runtime.name` - Fill in the value of `RUBY_ENGINE` as is
- `process.runtime.version` - Fill in the value of `RUBY_VERSION` as is
Expand Down

0 comments on commit 9a6b86e

Please sign in to comment.