open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
686 stars 170 forks source link

OpenTelemetry: [warning] Invalid boolean value "1" interpreted as "false" for OTEL_PHP_AUTOLOAD_ENABLED in /app/vendor/open-telemetry/sdk/Common/Configuration/Configuration.php(65) #1311

Closed dkarlovi closed 1 month ago

dkarlovi commented 1 month ago

Steps to reproduce

Run with OTEL_PHP_AUTOLOAD_ENABLED=1.

What is the expected behavior?

Same as https://3v4l.org/HfF8P

What is the actual behavior?

Truthy value interpreted as falsy.

OpenTelemetry: [warning] Invalid boolean value "1" interpreted as "false" for OTEL_PHP_AUTOLOAD_ENABLED in /app/vendor/open-telemetry/sdk/Common/Configuration/Configuration.php(65)

Additional context

In k8s, the values passed to ConfigMap are all strings, you might have trouble passing true because the YAML parser will try to cast it to a boolean which then cannot be saved.

bobstrecansky commented 1 month ago

In the spec, only "true" and "false" are valid values.

https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#boolean-value

dkarlovi commented 1 month ago

Ah, I'd say that's a weird choice, but since it's explicitly in the spec, let's not fuss over it. :+1: