You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-29 23:07:45 +02:00
Rename resource pkg label vars and methods (#1692)
* Rename resource pkg label vars and methods The former `labels` package is now named `attributes` to conform with the specification requirement. This removes the lingering `label` term from the `resource` package. Resolve https://github.com/open-telemetry/opentelemetry-go/issues/1691 * Update PR number in CHANGELOG * Propagate rename to the prometheus exporter pkg
This commit is contained in:
@@ -168,9 +168,9 @@ func TestMerge(t *testing.T) {
|
||||
func TestDefault(t *testing.T) {
|
||||
res := resource.Default()
|
||||
require.False(t, res.Equal(resource.Empty()))
|
||||
require.True(t, res.LabelSet().HasValue(semconv.ServiceNameKey))
|
||||
require.True(t, res.Set().HasValue(semconv.ServiceNameKey))
|
||||
|
||||
serviceName, _ := res.LabelSet().Value(semconv.ServiceNameKey)
|
||||
serviceName, _ := res.Set().Value(semconv.ServiceNameKey)
|
||||
require.True(t, strings.HasPrefix(serviceName.AsString(), "unknown_service:"))
|
||||
require.Greaterf(t, len(serviceName.AsString()), len("unknown_service:"),
|
||||
"default service.name should include executable name")
|
||||
|
||||
Reference in New Issue
Block a user