You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❌ Patch coverage is 20.59621% with 293 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.95%. Comparing base (fe8f427) to head (7f00e3b). ⚠️ Report is 2 commits behind head on main.
…ders
- honour `tls.insecure` in the OTLP gRPC component providers by prepending
a scheme to scheme-less endpoints, which is how GrpcTransportFactory
selects secure vs insecure channel credentials
- extract the shared scheme/insecure logic into OtlpUtil::applyScheme(),
replacing the copy in each of the three env-based exporter factories
- log unknown providers at warning, not info, per the configuration spec's
"warn and skip" behaviour
`log_level` is recorded on SdkBuilder at parse time and applied to the
internal logger only by buildAndRegisterGlobal(), so parsing a config file
no longer mutates process-global logging state.
Adds Severity::fromName() and Severity::toPsr3(): the config enum uses OTel
severity names but the internal logger is PSR-3, and Logging::level('warn')
silently falls back to 'info', so the setting needs mapping rather than
passing through. The spec's example mappings pin only some cases; the rest
map to the nearest pinned case at or below them, which keeps the mapping
monotonic for use as a threshold.
Extend the IgnoresUnknownProviders opt-in from componentMap to componentList
and set it on `detectors`, so an unrecognised detector warns and is skipped
instead of failing startup. Skipped prototype entries finalize to null and are
filtered out of the list, leaving the remaining detectors to run.
Resource detectors are the only component the spec marks "warn and skip";
tests cover both that and a span processor still erroring.
Unknown providers were warned about during parsing, through the global
LogsMessagesTrait, so a configured log_level could never apply: it is not set
globally until buildAndRegisterGlobal(), long after parsing.
Skipped entries now resolve to a SkippedComponentPlugin which warns through
Context::$logger when created, and consumers filter the resulting nulls.
OpenTelemetrySdk::createPlugin() binds a ConfiguredLogger carrying the
configured level, so the warning is filtered without touching global state.
Adds Context::withLogger(); the default logger changes from NullLogger to a
ConfiguredLogger deferring to the global level, so unconfigured runs still warn.
File format 1.0 spells the metrics temporality enum `low_memory`; the
declarative config providers accepted `lowmemory`, rejecting schema-valid
configuration. The env-var path keeps `lowmemory`, which matches the env spec.
Also fixes examples/load_config_env.yaml, whose flow-list propagator was not
the component-map form 1.0 requires, and corrects three references to a
nonexistent ConfigurationTest::knownParseFailures().
The 1.0 schema defines log_level's default as INFO, but defaultNull() leaves the builder unset and therefore lets OTEL_LOG_LEVEL control a declaratively configured SDK. Since ambient environment variables are ignored unless explicitly substituted, an omitted or null log_level must resolve to info.
Restore logging state when SDK registration scope detaches or fails
src/SDK/SdkBuilder.php:140
This mutates process-global logging outside the lifetime of the returned registration scope. After a nested/global SDK scope is detached, providers revert to the previous context but the newer SDK's threshold remains, and a failed registration also leaks it. Restore the previous logging state when the returned scope detaches (and on failure), so the level has the same lifetime as the global registration.
The reason will be displayed to describe this comment to others. Learn more.
Overall this PR looks good to me, but I think we should resolve at least the four issues below before releasing 1.0. Additionally we should include .instrumentation in \OpenTelemetry\Config\SDK\Configuration and deprecate \OpenTelemetry\Config\SDK\Instrumentation (which would resolve 3.).
AI-assisted review, most relevant untracked TODOs:
(21 of the file-config failures are related to file_format1.0->1.2 changes and can be ignored.)
#
Insert at
TODO text
Tests
1
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php:693-700 (enumNode('instrument_type')->values([...])), the match at :301, docblock :165
TODO v1.0.0 InstrumentType includes "gauge" (synchronous gauge); missing here
1
2
array_column($properties['headers'], 'value', 'name') in all 6 OTLP providers (MetricExporterOtlpHttp.php:48, MetricExporterOtlpGrpc.php:53, SpanExporterOtlpHttp.php:45, SpanExporterOtlpGrpc.php:49, LogRecordExporterOtlpHttp.php:45, LogRecordExporterOtlpGrpc.php:49)
TODO a headers entry with a null value must be ignored (v1.0.0: "If an entry's .value is null, the entry is ignored"). The schema accepts it (scalarNode('value')->defaultNull() + Validation::ensureString() skips null) and array_column() keeps it, so it reaches PsrTransport::send() -> nyholm/psr7 MessageTrait::validateAndTrimHeader() -> fatal "Header values must be RFC 7230 compatible strings" (exit 255)
1
3
src/SDK/SdkAutoloader.php:178
TODO a missing OTEL_CONFIG_FILE must be reported as an initialization error, not an uncaught FileLocatorFileNotFoundException (exit 255)
1
4
OpenTelemetrySdk.php:422, 451 (meterProvider passed to tracer/logger providers)
TODO self-observability metrics should be opt-in, not always-on in config mode
Covers 5 of 6 suggested fixes from the copilot and Nevay: gauge in the view
selector enum, null-valued headers, opt-in self-observability, the
schema log_level default, and restoring the log level on detach.
addressed remaining feedback, except for a missing OTEL_CONFIG_FILE must be reported as an initialization error, not an uncaught FileLocatorFileNotFoundException (exit 255) - that requires a small code restructure so I'll do that in a follow-up PR
Each split package gets a CHANGELOG.md in the format the
sdk-configuration changelog already uses. The Unreleased section
covers everything since the package's latest tag, so the api 1.11
and sdk 1.16 releases have notes ready, and earlier releases link to
the package's GitHub releases.
CONTRIBUTING.md and AGENTS.md ask for an entry when a change affects
a package's users. A new Changelog workflow runs script/check_changelog.sh
on pull requests and flags packages that changed without a changelog entry.
The skip-changelog label turns it off for changes users won't notice.
sdk now requires api ^1.11. It has called Logging::setLogLevel()
since #2068, which api 1.10 doesn't have.
Assisted-By: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
script/config-snippetsto sync upstream snippets and example yaml into our repoAssisted-By: Claude Opus 4.5