The in-memory exporter stores data in a user provided memory buffer.
dotnet add package OpenTelemetry.Exporter.InMemory
var activityList = new List<Activity>();
var activityExporter = new InMemoryExporter<Activity>(activityList);
var logRecordList = new List<LogRecord>();
var logExporter = new InMemoryExporter<LogRecord>(logRecordList);