Skip to content

Commit

Permalink
change gc runtime name to go (#2560)
Browse files Browse the repository at this point in the history
Per the specification: open-telemetry/opentelemetry-specification#2262

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
dmathieu and MrAlias committed Feb 23, 2022
1 parent 0a6e4d8 commit a15269a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- `OTEL_SPAN_LINK_COUNT_LIMIT`

If the provided environment variables are invalid (negative), the default values would be used.
- Rename the `gc` runtime name to `go` (#2560)

### Changed

Expand Down
7 changes: 6 additions & 1 deletion sdk/resource/process.go
Expand Up @@ -39,7 +39,12 @@ var (
defaultExecutablePathProvider executablePathProvider = os.Executable
defaultCommandArgsProvider commandArgsProvider = func() []string { return os.Args }
defaultOwnerProvider ownerProvider = user.Current
defaultRuntimeNameProvider runtimeNameProvider = func() string { return runtime.Compiler }
defaultRuntimeNameProvider runtimeNameProvider = func() string {
if runtime.Compiler == "gc" {
return "go"
}
return runtime.Compiler
}
defaultRuntimeVersionProvider runtimeVersionProvider = runtime.Version
defaultRuntimeOSProvider runtimeOSProvider = func() string { return runtime.GOOS }
defaultRuntimeArchProvider runtimeArchProvider = func() string { return runtime.GOARCH }
Expand Down
6 changes: 5 additions & 1 deletion sdk/resource/process_test.go
Expand Up @@ -118,7 +118,11 @@ func TestCommandArgs(t *testing.T) {
}

func TestRuntimeName(t *testing.T) {
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
if runtime.Compiler == "gc" {
require.EqualValues(t, "go", resource.RuntimeName())
} else {
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
}
}

func TestRuntimeOS(t *testing.T) {
Expand Down

0 comments on commit a15269a

Please sign in to comment.