From af451873e7aa903b86428e3d9b2b126ada4f572a Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Tue, 17 Jan 2023 09:34:43 -0800 Subject: [PATCH] Add a noop filter to default view --- sdk/metric/meter_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/metric/meter_test.go b/sdk/metric/meter_test.go index cfe8accd945..76a0bf8ec10 100644 --- a/sdk/metric/meter_test.go +++ b/sdk/metric/meter_test.go @@ -1071,7 +1071,8 @@ func TestAsynchronousExample(t *testing.T) { selector := func(InstrumentKind) metricdata.Temporality { return temp } reader := NewManualReader(WithTemporalitySelector(selector)) - noFiltered := NewView(Instrument{Name: instName}, Stream{Name: instName}) + noopFilter := func(kv attribute.KeyValue) bool { return true } + noFiltered := NewView(Instrument{Name: instName}, Stream{Name: instName, AttributeFilter: noopFilter}) filter := func(kv attribute.KeyValue) bool { return kv.Key != "tid" } filtered := NewView(Instrument{Name: instName}, Stream{Name: filteredStream, AttributeFilter: filter})