Skip to content

feat: Add TelemetryConfiguration and Tracer/Logger options - #9573

Open
cy-yun wants to merge 1 commit into
googleapis:mainfrom
cy-yun:feat/observability-t1-config
Open

feat: Add TelemetryConfiguration and Tracer/Logger options#9573
cy-yun wants to merge 1 commit into
googleapis:mainfrom
cy-yun:feat/observability-t1-config

Conversation

@cy-yun

@cy-yun cy-yun commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

This PR implements Phase 1 Task 1 of the Client Libraries Observability v1 design.

Changes

  • Introduces TelemetryConfiguration in Google\Cloud\Core for 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 legacy GOOGLE_API_ENABLE_TELEMETRY).
  • Adds tracerProvider and loggerProvider configurations to ClientOptions in Google\ApiCore.
  • Ensures all telemetry remains strictly opt-in by default to prevent unexpected cardinality explosions or cost increases for users.

@cy-yun
cy-yun requested a review from a team as a code owner August 25, 2026 17:33
@cy-yun
cy-yun force-pushed the feat/observability-t1-config branch from 2a16e32 to 14bda98 Compare August 25, 2026 20:47
@cy-yun
cy-yun marked this pull request as draft August 25, 2026 21:04
@cy-yun
cy-yun force-pushed the feat/observability-t1-config branch 2 times, most recently from f5aa5eb to 92de944 Compare August 25, 2026 21:44
@cy-yun
cy-yun force-pushed the feat/observability-t1-config branch from 92de944 to 6c40ebc Compare August 25, 2026 21:44
@cy-yun
cy-yun marked this pull request as ready for review August 26, 2026 08:16
* A PSR-3 compliant logger.
* @type TracerProviderInterface|null $tracerProvider
* A tracer provider for OpenTelemetry.
* @type LoggerProviderInterface|null $loggerProvider

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants