<?php

declare(strict_types=1);

namespace Drupal\native_observability_otel\Plugin\NativeObservabilityExporter;

use Drupal\Component\Plugin\PluginInspectionInterface;

/**
 * Defines the exporter plugin interface.
 */
interface ExporterInterface extends PluginInspectionInterface {

  /**
   * Returns the human-readable label.
   */
  public function getLabel(): string;

  /**
   * Returns the exporter description.
   */
  public function getDescription(): string;

  /**
   * Returns whether the exporter is available in the current environment.
   */
  public function isAvailable(): bool;

  /**
   * Exports trace data.
   *
   * @param array $payload
   *   The normalized observability payload.
   *
   * @return bool
   *   TRUE on success, FALSE on failure.
   */
  public function export(array $payload): bool;

}
