-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supporting non-otel instrs in OTEL_NODE_{DIS,EN}ABLED_INSTRUMENTATIONS #481
Comments
@david-luna Thoughts? |
Hi IMHO the fact that we have short names in export OTEL_NODE_ENABLED_INSTRUMENTATIONS=http,mysql,foo In this line above what exactly id @trentm for that reason I think your proposal of having a full name of the instrumentation is better than considering any other way of shortening the names. What I'm not so sure is about mixing short names with full ones in the same envvar. I think this might make the logic more complex and have to try a couple of imports to get the instrumentation registered. In the
Having it separately would imply to lookup for another var but load process would be straightforward in both cases.
I think you're right and I picture it in a similar way. There will be a new envvar pointing to the instrumentations the SDK has to load. |
I'd like to avoid having two separate envvars ( Basically, then
We could limit the support For future work, I keep coming back to the Java mechanism mentioned above: |
David and I talked: decided for GA just do the simple (1.) case described in the last comment. For now we will not look at the |
intro
OTEL_NODE_DISABLED_INSTRUMENTATIONS
andOTEL_NODE_ENABLED_INSTRUMENTATIONS
are envvars supported by@opentelemetry/auto-instrumentations-node
. They are also supported by EDOT Node.js. E.g.:Currently the strings are mapped to
@opentelemetry/instrumentation-SHORTNAME
and checked against a hardcode list of known instrumentations. That list provides the mapping from an instr package (import path) to the export name of the Instrumentation class to use. E.g.:Some things that might be nice to add to this:
@opentelemetry/instrumentation-SHORTNAME
, e.g.@elastic/opentelemetry-instrumentation-openai
.fs
instrumentation was dropped from the default set. So if a user wants to get it back, they need to list 'fs' and every other instrumentation.This issue proposes to handle just (1.) for now. However, the discussion will explore ideas for all three, because I don't want to propose a design that limits doing (2.) and (3.) later.
proposal
Also allow the full entry-point in the envvar, e.g.:
This is long-winded, but unambiguous.
I didn't want to use
openai
as the shortname used by Elastic's distro, because if upstream OTel JS contrib gets aninstrumentation-openai
, then theopenai
shortname would be ambiguous.also considered:
@NAMESPACE/SHORTNAME
I also considered support a shortform for non-
@opentelemetry
instrumentations: map@NAMESPACE/SHORTNAME
to@NAMESPACE/opentelemetry-instrumentation-SHORTNAME
. This would allow:An assumed-common naming pattern for non-OTel-provided instrumentation packages is:
@NAMESPACE/opentelemetry-instrumentation-SHORTNAME
, e.g.: (npmjs query: https://www.npmjs.com/search?q=opentelemetry-instrumentation&page=2&perPage=20)Some counter examples:
I think the naming pattern is fairly common, but I don't feel the gain of the slightly shorter name (
@NAMESPACE/SHORTNAME
) is worth having two ways to identify a package, and a way that isn't completely self-explanatory.digression on supporting unknown instrumentations
This is bullet (2.) above. The idea here is that I can say:
and the SDK will attempt to import
@somens/opentelemetry-instrumentation-foobar
at runtime; and further try to determine the exported name that is the appropriate Instrumentation class to use.Problems here:
@somens/opentelemetry-instrumentation-foobar.FooBarInstrumentation
. This could be workable, but is starting to get overloaded.OTEL_NODE_ENABLED_INSTRUMENTATIONS=rimraf
will dynamically load therimraf
package? That could be surprising.Ultimately I think this feature of "adding some external-to-the-SDK instrumentations" to the OTel setup is the job of a new OTel JS feature something like OTel Java's extensions: https://opentelemetry.io/docs/zero-code/java/agent/extensions/ That's a separate discussion.
OTel Java digression
Here are OTel Java's config options for selecting instrumentations: https://opentelemetry.io/docs/zero-code/java/agent/disable/#enable-only-specific-instrumentation
otel.instrumentation.common.default-enabled
otel.instrumentation.[name].enabled
That works for them because each built-in instrumentation has a
[name]
that works as a system property or envvar name. OTel JS doesn't. SettingOTEL_INSTRUMENTATION_@ELASTIC_OPENTELEMETRY_INSTRUMENTATION_OPENAI_ENABLED=true
doesn't really work.Digression on (3.)
I wonder about using a
+
prefix to allow saying "keep the default set, just add this one". I think that could work, but I'm not exploring that further for this issue.The text was updated successfully, but these errors were encountered: