Invalid enum `OTEL_*` values abort initialization instead of falling back
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- observability
Research direction
The payload names no files, so start by finding where OTEL_TRACES_SAMPLER is read from the environment and where the Unknown sampler error is thrown. Run the reproduction command from the issue with the autoload flag set. Done means an unrecognized enum value logs a warning and the SDK falls back to the default sampler, with the invalid value covered by a test.
Written by the indexing model from the issue text.
Description
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#enum
For sources accepting an enum value, if the user provides a value the implementation does not recognize, the implementation MUST generate a warning and gracefully ignore the setting.
Steps to reproduce
OTEL_PHP_AUTOLOAD_ENABLED=true OTEL_TRACES_SAMPLER=not-a-sampler php -r 'require "vendor/autoload.php"; \OpenTelemetry\API\Globals::tracerProvider();'
What is the expected behavior?
The invalid setting is gracefully ignored, the SDK is initialized with the default value.
What is the actual behavior?
OpenTelemetry: [warning] Error during opentelemetry initialization: Unknown sampler: not-a-sampler
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
- Dominant language
- PHP
- Stars
- 923
- Forks
- 234
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 35
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-php
-
[opentelemetry-php-contrib] laravel: queue hooks fail with sem-conv 1.45 (undefined MessagingIncubatingAttributes::MESSAGING_SYSTEM)Possibly taken @gowtham-padala claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
open-telemetry/opentelemetry-php#2139 ·
Maintainers usually reply within 1 day
-
Invalid numeric `OTEL_*` values abort initialization instead of falling backPossibly taken @gowtham-padala claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-php#2136 ·
Maintainers usually reply within 1 day
-
Requiring sdk package with Slim framework breaks PSR7 detectionPossibly taken @cjones-vultr claimed this 34 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-php#2078 · 1 comment ·
Maintainers usually reply within 1 day
-
bite sized help wanted
Difficulty 1/5 Under an hour Newbie friendliness 68/100
open-telemetry/opentelemetry-php#1902 · 1 comment · 3 reactions ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 56/100
open-telemetry/opentelemetry-php#2143 ·
Maintainers usually reply within 1 day
All issues in open-telemetry/opentelemetry-php
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Icinga/icinga-notifications-web#653 ·
Maintainers usually reply within 1 day
-
MCP Bundle
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
15.0
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vimeo/psalm#14139 · 1 comment ·
Maintainers usually reply within 2 days
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day