From d66a6618c2834b57ea9511af8214ea5cd0b66d35 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 8 Apr 2024 00:47:11 -0700 Subject: [PATCH] otelloghttp: Implement Exporter.ForceFlush (#5164) It holds no state, already implemented. --- .../otlp/otlplog/otlploghttp/exporter.go | 1 - .../otlp/otlplog/otlploghttp/exporter_test.go | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 exporters/otlp/otlplog/otlploghttp/exporter_test.go diff --git a/exporters/otlp/otlplog/otlploghttp/exporter.go b/exporters/otlp/otlplog/otlploghttp/exporter.go index 5ca9822a8ff..0757f001595 100644 --- a/exporters/otlp/otlplog/otlploghttp/exporter.go +++ b/exporters/otlp/otlplog/otlploghttp/exporter.go @@ -48,6 +48,5 @@ func (e *Exporter) Shutdown(ctx context.Context) error { // ForceFlush does nothing. The Exporter holds no state. func (e *Exporter) ForceFlush(ctx context.Context) error { - // TODO: implement. return nil } diff --git a/exporters/otlp/otlplog/otlploghttp/exporter_test.go b/exporters/otlp/otlplog/otlploghttp/exporter_test.go new file mode 100644 index 00000000000..c02a3343234 --- /dev/null +++ b/exporters/otlp/otlplog/otlploghttp/exporter_test.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlploghttp + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestExporterForceFlush(t *testing.T) { + ctx := context.Background() + e, err := New(ctx) + require.NoError(t, err, "New") + + assert.NoError(t, e.ForceFlush(ctx), "ForceFlush") +}