GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Sentry Node.js ESM + OTEL instrumentation blockers - Part 2 · Issue #12485 · getsentry/sentry-javascript

Sentry Node.js ESM + OTEL instrumentation blockers - Part 2 #12485

New issue
Copy link
New issue
Copy link
Closed
Closed
Sentry Node.js ESM + OTEL instrumentation blockers - Part 2#12485
Copy link
Assignees
timfishAbhiPrasad
Labels
Package-Meta: OpenTelemetry
Milestone
v8 Instrumentation Issues

Description

@AbhiPrasad
AbhiPrasad
opened on Jun 13, 2024
Issue body actions

With the release of v8 of the Sentry SDK, the Node SDK now relies on OpenTelemetry. OpenTelemetry instrumentation does have some problems though (particularly with ESM because of import-in-the-middle), so this issue aims at documented these gaps.

Part 1: #12242

With 8.8.0 we released all the fixes for Part 1, but there are a new set of bugs for us to release fixes for. This is tracked in this issue.

### import-in-the-middle PRs to be merged
- [ ] https://github.com/DataDog/import-in-the-middle/pull/92
- [ ] https://github.com/DataDog/import-in-the-middle/pull/93
- [ ] https://github.com/DataDog/import-in-the-middle/pull/96
- [ ] https://github.com/DataDog/import-in-the-middle/pull/100
- [ ] https://github.com/DataDog/import-in-the-middle/pull/103
- [ ] https://github.com/DataDog/import-in-the-middle/pull/104
- [ ] https://github.com/DataDog/import-in-the-middle/pull/106
- [ ] https://github.com/DataDog/import-in-the-middle/pull/108
- [ ] https://github.com/DataDog/import-in-the-middle/pull/109
- [ ] https://github.com/DataDog/import-in-the-middle/pull/114
- [ ] https://github.com/DataDog/import-in-the-middle/pull/115
### Sentry issues
- [ ] https://github.com/getsentry/sentry-javascript/issues/12325
- [ ] https://github.com/getsentry/sentry-javascript/issues/12357
- [ ] https://github.com/getsentry/sentry-javascript/issues/12414
- [ ] https://github.com/getsentry/sentry-javascript/issues/12422
- [ ] https://github.com/getsentry/sentry-javascript/issues/12480
- [ ] https://github.com/getsentry/sentry-javascript/issues/12490
- [ ] https://github.com/getsentry/sentry-javascript/issues/12622

1. Issue with prisma library

Issue: #12325

Repro: #12325 (comment)

IITM issue: nodejs/import-in-the-middle#95
Fix: #12325

2. using --import ./instrument.mjs and tsx fails

Issue: #12357
TSX issue: privatenumber/tsx#571

3. Issue with openai library

Issue: #12414

Repro: https://github.com/NatoBoram/bug-report-sentry/pull/9

IITM issue: nodejs/import-in-the-middle#102
Fix: nodejs/import-in-the-middle#103

4. import-in-the-middle does not support import attributes

Issue: #12422

IITM issue: nodejs/import-in-the-middle#105
Fix: nodejs/import-in-the-middle#104

5. Does not work with ts-node

Issue: #12480

Crashes with Nuxt + Nitro

Error: The requested module 'vue' does not provide an export named 'computed'

Issue: #12490

Reacted by Jean-Matthieu DECHRISTÉ, Sylvain Dumont and Facundo Allemand
Reacted by Tim Fish, Reece Carolan and Cas

Activity

  1. AbhiPrasad
    added this to the v8 Instrumentation Issues milestone on Jun 13, 2024
  2. AbhiPrasad
    assigned
    timfish
    and
    AbhiPrasad
    on Jun 13, 2024
  3. AbhiPrasad
    added
    Package: node
    Package-Meta: OpenTelemetry
    on Jun 13, 2024
  4. timfish commented on Jun 15, 2024

    @timfish
    timfish
    on Jun 15, 2024
    Collaborator
    More actions

    The above PRs have been merged and we're just waiting for these changes to make it through all the required release processes.

    Until then I've made a patch which can be used with patch-package so the combination of these changes can be tested:
    import-in-the-middle+1.8.0.patch

  5. AnthonyDugarte commented on Jun 18, 2024

    @AnthonyDugarte
    AnthonyDugarte
    on Jun 18, 2024
    More actions

    @timfish these warns are polluting the local env logs when booting up the apps, it'd be nice if they can be hidden via a debug env variable


    edit: warn message spammed on app startup example

    Error: 'import-in-the-middle' failed to wrap 'file:///path-to-app/src/services/index.ts'
        at load (/path-to-monorepo/node_modules/.pnpm/[email protected]_patch_hash=yuhjsw3albhdp7qjccbkymjzsy/node_modules/import-in-the-middle/hook.js:306:21)
        at async nextLoad (node:internal/modules/esm/hooks:866:22)
        at async Hooks.load (node:internal/modules/esm/hooks:449:20)
        at async handleMessage (node:internal/modules/esm/worker:196:18) {
      cause: [Error: ENOENT: no such file or directory, open 'path-to-app/src/services/person.service.js'] {
        errno: -2,
        code: 'ENOENT',
        syscall: 'open',
        path: 'path-to-app/src/services/person.service.js'
      }
    }
    Reacted by Tim Fish
  6. getsantry
    added
    Waiting for: Product Owner
    on Jun 18, 2024
  7. getsantry
    added this to GitHub Issues with 👀 3on Jun 18, 2024
  8. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 18, 2024
  9. lforst
    removed
    Waiting for: Product Owner
    on Jun 20, 2024
  10. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 20, 2024
  11. bubooon commented on Jun 29, 2024

    @bubooon
    bubooon
    on Jun 29, 2024
    More actions

    Hey!
    I see the fix was already released for import-in-the-middle but it seems to be not related to the nuxt-nitro issue. I think my notes here #12490 could shine some light on the issue to help you fix or at least reproduce it.

  12. getsantry
    added
    Waiting for: Product Owner
    on Jun 29, 2024
  13. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 29, 2024
  14. lforst
    removed
    Waiting for: Product Owner
    on Jul 1, 2024
  15. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 1, 2024
  16. MeCapron commented on Jul 1, 2024

    @MeCapron
    MeCapron
    on Jul 1, 2024
    More actions

    Hello!

    I have this issue on my side :

    https://adexos.sentry.io/issues/5559252313/?project=4507505661837312&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=1

    image

    It seems to be greatly related to the issues seen here.

    However, I could not find one that looks like mine. I'm using Sentry 8.13.0

    I'm copying the test for further research :

    require is not defined in ES module scope, you can use import instead
    This file is being treated as an ES module because it has a '.js' file extension and '/project/package.json' contains "type": "module". To treat it as a CommonJS script, rename it ...
    

    This issue only comes since the installation of Sentry, when the app is built (using Remix with Vite).

    Have you any idea?

  17. getsantry
    added
    Waiting for: Product Owner
    on Jul 1, 2024
  18. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 1, 2024
  19. timfish commented on Jul 2, 2024

    @timfish
    timfish
    on Jul 2, 2024
    Collaborator
    More actions

    Hi @MeCapron,

    This looks like a different issue and is very strange since all this code is CommonJs!

    Could you open a new issue with a minimal reproduction so I can debug what's going on?

  20. getsantry
    removed
    Waiting for: Product Owner
    on Jul 2, 2024
  21. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 2, 2024
  22. AbhiPrasad commented on Jul 8, 2024

    @AbhiPrasad
    AbhiPrasad
    on Jul 8, 2024
    ContributorAuthor
    More actions

    With the newest release of import-in-the-middle v1.9.0 this should be fixed.

    If you upgrade to a fresh install of the latest version of the Node SDK it should use [email protected] by default.

    There are some follow up issues though - I'll create a new ESM blockers issue (Part 3 😅) that we can use to track this!

    We need to:

    1. Merge in fix: Skip wrapping CJS modules which result in invalid identifiers nodejs/import-in-the-middle#115 which should fix . in exports property of CJS file breaks dynamic imports #12622
    2. Further investigate SDK fails in ESM mode in combination with openai #12414 which should we are asking about here: doc: add synchronous hooks proposal nodejs/loaders#198 (comment)
    3. Figure out why Error: The requested module 'vue' does not provide an export named 'computed' #12490 is continuing to regress
  23. AbhiPrasad
    closed this as completedon Jul 8, 2024
  24. AbhiPrasad commented on Jul 8, 2024

    @AbhiPrasad
    AbhiPrasad
    on Jul 8, 2024
    ContributorAuthor
    More actions

    Follow up issue: #12806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @AbhiPrasad
    AbhiPrasad
  • @timfish
    timfish

Labels

Package-Meta: OpenTelemetry

Projects

  • GitHub Issues with 👀 3
    Status
    No status
    Show more project fields

Milestone

  • v8 Instrumentation Issues

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.