fix(grape): detect code namespace for API instance endpoints#2407
Merged
kaylareopelle merged 1 commit intoJul 9, 2026
Merged
Conversation
bdewater-thatch
requested review from
a team,
arielvalentin,
dazuma,
hannahramadan,
kaylareopelle,
robbkidd,
simi,
thompson-tomo and
xuan-cao-swi
as code owners
June 17, 2026 18:13
Direct Grape::API::Instance subclasses expose endpoint.options[:for] as the endpoint class itself rather than a generated mount instance with @base set. The previous instrumentation only read @base, which produced nil and caused the SDK to log invalid code.namespace attribute value errors. Fall back to the owner class name and omit code.namespace when no namespace can be derived.
bdewater-thatch
force-pushed
the
fix-grape-code-namespace-for-instance-api
branch
from
June 17, 2026 18:14
3b10d39 to
fe96ae7
Compare
simi
approved these changes
Jun 17, 2026
kaylareopelle
approved these changes
Jul 9, 2026
kaylareopelle
left a comment
Contributor
There was a problem hiding this comment.
Thank you, @bdewater-thatch!
Merged
via the queue into
open-telemetry:main
with commit Jul 9, 2026
969a3e6
52 of 53 checks passed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Direct
Grape::API::Instancesubclasses exposeendpoint.options[:for]as the endpoint class itself rather than a generated mount instance with@baseset. The previous instrumentation only read@base, which produced nil and caused the SDK to log invalidcode.namespaceattribute value errors.We're subclassing
Grape::API::Instancedirectly because we're using Sorbet in our Rails app, with ourgrape_sorbetgem for the signatures. The reason it works this way is documented here: https://github.com/thatch-health/grape_sorbet#subclassing-from-grapeapiinstance-instead-of-grapeapi