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

@azure/monitor-opentelemetry NodeJS Library Only Supports Node 18+; Docs Suggest Minimum Node Version is 14 #30217

Closed
5 of 6 tasks
epicstar opened this issue Jun 27, 2024 · 9 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor Monitor, Monitor Ingestion, Monitor Query question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@epicstar
Copy link

epicstar commented Jun 27, 2024

  • Package Name: @azure/monitor-opentelemetry
  • Package Version: v1.6.0
  • Operating system: BrightSign OS (offshoot Linux of some sort)
  • nodejs
    • version: 14.7
  • browser
    • name/version: Chromium (Unknown Version)
  • typescript
    • version: 5.5.2
  • Is the bug related to documentation in

Describe the bug

@azure/monitor-opentelemetry v1.6.0 seems to only run on NodeJS 18+, when the opentelemetry-js supports up to 14+.

The Get Started implies you support Node 14.

This is the error I get when running my project running on Node 14.7:

[ 33.125] [ERROR] [source internal/modules/cjs/loader.js:899]: Uncaught Error: Cannot find module 'node:os'

The readme in @azure/monitor-opentelemetry suggests you guys support the latest list of LTS versions, which the minimum is Node 16 (where the node:os module started). However, opentelemetry-js supports 14+ which you call out in your Get Started guide. So I was assuming that your lib supported Node 14+ also.

So it's either that you support the NodeJS version that OpenTelemetry minimally supports supports, or you openly state you support up to Node LTS versions (18 atm) in the Get Started guide.

To Reproduce
Steps to reproduce the behavior:

  1. install node 14
  2. Read the prerequisites in the [Get Started Guide](Get Started
  3. create stub project following the steps in the Get Started guide, including starting the Azure monitor code.

Expected behavior
Node App runs.

Screenshots
image

Prerequisites from the page:
opentelemetry-js

Additional context
I wish I could update to the latest LTS version of NodeJS, but we're bound by what BrightSign installs on their players :(

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 27, 2024
@jeremymeng
Copy link
Member

@epicstar thank you for reporting this issue! Unfortunately the latest versions of our Azure SDK packages only support NodeJS v18 and later. We encourage customers to upgrade to at least v18 as there are vulnerabitlity in NodeJS v16 that won't be fixed.

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Monitor Monitor, Monitor Ingestion, Monitor Query labels Jun 28, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 28, 2024
@epicstar
Copy link
Author

Thank you. Here's another instance of confusing NodeJS version support in the documentation:
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-nodejs-migrate?tabs=cleaninstall#node--14-support

Node < 14 support

OpenTelemetry JavaScript's monitoring solutions officially support only Node version 14+. Check the OpenTelemetry supported runtimes for the latest updates. Users on older versions like Node 8, previously supported by the ApplicationInsights SDK, can still use OpenTelemetry solutions but can experience unexpected or breaking behavior.

@epicstar epicstar changed the title @azure/monitor-opentelemetry NodeJS Library Only Supports Node 16+; Docs Suggest Minimum Node Version is 14 @azure/monitor-opentelemetry NodeJS Library Only Supports Node 18+; Docs Suggest Minimum Node Version is 14 Jun 28, 2024
@FefoAljedani
Copy link

``

@hectorhdzg
Copy link
Member

@epicstar Azure Monitor OpenTelemetry package rely on both Azure SDK and OpenTelemetry dependencies, that is why we mention both in our official docs, right now OpenTelemetry supports older versions of the runtime comparing to Azure SDK, but that could change, maybe we can add more explicit message saying that the supported runtime is where both dependencies are satisfied. Migration docs you shared are outdated and I will make sure these are up to date, I would recommend you take a look at Application Insights SDK v2 for older Node.js runtime support.

@epicstar
Copy link
Author

epicstar commented Jul 1, 2024

I would recommend you take a look at Application Insights SDK v2 for older Node.js runtime support.

I've tried 2.9.5 and got the same node:os import error. I'll go down the list of minor versions and will let you know which one works on Node 14. Thank you!

@epicstar
Copy link
Author

epicstar commented Jul 5, 2024

I couldn't find a version of application insights v2 that supported Node 14. I went down to 2.4.2 with the same node:os import error. I think what's happening is that yarn is updating a transitive dependency of applicationinsights v2 to something that doesn't support Node 14. I even tried deleting the yarn lock. I'm not exactly sure which transitive dependency that is causing the issue. Regardless, because it's beyond the scope of @azure/monitor-opentelemetry, I don't expect a solution on this other than doc changes and will just create an issue in that repo.

@jeremymeng
Copy link
Member

would pinning transitive dependencies helps? Not that we want customers to continute working on unsecured version of Nodejs, but something like

  "resolutions": {
    "@azure/core-rest-pipeline": "1.14.0",
    "@azure/core-util": "1.7.0",
    "@azure/logger": "1.0.4"
  }

@hectorhdzg
Copy link
Member

@epicstar like @jeremymeng mentioned pinning the dependencies may help, @azure/core-auth is also a dependency in Application Insights v2 that is causing the issue, I will update Application Insights to support older versions of Node.js as you noticed is a bug in our side, at least in Application insights v2 side of things, automatic dependency updates broke this most likely, but you will not be able to use AAD feature in the SDK, if you need the feature you will need to update to newer runtimes, I will make sure this is reflected in docs as well.

@JacksonWeber
Copy link
Member

Closing as this is resolved in @azure/monitor-opentelemetry v1.7.0.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor Monitor, Monitor Ingestion, Monitor Query question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants