feat: Add TelemetryConfiguration and Tracer/Logger options - #9573
Conversation
2a16e32 to
14bda98
Compare
f5aa5eb to
92de944
Compare
92de944 to
6c40ebc
Compare
| * A PSR-3 compliant logger. | ||
| * @type TracerProviderInterface|null $tracerProvider | ||
| * A tracer provider for OpenTelemetry. | ||
| * @type LoggerProviderInterface|null $loggerProvider |
There was a problem hiding this comment.
There does not seem to be any integration here with our existing PSR-3 compliant logger. I think this difference will be confusing to our customers (and also to me, I am confused as to what the difference is already!)
Libraries exist which serve as adapters between the two (see https://packagist.org/packages/open-telemetry/opentelemetry-logger-monolog). This may be a good way to support it in the short term. A more robust solution would be to do something similar to what we already have with HttpHandler, where we have a factory which builds our own adapter class, and so we can be confident that the methods we expect exist already.
I would like to see either 1) the practical difference between loggerProvider and logger explained in the description and variable name, OR 2) a way to bridge the two (preferred)
Description
This PR implements Phase 1 Task 1 of the Client Libraries Observability v1 design.
Changes
TelemetryConfigurationinGoogle\Cloud\Corefor securely parsing telemetry opt-in/opt-out configuration from environment variables (e.g.GOOGLE_SDK_PHP_TRACING_ENABLED,GOOGLE_SDK_PHP_LOGGING_ENABLED, and the legacyGOOGLE_API_ENABLE_TELEMETRY).tracerProviderandloggerProviderconfigurations toClientOptionsinGoogle\ApiCore.