diff --git a/SampleApp/config/services.yaml b/SampleApp/config/services.yaml index 2d6a76f..77aee4e 100644 --- a/SampleApp/config/services.yaml +++ b/SampleApp/config/services.yaml @@ -20,5 +20,9 @@ services: - '../src/Entity/' - '../src/Kernel.php' + App\Controller\: + resource: '../src/Controller' + tags: ['controller.service_arguments'] + # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones diff --git a/SampleApp/src/Controller/AwsSdkInstrumentationController.php b/SampleApp/src/Controller/AwsSdkInstrumentationController.php index 4dc4bfd..e7d44a6 100644 --- a/SampleApp/src/Controller/AwsSdkInstrumentationController.php +++ b/SampleApp/src/Controller/AwsSdkInstrumentationController.php @@ -5,7 +5,8 @@ use Aws\S3\S3Client; use OpenTelemetry\API\Trace\SpanKind; -use OpenTelemetry\API\Common\Signal\Signals; +use OpenTelemetry\API\Signals; +use OpenTelemetry\API\LoggerHolder; use OpenTelemetry\Contrib\Otlp\OtlpUtil; use OpenTelemetry\Contrib\Otlp\SpanExporter; @@ -24,7 +25,12 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; -\OpenTelemetry\API\Common\Log\LoggerHolder::set(new \Monolog\Logger('grpc', [new \Monolog\Handler\StreamHandler('php://stderr')])); +use Monolog\Handler\StreamHandler; +use Monolog\Logger; + +LoggerHolder::set( + new Logger('grpc', [new StreamHandler('php://stderr')]) +); class AwsSdkInstrumentationController {