1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-15 01:04:25 +02:00

Create resource.Default() with required attributes/default values (#1507)

* Create resource.Default() with required attributes/default values

Add metric controller and tracer provider tests for resources

* Updated CHANGELOG

* PR comments

+ some small CHANGELOG PR addition, rewording
+ change default resource servicename to `unknown_service:go` (this
matches the Java codebase which uses `unknown_service:java`)
This commit is contained in:
ET
2021-02-15 12:28:37 -08:00
committed by GitHub
parent 76f9342277
commit 8fae0a644a
10 changed files with 204 additions and 45 deletions

View File

@ -29,6 +29,7 @@ import (
"go.opentelemetry.io/otel/sdk/metric/controller/controllertest"
processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
"go.opentelemetry.io/otel/sdk/metric/processor/processortest"
"go.opentelemetry.io/otel/sdk/resource"
)
func TestPullNoCollect(t *testing.T) {
@ -39,6 +40,7 @@ func TestPullNoCollect(t *testing.T) {
processor.WithMemory(true),
),
controller.WithCollectPeriod(0),
controller.WithResource(resource.Empty()),
)
ctx := context.Background()
@ -74,6 +76,7 @@ func TestPullWithCollect(t *testing.T) {
processor.WithMemory(true),
),
controller.WithCollectPeriod(time.Second),
controller.WithResource(resource.Empty()),
)
mock := controllertest.NewMockClock()
puller.SetClock(mock)