Skip to content

fix: Handle missing config in middleware when OTEL_SDK_DISABLED=true#2231

Open
hannahramadan wants to merge 1 commit intoopen-telemetry:mainfrom
hannahramadan:rack_handle_unconfiged_middleware
Open

fix: Handle missing config in middleware when OTEL_SDK_DISABLED=true#2231
hannahramadan wants to merge 1 commit intoopen-telemetry:mainfrom
hannahramadan:rack_handle_unconfiged_middleware

Conversation

@hannahramadan
Copy link
Copy Markdown
Member

When OTEL_SDK_DISABLED=true, the SDK skips configuration and Rack instrumentation's config is an empty hash. When attempting to access nil values, a NoMethodError was raised.

Instrumentation was already handling this scenario on line 19 and line 31, which use Array() for similar config values. That pattern was copied as the fix for this issue.

All three dup, old, and stable files were updated.

closes #2230

@hannahramadan hannahramadan changed the title fix: Handle unconfigured middleware when OTEL_SDK_DISABLED=true fix: Handle missing config in middleware when OTEL_SDK_DISABLED=true Apr 14, 2026
@arielvalentin
Copy link
Copy Markdown
Contributor

arielvalentin commented Apr 15, 2026

@hannahramadan is this not something that should be handled in Base?

Also, any chance that you could add some test coverage for this?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dup::TracerMiddleware crashes with NoMethodError: undefined method 'include?' for nil when OTEL_SDK_DISABLED=true

2 participants