diff --git a/StdoutLogsExporterFactory.php b/StdoutLogsExporterFactory.php new file mode 100644 index 0000000..d39c71e --- /dev/null +++ b/StdoutLogsExporterFactory.php @@ -0,0 +1,19 @@ +create('php://stdout', ContentTypes::NDJSON); + + return new LogsExporter($transport); + } +} diff --git a/StdoutMetricExporterFactory.php b/StdoutMetricExporterFactory.php new file mode 100644 index 0000000..3eeba09 --- /dev/null +++ b/StdoutMetricExporterFactory.php @@ -0,0 +1,19 @@ +create('php://stdout', ContentTypes::NDJSON); + + return new MetricExporter($transport); + } +} diff --git a/StdoutSpanExporterFactory.php b/StdoutSpanExporterFactory.php new file mode 100644 index 0000000..d51cbaa --- /dev/null +++ b/StdoutSpanExporterFactory.php @@ -0,0 +1,19 @@ +create('php://stdout', ContentTypes::NDJSON); + + return new SpanExporter($transport); + } +} diff --git a/_register.php b/_register.php index b3acdc3..5f9d15a 100644 --- a/_register.php +++ b/_register.php @@ -2,8 +2,12 @@ declare(strict_types=1); \OpenTelemetry\SDK\Registry::registerSpanExporterFactory('otlp', \OpenTelemetry\Contrib\Otlp\SpanExporterFactory::class); +\OpenTelemetry\SDK\Registry::registerSpanExporterFactory('otlp/stdout', \OpenTelemetry\Contrib\Otlp\StdoutSpanExporterFactory::class); + \OpenTelemetry\SDK\Registry::registerMetricExporterFactory('otlp', \OpenTelemetry\Contrib\Otlp\MetricExporterFactory::class); +\OpenTelemetry\SDK\Registry::registerMetricExporterFactory('otlp/stdout', \OpenTelemetry\Contrib\Otlp\StdoutMetricExporterFactory::class); \OpenTelemetry\SDK\Registry::registerTransportFactory('http', \OpenTelemetry\Contrib\Otlp\OtlpHttpTransportFactory::class); \OpenTelemetry\SDK\Registry::registerLogRecordExporterFactory('otlp', \OpenTelemetry\Contrib\Otlp\LogsExporterFactory::class); +\OpenTelemetry\SDK\Registry::registerLogRecordExporterFactory('otlp/stdout', \OpenTelemetry\Contrib\Otlp\StdoutLogsExporterFactory::class);