MemoryExporter implements Exporter
FinalYes
Exporter that stores telemetry batches in memory for direct access.
Useful for testing and inspection where you need direct access to exported data without serialization.
Interfaces
- Exporter
- Interface for exporting telemetry signals to external systems.
Methods
- export() : bool
- Export a signal batch.
- logs() : array<string|int, LogEntry>
- metrics() : array<string|int, Metric>
- reset() : void
- shutdown() : void
- Shutdown the exporter and any owned transports.
- spans() : array<string|int, Span>
Methods
export()
Export a signal batch.
public
export(Signals $signal) : bool
Implementations dispatch on Signal::$type via match.
Parameters
- $signal : Signals
Return values
bool —True on success, false on failure
logs()
public
logs() : array<string|int, LogEntry>
Return values
array<string|int, LogEntry>metrics()
public
metrics() : array<string|int, Metric>
Return values
array<string|int, Metric>reset()
public
reset() : void
shutdown()
Shutdown the exporter and any owned transports.
public
shutdown() : void
Implementations MUST be idempotent and MUST NOT throw - runtime errors are routed through the configured error handler instead.
spans()
public
spans() : array<string|int, Span>