diff --git a/README.md b/README.md index c02ab206522..370513054de 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ It provides a set of APIs to directly measure performance and behavior of your s [Go: Metric SDK (GA)]: https://github.com/orgs/open-telemetry/projects/34 - [1]: [Metrics API](https://pkg.go.dev/go.opentelemetry.io/otel/metric) is Stable. [Metrics SDK](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric) is Beta. -- [2]: The Logs signal development is halted for this project while we stablize the Metrics SDK. +- [2]: The Logs signal development is halted for this project while we stabilize the Metrics SDK. No Logs Pull Requests are currently being accepted. Progress and status specific to this repository is tracked in our diff --git a/sdk/metric/manual_reader.go b/sdk/metric/manual_reader.go index b8dcf1fccda..898af86edc0 100644 --- a/sdk/metric/manual_reader.go +++ b/sdk/metric/manual_reader.go @@ -118,8 +118,8 @@ func (mr *ManualReader) Shutdown(context.Context) error { return err } -// Collect gathers all metrics from the SDK and other Producers, calling any -// callbacks necessary and stores the result in rm. +// Collect gathers all metric data related to the Reader from +// the SDK and other Producers and stores the result in rm. // // Collect will return an error if called after shutdown. // Collect will return an error if rm is a nil ResourceMetrics. diff --git a/sdk/metric/manual_reader_test.go b/sdk/metric/manual_reader_test.go index 485c1b6eaf0..1c2f63cf504 100644 --- a/sdk/metric/manual_reader_test.go +++ b/sdk/metric/manual_reader_test.go @@ -80,25 +80,18 @@ func TestManualReaderCollect(t *testing.T) { defer cancel() tests := []struct { - name string - - ctx context.Context - resourceMetrics *metricdata.ResourceMetrics - + name string + ctx context.Context expectedErr error }{ { - name: "with a valid context", - - ctx: context.Background(), - resourceMetrics: &metricdata.ResourceMetrics{}, + name: "with a valid context", + ctx: context.Background(), + expectedErr: nil, }, { - name: "with an expired context", - - ctx: expiredCtx, - resourceMetrics: &metricdata.ResourceMetrics{}, - + name: "with an expired context", + ctx: expiredCtx, expectedErr: context.DeadlineExceeded, }, } @@ -117,7 +110,8 @@ func TestManualReaderCollect(t *testing.T) { }, testM) assert.NoError(t, err) - assert.Equal(t, tt.expectedErr, rdr.Collect(tt.ctx, tt.resourceMetrics)) + rm := &metricdata.ResourceMetrics{} + assert.Equal(t, tt.expectedErr, rdr.Collect(tt.ctx, rm)) }) } } diff --git a/sdk/metric/periodic_reader.go b/sdk/metric/periodic_reader.go index 48bbdffd82f..e04c1edbe18 100644 --- a/sdk/metric/periodic_reader.go +++ b/sdk/metric/periodic_reader.go @@ -237,8 +237,8 @@ func (r *PeriodicReader) collectAndExport(ctx context.Context) error { return err } -// Collect gathers and returns all metric data related to the Reader from -// the SDK and other Producers and stores the result in rm. The returned metric +// Collect gathers all metric data related to the Reader from +// the SDK and other Producers and stores the result in rm. The metric // data is not exported to the configured exporter, it is left to the caller to // handle that if desired. // diff --git a/sdk/metric/periodic_reader_test.go b/sdk/metric/periodic_reader_test.go index ad8b5598756..e5b279ec238 100644 --- a/sdk/metric/periodic_reader_test.go +++ b/sdk/metric/periodic_reader_test.go @@ -424,25 +424,18 @@ func TestPeriodicReaderCollect(t *testing.T) { defer cancel() tests := []struct { - name string - - ctx context.Context - resourceMetrics *metricdata.ResourceMetrics - + name string + ctx context.Context expectedErr error }{ { - name: "with a valid context", - - ctx: context.Background(), - resourceMetrics: &metricdata.ResourceMetrics{}, + name: "with a valid context", + ctx: context.Background(), + expectedErr: nil, }, { - name: "with an expired context", - - ctx: expiredCtx, - resourceMetrics: &metricdata.ResourceMetrics{}, - + name: "with an expired context", + ctx: expiredCtx, expectedErr: context.DeadlineExceeded, }, } @@ -461,7 +454,8 @@ func TestPeriodicReaderCollect(t *testing.T) { }, testM) assert.NoError(t, err) - assert.Equal(t, tt.expectedErr, rdr.Collect(tt.ctx, tt.resourceMetrics)) + rm := &metricdata.ResourceMetrics{} + assert.Equal(t, tt.expectedErr, rdr.Collect(tt.ctx, rm)) }) } } diff --git a/sdk/trace/batch_span_processor_test.go b/sdk/trace/batch_span_processor_test.go index a7430335fbc..d4a5c2976a5 100644 --- a/sdk/trace/batch_span_processor_test.go +++ b/sdk/trace/batch_span_processor_test.go @@ -549,18 +549,6 @@ func (indefiniteExporter) ExportSpans(ctx context.Context, _ []sdktrace.ReadOnly return ctx.Err() } -func TestBatchSpanProcessorForceFlushTimeout(t *testing.T) { - // Add timeout to context to test deadline - ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond) - defer cancel() - <-ctx.Done() - - bsp := sdktrace.NewBatchSpanProcessor(indefiniteExporter{}) - if got, want := bsp.ForceFlush(ctx), context.DeadlineExceeded; !errors.Is(got, want) { - t.Errorf("expected %q error, got %v", want, got) - } -} - func TestBatchSpanProcessorForceFlushCancellation(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) // Cancel the context