Closed lifinsky closed 6 days ago
services:
...
OpenTelemetry\API\Trace\TracerProviderInterface:
class: 'OpenTelemetry\API\Globals'
factory: [ 'OpenTelemetry\API\Globals', 'tracerProvider' ]
#[ServiceContext]
public function traceConfiguration(): TracingConfiguration
{
return TracingConfiguration::createWithDefaults()
->withForceFlushOnBusExecution(false)
->withForceFlushOnAsynchronousMessageHandled(false)
;
}
@jlabedo are you able to take a look on this?
Should we replace LoggerInterface to LoggingGateway?
@lifinsky the error is mentioning a "prehook" from opentelemetry, are you using the opentelemetry php extension (opentelemetry.so) ?
@lifinsky the error is mentioning a "prehook" from opentelemetry, are you using the opentelemetry php extension (opentelemetry.so) ?
yes, opentelemetry extension
php --re opentelemetry | head -1
Extension [ <persistent> extension #40 opentelemetry version 1.1.0 ]
"open-telemetry/api": "^1.0",
"open-telemetry/context": "^1.0",
"open-telemetry/exporter-otlp": "^1.0",
"open-telemetry/opentelemetry-auto-guzzle": "^0.0.2",
"open-telemetry/opentelemetry-auto-pdo": "^0.0.12",
"open-telemetry/opentelemetry-auto-psr3": "^0.0.6",
"open-telemetry/opentelemetry-auto-psr15": "^1.0",
"open-telemetry/opentelemetry-auto-psr18": "^1.0",
"open-telemetry/opentelemetry-auto-symfony": "^1.0@beta",
"open-telemetry/opentelemetry-logger-monolog": "^1.0",
"open-telemetry/sdk": "^1.0",
"open-telemetry/transport-grpc": "^1.0",
First, I think it is redundant to use open-telemetry/opentelemetry-auto-psr3
and open-telemetry/opentelemetry-logger-monolog
at the same time.
Then, I think it is an issue with open-telemetry/opentelemetry-auto-psr3 that does not check the value of the params passed to the logger interface. Ecotone Logging gateway extends the PSR 3 Logger Interface, enabling it to pass GenericMessage or an array, this is valid for me.
Moreover, the logging gateway is already passing events to opentelemetry, so you may have some double events here if you use open-telemetry/opentelemetry-auto-psr3 and ecotone opentelemetry package
Here is the problematic extended interface:
interface LoggingGateway extends LoggerInterface
{
public function info(Stringable|string $message, array|Message|null $context = [], array $additionalContext = []): void;
public function error(Stringable|string $message, array|Message|null $context = [], array $additionalContext = []): void;
public function critical(Stringable|string $message, array|Message|null $context = [], array $additionalContext = []): void;
}
PS: Does not relate to the issue but I did get very bad performance issues with opentelemetry auto instrumentation with opentelemetry extension (it does some magic), please let me know if you have good results.
@jlabedo Thanks, after removing "opentelemetry-auto-psr3" everything works. What else do you think is superfluous in auto instrumentations?
@jlabedo Thanks, after removing "opentelemetry-auto-psr3" everything works. What else do you think is superfluous in auto instrumentations?
Nothing superfluous to me. Let me know if you have any other issue.
Ecotone version(s) affected: 1.231.0-latest
Description
Warning: Ecotone\Messaging\Handler\Logger\LoggingService::log(): OpenTelemetry: pre hook threw exception, class=Ecotone\Messaging\Handler\Logger\LoggingService function=log message=Cannot use object of type Ecotone\Messaging\Support\GenericMessage as array in Unknown on line 0
How to reproduce
When using OpenTelemetry in consumers (ecotone run), Symfony framework with Monolog
Context