1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-30 04:40:41 +02:00

change gc runtime name to go (#2560)

Per the specification: https://github.com/open-telemetry/opentelemetry-specification/pull/2262

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Damien Mathieu 2022-02-23 18:27:52 +01:00 committed by GitHub
parent 0a6e4d8218
commit a15269a28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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 }

View File

@ -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) {