Skip to content

Commit

Permalink
Change golang namespace to 'go', rather than 'gc' (#2262)
Browse files Browse the repository at this point in the history
* Change golang namespace to 'go', rather than 'gc'

* Specify common process.runtime.* attributes for Go

* Add link to runtime.Compiler

* Remove static descriptions

* Add table of descriptions for golang runtime names

* Add context to go examples

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
  • Loading branch information
djaglowski and SergeyKanzhelev committed Jan 27, 2022
1 parent 5050ab0 commit 6b2015a
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions specification/resource/semantic_conventions/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,34 @@ Example:

### Go Runtimes

TODO(<https://github.com/open-telemetry/opentelemetry-go/issues/1181>): Confirm the contents here
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`.

This can be implemented with the following Go snippet:

```go
import "runtime"

func getRuntimeName() string {
if runtime.Compiler == "gc" {
return "go"
}
return runtime.Compiler
}
```

| Value | Description |
- `process.runtime.version` - Fill in the exact value returned by `runtime.Version()`, i.e. `go1.17`.
- `process.runtime.description` - Use of this field is not recommended.

Examples for some Go compilers/runtimes:

| `process.runtime.name` | Description |
| --- | --- |
| `gc` | Go compiler |
| `gccgo` | GCC Go frontend |
| `go` | Official Go compiler. Also known as `cmd/compile`. |
| `gccgo` | [gccgo](https://go.dev/doc/install/gccgo) is a Go [front end for GCC](https://gcc.gnu.org/frontends.html). |
| `tinygo` | [TinyGo](https://tinygo.org/) compiler. |

### Java runtimes

Expand Down

0 comments on commit 6b2015a

Please sign in to comment.