Skip to content
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

Wrong import for "OTLPExporterNodeBase" #4794

Open
PurpleTape opened this issue Jun 15, 2024 · 11 comments · May be fixed by #5031
Open

Wrong import for "OTLPExporterNodeBase" #4794

PurpleTape opened this issue Jun 15, 2024 · 11 comments · May be fixed by #5031
Assignees
Labels
bug Something isn't working has:reproducer This bug/feature has a minimal reproducer provided pkg:exporter-metrics-otlp-proto pkg:otlp-exporter-base priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc

Comments

@PurpleTape
Copy link

What happened?

Actual Result

When I start the project, I get an import error:

✘ [ERROR] No matching export in "node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js" for import "OTLPExporterNodeBase"

    node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/esm/OTLPMetricExporter.js:44:77:
      44 │ import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, parseHeaders, OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
         ╵                                                                              ~~~~~~~~~~~~~~~~~~~~

Additional Details

OpenTelemetry Setup Code

No response

package.json

"@opentelemetry/api": "^1.9.0",
"@opentelemetry/exporter-metrics-otlp-proto": "^0.52.0",
"@opentelemetry/exporter-trace-otlp-proto": "^0.52.0",
"@opentelemetry/host-metrics": "^0.35.2",
"@opentelemetry/resources": "^1.25.0",
"@opentelemetry/sdk-metrics": "^1.25.0",
"@opentelemetry/sdk-node": "^0.52.0",
"@opentelemetry/semantic-conventions": "^1.25.0",

Relevant log output

No response

@PurpleTape PurpleTape added bug Something isn't working triage labels Jun 15, 2024
@pichlermarc
Copy link
Member

@PurpleTape thanks for reaching out. Are you bundling your app? If yes which bundler are you using?

I'd be very interested in a way to reproduce this. I think it's caused by the different named exports for Node.js and Browser we're using in that package and I'm currently working on eliminating those.

@pichlermarc pichlermarc added pkg:exporter-metrics-otlp-proto needs:reproducer This bug/feature is in need of a minimal reproducer labels Jun 18, 2024
@PurpleTape
Copy link
Author

Hello, @pichlermarc!

I have prepared a repository with a reproduction of the error. Inside the repository, you can find steps to reproduce the error. I also want to mention that I use Vite to build a backend, not a frontend

https://github.com/PurpleTape/open-telemetry-issue

@pichlermarc pichlermarc added has:reproducer This bug/feature has a minimal reproducer provided and removed needs:reproducer This bug/feature is in need of a minimal reproducer labels Jun 19, 2024
@pichlermarc
Copy link
Member

@PurpleTape thank you for providing the reproducer - I think the repro app does try to bundle it up for the browser, though. The proto-metrics exporter only supports node.js at the moment, see #4098. So I think it's fair to expect that this would not work at the moment.

Is there some extra config that you're using to build your backend app with vite? AFAIK there's usually some extra plugins involved in such a build, right?

@PurpleTape
Copy link
Author

@pichlermarc, yes, you're right! I used additional Vite plugins for backend development. Most likely, the current level of development of Vite tools is not enough for stable backend development and I need to choose other tools.

If you are interested, I have updated the repository, bringing it to the form in which backend development is carried out

@pichlermarc pichlermarc self-assigned this Jun 19, 2024
@JamieDanielson
Copy link
Member

@pichlermarc have you had a chance to look at this to determine the priority level, whether it is a bug? Just looking at how best to label it and triage it for now.

@pichlermarc
Copy link
Member

pichlermarc commented Jul 30, 2024

@pichlermarc have you had a chance to look at this to determine the priority level, whether it is a bug? Just looking at how best to label it and triage it for now.

@JamieDanielson it is a bug that has a few different layers to it. It's the good old ESM/CJS dual-export issue (#4743) + wrong export naming (differently named exports for nodejs and browser). Once we fix the naming (this will be done via the work I'm doing on #4116), then this issue here will become a duplicate of #3989.

As it causes compile and likely runtime issues, and there are currently no workarounds, I'll label this as P1.

@pichlermarc pichlermarc added priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc and removed triage labels Jul 30, 2024
@sebastien-comeau
Copy link

What's the status of this issue? Still an issue for me. Thanks

@pichlermarc
Copy link
Member

@sebastien-comeau I moved a lot of the transport code, which was step 1. Now I need to do the same with the config (step 2, currently in progress). Once I'm done with that we can collapse all the exporter base code into all platform agnostic types (step 3).

I'm aiming for this to land in 0.55.0.

@sebastien-comeau
Copy link

sebastien-comeau commented Sep 10, 2024

@pichlermarc nice to hear. What's the ETA for version 0.55.0?

@pichlermarc
Copy link
Member

@sebastien-comeau sometime in the first week of october.

@pichlermarc
Copy link
Member

I'm sorry, this has been delayed. #5031 is currently in draft and is expected to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has:reproducer This bug/feature has a minimal reproducer provided pkg:exporter-metrics-otlp-proto pkg:otlp-exporter-base priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants