Rename Ruby Modules #1531
Replies: 3 comments 3 replies
-
As an end user and contributor, I often get frustrated and/or lost while navigating the source while trying to track down unexpected behavior, improve/update tracing semantics, etc… I also feel the occasional friction of the verbose As an end user, I also foresee the pain in migrating our extensive usage of these libs. I understand the problems and the tradeoffs we'd be making in removing the extra, unnecessary module. And in changing the organizational structure to make room for the coming OTel I've not formed an opinion on the "best" way to organize (though I think either |
Beta Was this translation helpful? Give feedback.
-
I can honestly say that as the company with by far the greatest experience using and contributing to OpenTelemetry Ruby, we have never found the length of the I don't believe the module name is a pain point for instrumentation either, however I can see that the instrumentation scope name could reasonably be shortened. Arguably, that change might be more difficult to navigate for some, since it affects backends (e.g. saved searches, dashboards, etc.), but I don't think it'd be a problem for our users. The Instrumentation module nesting can also be discussed in https://github.com/open-telemetry/opentelemetry-ruby-contrib. I can see the value in removing the last level of nesting ( |
Beta Was this translation helpful? Give feedback.
-
As a point of comparison, here's an instrumentation scope name from OpenTelemetry Go: const instrumentationName = "go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron" |
Beta Was this translation helpful? Give feedback.
-
TL;DR
Rename existing
OpenTelemetry
libraries to a shorter namespaceOTel
and remove redundant submodules in instrumentation gems. This will reduce overhead for the application being instrumented as well as reduce friction for users and maintainers who use the gems.Background
Our end users at GitHub find it difficult to leverage Instrumentation Scope Names in our backends, navigate the source code, and review backtraces due to the verbose nature of our module namespaces.
I have found that this has resulted in our users being less likely to contribute fixes upstream and requires our o11y team to add transformations to rename verbose instrumentation scopes in order to make it simpler for our users to query for attributes in our backend.
Proposal
The existing
OpenTelemetry
module names are quite verbose and often are difficult to navigate when attempting to reference in code or configurations.DSL Changes
The example below demonstrates taken from our documentation1 demonstrates the minimal example of how to configure the SDK with selective instrumentations:
Using terse namespaces will make the code succinct without losing any features in domain specific language API:
Something else to consider is that the DSL is not accounting for is the configurations for metrics and logs. Proposing this change may also mean making the DSL more verbose to account for what we are configuring in the SDK
Taking into account that trace configurations it may resemble the DD Trace DSL a bit more closely:
Instrumentation Namespaces
The current namespaces for instrumentations have an additional submodule without providing any additional benefit. In cases where one has to refer to an instance of an instrumentation the code may resemble the following:
Compared to when using more succinct namespaces, one could then interrogate the instrumentation singleton like this:
Instrumentation Scope
Choosing a succinct namespace is related to a conversation we had during the SIG to renaming Instrumentation Scope names, which default to the module name.
During that conversation I proposed reducing the Instrumentation Scope name to a more minimal name
otel.<instrumented library name>
, e.g. instead of having to search for or use verbose names when searching for traces like thisinstrumentation.scope: OpenTelemetry::Instrumentation::Faraday
one could useinstrumentation.scope: otel.faraday
instead.Thought it will have a minimal impact on performance, this change would reduce the size of an exporter batch by a minimum of 27 bytes per instrumentation (assuming rate/second it would be around ~2.33 MB per day per instrumentation).
Migration plan
End users will no doubt experience disruption when working with new namespaces.
We may be able to mitigate this by creating existing constants that reference the renamed less verbose namespaces:
This breaks down in cases where we remove redundant namespaces in instrumentations:
For this reason I would like to consider this a breaking change that result in breaking changes and require our end users to adopt new namespaces and gems that are not guaranteed to be interoperable with each other.
Footnotes
https://opentelemetry.io/docs/instrumentation/ruby/automatic/ ↩
Beta Was this translation helpful? Give feedback.
All reactions