Skip to content

Commit

Permalink
Merge branch 'main' into err-empty-view
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Jul 12, 2023
2 parents b34ca8a + fcc6709 commit 02cc3ce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sdk/metric/view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,20 @@ func TestNewViewEmptyViewErrorLogged(t *testing.T) {
assert.Contains(t, got, errEmptyView.Error())
}

func TestNewViewMultiInstMatchErrorLogged(t *testing.T) {
var got string
otel.SetLogger(funcr.New(func(_, args string) {
got = args
}, funcr.Options{Verbosity: 6}))

_ = NewView(Instrument{
Name: "*", // Wildcard match name (multiple instruments).
}, Stream{
Name: "non-empty",
})
assert.Contains(t, got, errMultiInst.Error())
}

func ExampleNewView() {
// Create a view that renames the "latency" instrument from the v0.34.0
// version of the "http" instrumentation library as "request.latency".
Expand Down

0 comments on commit 02cc3ce

Please sign in to comment.