Repository: open-telemetry/opentelemetry-php (php)

Issue:
Change `SpanExporter::export()` result to `Success` or `Failure`
[Export()](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#exportbatch) defines only `Success` and `Failure`. The differentiation between `STATUS_FAILED_NOT_RETRYABLE` and `STATUS_FAILED_RETRYABLE` isn't useful to the caller as "retry logic is the responsibility of the exporter".

Pull request:
Change `SpanExporter::export()` return value to boolean
Resolves #796.

Patch:
diff --git a/src/Contrib/Jaeger/AgentExporter.php b/src/Contrib/Jaeger/AgentExporter.php
index 3ec80ea7..d3885f78 100644
--- a/src/Contrib/Jaeger/AgentExporter.php
+++ b/src/Contrib/Jaeger/AgentExporter.php
@@ -39,10 +39,7 @@ class AgentExporter implements SpanExporterInterface
         $this->jaegerTransport->close();
     }
 
-    /**
-     * @psalm-return SpanExporterInterface::STATUS_*
-     */
-    public function doExport(iterable $spans): int
+    public function doExport(iterable $spans): bool
     {
         // UDP Transport begins here after converting to thrift format span
         foreach ($spans as $span) {
@@ -52,7 +49,7 @@ class AgentExporter implements SpanExporterInterface
             );
         }
 
-        return SpanExporterInterface::STATUS_SUCCESS;
+        return true;
     }
 
     /** @inheritDoc */
diff --git a/src/Contrib/Jaeger/HttpCollectorExporter.php b/src/Contrib/Jaeger/HttpCollectorExporter.php
index 06da0b69..3ca6c040 100644
--- a/src/Contrib/Jaeger/HttpCollectorExporter.php
+++ b/src/Contrib/Jaeger/HttpCollectorExporter.php
@@ -39,14 +39,11 @@ class HttpCollectorExporter implements SpanExporterInterface
         );
     }
 
-    /**
-     * @psalm-return SpanExporterInterface::STATUS_*
-     */
-    public function doExport(iterable $spans): int
+    public function doExport(iterable $spans): bool
     {
         $this->sender->send($spans);
 
-        return SpanExporterInterface::STATUS_SUCCESS;
+        return true;
     }
 
     /** @inheritDoc */
diff --git a/src/Contrib/Newrelic/Exporter.php b/src/Contrib/Newrelic/Exporter.php
index 05b847e0..92a66da2 100644
--- a/src/Contrib/Newrelic/Exporter.php
+++ b/src/Contrib/Newrelic/Exporter.php
@@ -97,11 +97,11 @@ class Exporter implements SpanExporterInterface
     {
         return $this->transport
             ->send($this->serializeTrace($spans), 'application/json', $cancellation)
-            ->map(static fn (): int => 0)
-            ->catch(static function (Throwable $throwable): int {
+            ->map(static fn (): bool => true)
+            ->catch(static function (Throwable $throwable): bool {
                 self::logError('Export failure', ['exception' => $throwable]);
 
-                return 1;
+                return false;
             });
     }
 
diff --git a/src/Contrib/OtlpGrpc/Exporter.php b/src/Contrib/OtlpGrpc/Exporter.php
index 9bebd202..218ef0dc 100644
--- a/src/Contrib/OtlpGrpc/Exporter.php
+++ b/src/Contrib/OtlpGrpc/Exporter.php
@@ -105,7 +105,7 @@ class Exporter implements SpanExporterInterface
      * @inheritDoc
      * @psalm-suppress UndefinedConstant
      */
-    protected function doExport(iterable $spans): int
+    protected function doExport(iterable $spans): bool
     {
         $request = (new SpanConverter())->convert($spans);
 
@@ -120,7 +120,7 @@ class Exporter implements SpanExporterInterface
                     'error' => $response->getPartialSuccess()->getErrorMessage(),
                 ]);
 
-                return self::STATUS_FAILED_NOT_RETRYABLE;
+                return false;
             } elseif ($response->getPartialSuccess()->getErrorMessage()) {
                 self::logWarning('Export warning', ['server_message' => $response->getPartialSuccess()->getErrorMessage()]);
             }
@@ -129,7 +129,7 @@ class Exporter implements SpanExporterInterface
         if ($status->code === \Grpc\STATUS_OK) {
             self::logDebug('Exported span(s)', ['spans' => $request->getResourceSpans()]);
 
-            return self::STATUS_SUCCESS;
+            return true;
         }
 
         $error = [
@@ -150,12 +150,12 @@ class Exporter implements SpanExporterInterface
         ], true)) {
             self::logWarning('Retryable error exporting grpc span', ['error' => $error]);
 
-            return self::STATUS_FAILED_RETRYABLE;
+            return false;
         }
 
         self::logError('Error exporting grpc span', ['error' => $error]);
 
-        return self::STATUS_FAILED_NOT_RETRYABLE;
+        return false;
     }
 
     public function setHeader($key, $value): void
diff --git a/src/Contrib/OtlpHttp/Exporter.php b/src/Contrib/OtlpHttp/Exporter.php
index 4e7ef69e..64733f98 100644
--- a/src/Contrib/OtlpHttp/Exporter.php
+++ b/src/Contrib/OtlpHttp/Exporter.php
@@ -98,7 +98,7 @@ class Exporter implements SpanExporterInterface
     {
         return $this->transport
             ->send((new SpanConverter())->convert($spans)->serializeToString(), 'application/x-protobuf', $cancellation)
-            ->map(static function (string $payload): int {
+            ->map(static function (string $payload): bool {
                 $serviceResponse = new ExportTraceServiceResponse();
                 $serviceResponse->mergeFromString($payload);
 
@@ -109,18 +109,18 @@ class Exporter implements SpanExporterInterface
                         'error_message' => $partialSuccess->getErrorMessage(),
                     ]);
 
-                    return 1;
+                    return false;
                 }
                 if ($partialSuccess !== null && $partialSuccess->getErrorMessage()) {
                     self::logWarning('Export success with warnings/suggestions', ['error_message' => $partialSuccess->getErrorMessage()]);
                 }
 
-                return 0;
+                return true;
             })
-            ->catch(static function (Throwable $throwable): int {
+            ->catch(static function (Throwable $throwable): bool {
                 self::logError('Export failure', ['exception' => $throwable]);
 
-                return 1;
+                return false;
             });
     }
 
diff --git a/src/Contrib/Zipkin/Exporter.php b/src/Contrib/Zipkin/Exporter.php
index 6820e1c6..2507dc82 100644
--- a/src/Contrib/Zipkin/Exporter.php
+++ b/src/Contrib/Zipkin/Exporter.php
@@ -70,11 +70,11 @@ class Exporter implements SpanExporterInterface
     {
         return $this->transport
             ->send($this->serializeTrace($spans), 'application/json', $cancellation)
-            ->map(static fn (): int => 0)
-            ->catch(static function (Throwable $throwable): int {
+            ->map(static fn (): bool => true)
+            ->catch(static function (Throwable $throwable): bool {
                 self::logError('Export failure', ['exception' => $throwable]);
 
-                return 1;
+                return false;
             });
     }
 
diff --git a/src/Contrib/ZipkinToNewrelic/Exporter.php b/src/Contrib/ZipkinToNewrelic/Exporter.php
index 35207d12..af27c481 100644
--- a/src/Contrib/ZipkinToNewrelic/Exporter.php
+++ b/src/Contrib/ZipkinToNewrelic/Exporter.php
@@ -84,11 +84,11 @@ class Exporter implements SpanExporterInterface
     {
         return $this->transport
             ->send($this->serializeTrace($spans), 'application/json', $cancellation)
-            ->map(static fn (): int => 0)
-            ->catch(static function (Throwable $throwable): int {
+            ->map(static fn (): bool => true)
+            ->catch(static function (Throwable $throwable): bool {
                 self::logError('Export failure', ['exception' => $throwable]);
 
-                return 1;
+                return false;
             });
     }
 
diff --git a/src/SDK/Trace/Behavior/SpanExporterDecoratorTrait.php b/src/SDK/Trace/Behavior/SpanExporterDecoratorTrait.php
index dae7658a..9dd2fda5 100644
--- a/src/SDK/Trace/Behavior/SpanExporterDecoratorTrait.php
+++ b/src/SDK/Trace/Behavior/SpanExporterDecoratorTrait.php
@@ -15,20 +15,20 @@ trait SpanExporterDecoratorTrait
 
     /**
      * @param iterable<SpanDataInterface> $spans
-     * @return FutureInterface<int>
+     * @return FutureInterface<bool>
      */
     public function export(iterable $spans, ?CancellationInterface $cancellation = null): FutureInterface
     {
         $spans = $this->beforeExport($spans);
         $response = $this->decorated->export($spans, $cancellation);
-        $response->map(fn (int $result) => $this->afterExport($spans, $result));
+        $response->map(fn (bool $result) => $this->afterExport($spans, $result));
 
         return $response;
     }
 
     abstract protected function beforeExport(iterable $spans): iterable;
 
-    abstract protected function afterExport(iterable $spans, int $exporterResponse): void;
+    abstract protected function afterExport(iterable $spans, bool $exportSuccess): void;
 
     public function shutdown(?CancellationInterface $cancellation = null): bool
     {
diff --git a/src/SDK/Trace/Behavior/SpanExporterTrait.php b/src/SDK/Trace/Behavior/SpanExporterTrait.php
index af8ddb22..9d7bd10e 100644
--- a/src/SDK/Trace/Behavior/SpanExporterTrait.php
+++ b/src/SDK/Trace/Behavior/SpanExporterTrait.php
@@ -8,7 +8,6 @@ use OpenTelemetry\SDK\Common\Future\CancellationInterface;
 use OpenTelemetry\SDK\Common\Future\CompletedFuture;
 use OpenTelemetry\SDK\Common\Future\FutureInterface;
 use OpenTelemetry\SDK\Trace\SpanDataInterface;
-use OpenTelemetry\SDK\Trace\SpanExporterInterface;
 
 trait SpanExporterTrait
 {
@@ -32,12 +31,12 @@ trait SpanExporterTrait
 
     /**
      * @param iterable<SpanDataInterface> $spans
-     * @return FutureInterface<int>
+     * @return FutureInterface<bool>
      */
     public function export(iterable $spans, ?CancellationInterface $cancellation = null): FutureInterface
     {
         if (!$this->running) {
-            return new CompletedFuture(SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE);
+            return new CompletedFuture(false);
         }
 
         return new CompletedFuture($this->doExport($spans)); /** @phpstan-ignore-line */
@@ -45,8 +44,6 @@ trait SpanExporterTrait
 
     /**
      * @param iterable<SpanDataInterface> $spans Batch of spans to export
-     *
-     * @psalm-return SpanExporterInterface::STATUS_*
      */
-    abstract protected function doExport(iterable $spans): int; /** @phpstan-ignore-line */
+    abstract protected function doExport(iterable $spans): bool; /** @phpstan-ignore-line */
 }
diff --git a/src/SDK/Trace/SpanExporter/ConsoleSpanExporter.php b/src/SDK/Trace/SpanExporter/ConsoleSpanExporter.php
index fb2c1151..89cdc7aa 100644
--- a/src/SDK/Trace/SpanExporter/ConsoleSpanExporter.php
+++ b/src/SDK/Trace/SpanExporter/ConsoleSpanExporter.php
@@ -21,7 +21,7 @@ class ConsoleSpanExporter implements SpanExporterInterface
     }
 
     /** @inheritDoc */
-    public function doExport(iterable $spans): int
+    public function doExport(iterable $spans): bool
     {
         try {
             foreach ($spans as $span) {
@@ -32,10 +32,10 @@ class ConsoleSpanExporter implements SpanExporterInterface
                 );
             }
         } catch (Throwable $t) {
-            return SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE;
+            return false;
         }
 
-        return SpanExporterInterface::STATUS_SUCCESS;
+        return true;
     }
 
     public static function fromConnectionString(string $endpointUrl = null, string $name = null, $args = null)
diff --git a/src/SDK/Trace/SpanExporter/InMemoryExporter.php b/src/SDK/Trace/SpanExporter/InMemoryExporter.php
index c9874a43..87e144b0 100644
--- a/src/SDK/Trace/SpanExporter/InMemoryExporter.php
+++ b/src/SDK/Trace/SpanExporter/InMemoryExporter.php
@@ -24,13 +24,13 @@ class InMemoryExporter implements SpanExporterInterface
         return new self();
     }
 
-    protected function doExport(iterable $spans): int
+    protected function doExport(iterable $spans): bool
     {
         foreach ($spans as $span) {
             $this->storage[] = $span;
         }
 
-        return SpanExporterInterface::STATUS_SUCCESS;
+        return true;
     }
 
     public function getSpans(): array
diff --git a/src/SDK/Trace/SpanExporter/LoggerDecorator.php b/src/SDK/Trace/SpanExporter/LoggerDecorator.php
index 37c2d52c..8442fc5f 100644
--- a/src/SDK/Trace/SpanExporter/LoggerDecorator.php
+++ b/src/SDK/Trace/SpanExporter/LoggerDecorator.php
@@ -21,18 +21,6 @@ class LoggerDecorator implements SpanExporterInterface, LoggerAwareInterface
     use UsesSpanConverterTrait;
     use LoggerAwareTrait;
 
-    private const RESPONSE_MAPPING = [
-        SpanExporterInterface::STATUS_SUCCESS =>  LogLevel::INFO,
-        SpanExporterInterface::STATUS_FAILED_RETRYABLE =>  LogLevel::ERROR,
-        SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE =>  LogLevel::ALERT,
-    ];
-
-    private const MESSAGE_MAPPING = [
-        SpanExporterInterface::STATUS_SUCCESS =>  'Status Success',
-        SpanExporterInterface::STATUS_FAILED_RETRYABLE =>  'Status Failed Retryable',
-        SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE =>  'Status Failed Not Retryable',
-    ];
-
     public function __construct(
         SpanExporterInterface $decorated,
         ?LoggerInterface $logger = null,
@@ -57,14 +45,22 @@ class LoggerDecorator implements SpanExporterInterface, LoggerAwareInterface
 
     /**
      * @param iterable $spans
-     * @param int $exporterResponse
+     * @param bool $exportSuccess
      */
-    protected function afterExport(iterable $spans, int $exporterResponse): void
+    protected function afterExport(iterable $spans, bool $exportSuccess): void
     {
-        $this->log(
-            self::MESSAGE_MAPPING[$exporterResponse],
-            $this->getSpanConverter()->convert($spans),
-            self::RESPONSE_MAPPING[$exporterResponse]
-        );
+        if ($exportSuccess) {
+            $this->log(
+                'Status Success',
+                $this->getSpanConverter()->convert($spans),
+                LogLevel::INFO,
+            );
+        } else {
+            $this->log(
+                'Status Failed Retryable',
+                $this->getSpanConverter()->convert($spans),
+                LogLevel::ERROR,
+            );
+        }
     }
 }
diff --git a/src/SDK/Trace/SpanExporter/LoggerExporter.php b/src/SDK/Trace/SpanExporter/LoggerExporter.php
index 86959183..ddaaf14b 100644
--- a/src/SDK/Trace/SpanExporter/LoggerExporter.php
+++ b/src/SDK/Trace/SpanExporter/LoggerExporter.php
@@ -51,15 +51,15 @@ class LoggerExporter implements SpanExporterInterface, LoggerAwareInterface
     }
 
     /** @inheritDoc */
-    public function doExport(iterable $spans): int
+    public function doExport(iterable $spans): bool
     {
         try {
             $this->doLog($spans);
         } catch (Throwable $t) {
-            return SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE;
+            return false;
         }
 
-        return SpanExporterInterface::STATUS_SUCCESS;
+        return true;
     }
 
     /**
diff --git a/src/SDK/Trace/SpanExporterInterface.php b/src/SDK/Trace/SpanExporterInterface.php
index 05d15a23..c4d0d692 100644
--- a/src/SDK/Trace/SpanExporterInterface.php
+++ b/src/SDK/Trace/SpanExporterInterface.php
@@ -12,13 +12,6 @@ use OpenTelemetry\SDK\Common\Future\FutureInterface;
  */
 interface SpanExporterInterface
 {
-    /**
-     * Possible return values as outlined in the OpenTelemetry spec
-     */
-    public const STATUS_SUCCESS = 0;
-    public const STATUS_FAILED_NOT_RETRYABLE = 1;
-    public const STATUS_FAILED_RETRYABLE = 2;
-
     public static function fromConnectionString(string $endpointUrl, string $name, string $args);
 
     /**
@@ -26,7 +19,7 @@ interface SpanExporterInterface
      *
      * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#exportbatch
      *
-     * @psalm-return FutureInterface<int>
+     * @psalm-return FutureInterface<bool>
      */
     public function export(iterable $spans, ?CancellationInterface $cancellation = null): FutureInterface;
 


Test patch:
diff --git a/tests/Unit/Contrib/AbstractHttpExporterTest.php b/tests/Unit/Contrib/AbstractHttpExporterTest.php
index 6fab3489..43952d7d 100644
--- a/tests/Unit/Contrib/AbstractHttpExporterTest.php
+++ b/tests/Unit/Contrib/AbstractHttpExporterTest.php
@@ -49,24 +49,24 @@ abstract class AbstractHttpExporterTest extends AbstractExporterTest
             ->willReturn(new Response($responseStatus));
 
         $this->assertEquals(
-            min(1, $expected),
-            min(1, $this->createExporter()->export([
+            $expected,
+            $this->createExporter()->export([
                 $this->createMock(SpanData::class),
-            ])->await()),
+            ])->await(),
         );
     }
 
     public function exporterResponseStatusDataProvider(): array
     {
         return [
-            'ok'                => [200, SpanExporterInterface::STATUS_SUCCESS],
-            'not found'         => [404, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'not authorized'    => [401, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'bad request'       => [402, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'too many requests' => [429, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'server error'      => [500, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
-            'timeout'           => [503, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
-            'bad gateway'       => [502, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
+            'ok'                => [200, true],
+            'not found'         => [404, false],
+            'not authorized'    => [401, false],
+            'bad request'       => [402, false],
+            'too many requests' => [429, false],
+            'server error'      => [500, false],
+            'timeout'           => [503, false],
+            'bad gateway'       => [502, false],
         ];
     }
 
@@ -103,10 +103,10 @@ abstract class AbstractHttpExporterTest extends AbstractExporterTest
             ->willThrowException($exception);
 
         $this->assertEquals(
-            min(1, $expected),
-            min(1, $this->createExporter()->export([
+            $expected,
+            $this->createExporter()->export([
                 $this->createMock(SpanData::class),
-            ])->await()),
+            ])->await(),
         );
     }
 
@@ -115,15 +115,15 @@ abstract class AbstractHttpExporterTest extends AbstractExporterTest
         return [
             'client'    => [
                 $this->createMock(ClientExceptionInterface::class),
-                SpanExporterInterface::STATUS_FAILED_RETRYABLE,
+                false,
             ],
             'network'   => [
                 $this->createMock(NetworkExceptionInterface::class),
-                SpanExporterInterface::STATUS_FAILED_RETRYABLE,
+                false,
             ],
             'request'   => [
                 $this->createMock(RequestExceptionInterface::class),
-                SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE,
+                false,
             ],
         ];
     }
diff --git a/tests/Unit/Contrib/Jaeger/AgentExporterTest.php b/tests/Unit/Contrib/Jaeger/AgentExporterTest.php
index e0e8abfb..1d6f7347 100644
--- a/tests/Unit/Contrib/Jaeger/AgentExporterTest.php
+++ b/tests/Unit/Contrib/Jaeger/AgentExporterTest.php
@@ -5,7 +5,6 @@ declare(strict_types=1);
 namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
 
 use OpenTelemetry\Contrib\Jaeger\AgentExporter;
-use OpenTelemetry\SDK\Trace\SpanExporterInterface;
 use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
 use PHPUnit\Framework\TestCase;
 
@@ -26,7 +25,7 @@ class AgentExporterTest extends TestCase
 
         $status = $exporter->export([new SpanData()])->await();
 
-        $this->assertSame(SpanExporterInterface::STATUS_SUCCESS, $status);
+        $this->assertTrue($status);
 
         $exporter->closeAgentConnection();
     }
diff --git a/tests/Unit/Contrib/Jaeger/JaegerHttpCollectorExporterTest.php b/tests/Unit/Contrib/Jaeger/JaegerHttpCollectorExporterTest.php
index f8ea4e1c..59a4f383 100644
--- a/tests/Unit/Contrib/Jaeger/JaegerHttpCollectorExporterTest.php
+++ b/tests/Unit/Contrib/Jaeger/JaegerHttpCollectorExporterTest.php
@@ -5,7 +5,6 @@ declare(strict_types=1);
 namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
 
 use OpenTelemetry\Contrib\Jaeger\HttpCollectorExporter;
-use OpenTelemetry\SDK\Trace\SpanExporterInterface;
 use OpenTelemetry\Tests\Unit\Contrib\UsesHttpClientTrait;
 use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
 use PHPUnit\Framework\TestCase;
@@ -38,6 +37,6 @@ class JaegerHttpCollectorExporterTest extends TestCase
 
         $status = $exporter->export([new SpanData()])->await();
 
-        $this->assertSame(SpanExporterInterface::STATUS_SUCCESS, $status);
+        $this->assertTrue($status);
     }
 }
diff --git a/tests/Unit/Contrib/OtlpGrpc/OTLPGrpcExporterTest.php b/tests/Unit/Contrib/OtlpGrpc/OTLPGrpcExporterTest.php
index a1ea5a97..3fe9764b 100644
--- a/tests/Unit/Contrib/OtlpGrpc/OTLPGrpcExporterTest.php
+++ b/tests/Unit/Contrib/OtlpGrpc/OTLPGrpcExporterTest.php
@@ -63,7 +63,7 @@ class OTLPGrpcExporterTest extends AbstractExporterTest
 
         $exporterStatusCode = $exporter->export([new SpanData()])->await();
 
-        $this->assertSame(SpanExporterInterface::STATUS_SUCCESS, $exporterStatusCode);
+        $this->assertTrue($exporterStatusCode);
     }
 
     public function test_exporter_unexpected_grpc_response_status(): void
@@ -93,12 +93,12 @@ class OTLPGrpcExporterTest extends AbstractExporterTest
 
         $exporterStatusCode = $exporter->export([new SpanData()])->await();
 
-        $this->assertSame(SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE, $exporterStatusCode);
+        $this->assertFalse($exporterStatusCode);
     }
 
     public function test_exporter_grpc_responds_as_unavailable(): void
     {
-        $this->assertEquals(SpanExporterInterface::STATUS_FAILED_RETRYABLE, (new Exporter())->export([new SpanData()])->await());
+        $this->assertFalse((new Exporter())->export([new SpanData()])->await());
     }
 
     public function test_set_headers_with_environment_variables(): void
@@ -167,7 +167,7 @@ class OTLPGrpcExporterTest extends AbstractExporterTest
     /**
      * @dataProvider partialSuccessProvider
      */
-    public function test_partial_success(int $rejected, string $error, int $expectedStatusCode): void
+    public function test_partial_success(int $rejected, string $error, bool $expectedStatusCode): void
     {
         $exporter = new Exporter(
             'localhost:4317',
@@ -199,9 +199,9 @@ class OTLPGrpcExporterTest extends AbstractExporterTest
     public function partialSuccessProvider(): array
     {
         return [
-            'partial success with dropped' => [1, 'some.error.message', SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'partial success with no dropped and warning' => [0, 'some.warning.message', SpanExporterInterface::STATUS_SUCCESS],
-            'partial success with full success' => [0, '', SpanExporterInterface::STATUS_SUCCESS],
+            'partial success with dropped' => [1, 'some.error.message', false],
+            'partial success with no dropped and warning' => [0, 'some.warning.message', true],
+            'partial success with full success' => [0, '', true],
         ];
     }
 
diff --git a/tests/Unit/Contrib/OtlpHttp/OTLPHttpExporterTest.php b/tests/Unit/Contrib/OtlpHttp/OTLPHttpExporterTest.php
index 9b1c752c..086dc76d 100644
--- a/tests/Unit/Contrib/OtlpHttp/OTLPHttpExporterTest.php
+++ b/tests/Unit/Contrib/OtlpHttp/OTLPHttpExporterTest.php
@@ -60,7 +60,7 @@ class OTLPHttpExporterTest extends AbstractExporterTest
         $exporter = new Exporter(Exporter::createTransport(new PsrTransportFactory($client, new HttpFactory(), new HttpFactory())));
 
         $this->assertEquals(
-            min($expected, 1),
+            $expected,
             $exporter->export([new SpanData()])->await(),
         );
     }
@@ -68,14 +68,14 @@ class OTLPHttpExporterTest extends AbstractExporterTest
     public function exporterResponseStatusDataProvider(): array
     {
         return [
-            'ok'                => [200, SpanExporterInterface::STATUS_SUCCESS],
-            'not found'         => [404, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'not authorized'    => [401, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'bad request'       => [402, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'too many requests' => [429, SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE],
-            'server error'      => [500, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
-            'timeout'           => [503, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
-            'bad gateway'       => [502, SpanExporterInterface::STATUS_FAILED_RETRYABLE],
+            'ok'                => [200, true],
+            'not found'         => [404, false],
+            'not authorized'    => [401, false],
+            'bad request'       => [402, false],
+            'too many requests' => [429, false],
+            'server error'      => [500, false],
+            'timeout'           => [503, false],
+            'bad gateway'       => [502, false],
         ];
     }
 
@@ -101,11 +101,11 @@ class OTLPHttpExporterTest extends AbstractExporterTest
         return [
             'client'    => [
                 $this->createMock(ClientExceptionInterface::class),
-                SpanExporterInterface::STATUS_FAILED_RETRYABLE,
+                false,
             ],
             'network'   => [
                 $this->createMock(NetworkExceptionInterface::class),
-                SpanExporterInterface::STATUS_FAILED_RETRYABLE,
+                false,
             ],
         ];
     }
@@ -163,8 +163,7 @@ class OTLPHttpExporterTest extends AbstractExporterTest
         $client = $this->createMock(ClientInterface::class);
         $client->method('sendRequest')->willReturn(new Response(200));
 
-        $this->assertEquals(
-            SpanExporterInterface::STATUS_SUCCESS,
+        $this->assertTrue(
             (new Exporter(Exporter::createTransport(new PsrTransportFactory(
                 $client,
                 new HttpFactory(),
diff --git a/tests/Unit/SDK/Trace/SpanExporter/AbstractExporterTest.php b/tests/Unit/SDK/Trace/SpanExporter/AbstractExporterTest.php
index 6f43f6b0..2fc20687 100644
--- a/tests/Unit/SDK/Trace/SpanExporter/AbstractExporterTest.php
+++ b/tests/Unit/SDK/Trace/SpanExporter/AbstractExporterTest.php
@@ -38,6 +38,6 @@ abstract class AbstractExporterTest extends TestCase
         $span = $this->createMock(SpanData::class);
         $exporter->shutdown();
 
-        $this->assertSame(SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE, $exporter->export([$span])->await());
+        $this->assertFalse($exporter->export([$span])->await());
     }
 }
diff --git a/tests/Unit/SDK/Trace/SpanExporter/ConsoleSpanExporterTest.php b/tests/Unit/SDK/Trace/SpanExporter/ConsoleSpanExporterTest.php
index 960c4f40..50072055 100644
--- a/tests/Unit/SDK/Trace/SpanExporter/ConsoleSpanExporterTest.php
+++ b/tests/Unit/SDK/Trace/SpanExporter/ConsoleSpanExporterTest.php
@@ -7,7 +7,6 @@ namespace OpenTelemetry\Tests\Unit\SDK\Trace\SpanExporter;
 use OpenTelemetry\SDK\Trace\SpanConverterInterface;
 use OpenTelemetry\SDK\Trace\SpanDataInterface;
 use OpenTelemetry\SDK\Trace\SpanExporter\ConsoleSpanExporter;
-use OpenTelemetry\SDK\Trace\SpanExporterInterface;
 
 /**
  * @covers \OpenTelemetry\SDK\Trace\SpanExporter\ConsoleSpanExporter
@@ -60,8 +59,7 @@ class ConsoleSpanExporterTest extends AbstractExporterTest
 
         ob_start();
 
-        $this->assertSame(
-            SpanExporterInterface::STATUS_SUCCESS,
+        $this->assertTrue(
             (new ConsoleSpanExporter($converter))->export([
                 $this->createMock(SpanDataInterface::class),
             ])->await(),
@@ -80,8 +78,7 @@ class ConsoleSpanExporterTest extends AbstractExporterTest
 
         ob_start();
 
-        $this->assertSame(
-            SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE,
+        $this->assertFalse(
             (new ConsoleSpanExporter($converter))->export([
                 $this->createMock(SpanDataInterface::class),
             ])->await(),
diff --git a/tests/Unit/SDK/Trace/SpanExporter/LoggerDecoratorTest.php b/tests/Unit/SDK/Trace/SpanExporter/LoggerDecoratorTest.php
index e5c2499b..3c015169 100644
--- a/tests/Unit/SDK/Trace/SpanExporter/LoggerDecoratorTest.php
+++ b/tests/Unit/SDK/Trace/SpanExporter/LoggerDecoratorTest.php
@@ -67,7 +67,7 @@ class LoggerDecoratorTest extends AbstractLoggerAwareTest
         $this->getSpanExporterInterfaceMock()
             ->expects($this->once())
             ->method('export')
-            ->willReturn(new CompletedFuture(SpanExporterInterface::STATUS_SUCCESS));
+            ->willReturn(new CompletedFuture(true));
 
         $this->getLoggerInterfaceMock()
             ->expects($this->once())
@@ -85,12 +85,12 @@ class LoggerDecoratorTest extends AbstractLoggerAwareTest
      * @psalm-suppress PossiblyUndefinedMethod
      * @psalm-suppress PossiblyInvalidArgument
      */
-    public function test_export_failed_retryable(): void
+    public function test_export_failed(): void
     {
         $this->getSpanExporterInterfaceMock()
             ->expects($this->once())
             ->method('export')
-            ->willReturn(new CompletedFuture(SpanExporterInterface::STATUS_FAILED_RETRYABLE));
+            ->willReturn(new CompletedFuture(false));
 
         $this->getLoggerInterfaceMock()
             ->expects($this->once())
@@ -104,29 +104,6 @@ class LoggerDecoratorTest extends AbstractLoggerAwareTest
             ->await();
     }
 
-    /**
-     * @psalm-suppress PossiblyUndefinedMethod
-     * @psalm-suppress PossiblyInvalidArgument
-     */
-    public function test_export_failed_not_retryable(): void
-    {
-        $this->getSpanExporterInterfaceMock()
-            ->expects($this->once())
-            ->method('export')
-            ->willReturn(new CompletedFuture(SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE));
-
-        $this->getLoggerInterfaceMock()
-            ->expects($this->once())
-            ->method('log')
-            ->with(LogLevel::ALERT);
-
-        $this->createLoggerDecorator()
-            ->export(
-                $this->createSpanMocks()
-            )
-            ->await();
-    }
-
     /**
      * @return LoggerDecorator
      * @psalm-suppress PossiblyInvalidArgument
diff --git a/tests/Unit/SDK/Trace/SpanExporter/LoggerExporterTest.php b/tests/Unit/SDK/Trace/SpanExporter/LoggerExporterTest.php
index 6630c690..6da3fd30 100644
--- a/tests/Unit/SDK/Trace/SpanExporter/LoggerExporterTest.php
+++ b/tests/Unit/SDK/Trace/SpanExporter/LoggerExporterTest.php
@@ -6,7 +6,6 @@ namespace OpenTelemetry\Tests\Unit\SDK\Trace\SpanExporter;
 
 use Exception;
 use OpenTelemetry\SDK\Trace\SpanExporter\LoggerExporter;
-use OpenTelemetry\SDK\Trace\SpanExporterInterface;
 
 /**
  * @covers \OpenTelemetry\SDK\Trace\SpanExporter\LoggerExporter
@@ -47,8 +46,7 @@ class LoggerExporterTest extends AbstractExporterTest
             ->expects($this->once())
             ->method('log');
 
-        $this->assertSame(
-            SpanExporterInterface::STATUS_SUCCESS,
+        $this->assertTrue(
             $this->createLoggerExporter(LoggerExporter::GRANULARITY_AGGREGATE)
                 ->export(
                     $this->createSpanMocks()
@@ -69,8 +67,7 @@ class LoggerExporterTest extends AbstractExporterTest
             ->expects($this->exactly(count($spans)))
             ->method('log');
 
-        $this->assertSame(
-            SpanExporterInterface::STATUS_SUCCESS,
+        $this->assertTrue(
             $this->createLoggerExporter(LoggerExporter::GRANULARITY_SPAN)
                 ->export($spans)
                 ->await(),
@@ -87,8 +84,7 @@ class LoggerExporterTest extends AbstractExporterTest
             ->method('log')
             ->willThrowException(new Exception());
 
-        $this->assertSame(
-            SpanExporterInterface::STATUS_FAILED_NOT_RETRYABLE,
+        $this->assertFalse(
             $this->createLoggerExporter()
                 ->export(
                     $this->createSpanMocks()