Skip to content

Do not depend on function names for instrumentation #2522

@drewcorlin1

Description

@drewcorlin1

What version of OpenTelemetry are you using?

  • @opentelemetry/api@1.8.0
  • @opentelemetry/auto-instrumentations-node@0.50.2

What version of Node are you using?

20

What did you do?

I am working on an esbuild plugin version of this library and noticed that the @opentelemetry/instrumentation-redis-4 package relies on the function name of classes. This can break when code is bundled due to bundlers renaming symbols.

It's worth noting that with esbuild there is a workaround, to use keepNames, but this a lot of diving into the instrumentation source code to discover the cause of the issue.

I know that feature is not merged, but based on the comments there seems to be demand for it, so relying on function names will be potentially problematic for any bundler-based instrumentations of this library.

Update (trentm): #2915 moved the instr-redis-4 code into the instr-redis package. The new relevant code link is now:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpkg:instrumentation-redispriority:p4Bugs and spec inconsistencies which do not fall into a higher prioritization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions