From 4f6af3ae6f12e3cc8dd815f995d20a382e01779b Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Thu, 27 Jan 2022 02:21:21 -0500 Subject: [PATCH] Change golang namespace to 'go', rather than 'gc' (#2262) * 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 --- .../resource/semantic_conventions/process.md | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/specification/resource/semantic_conventions/process.md b/specification/resource/semantic_conventions/process.md index 1c6254403..9ec2d7852 100644 --- a/specification/resource/semantic_conventions/process.md +++ b/specification/resource/semantic_conventions/process.md @@ -78,12 +78,34 @@ Example: ### Go Runtimes -TODO(): Confirm the contents here +Go Runtimes should fill in the as follows: -| Value | Description | +- `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 + } + ``` + +- `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