newrelic / node-native-metrics

Optional native module for collecting low-level Node & V8 metrics
Apache License 2.0
63 stars 41 forks source link

Arm64 with prebuilds #238

Closed jsumners-nr closed 8 months ago

jsumners-nr commented 9 months ago

This PR resolves #205.

Proposed Release Notes

Migrated to using prebuildify and node-gyp-install.

Links

Details

Utilizing prebuildify and node-gyp-install allows us to remove all of the custom code around checking for a local binary and downloading one from an S3 bucket if a binary isn't found. This is accomplished by bundling a binary for all known supported platforms within the npm package. If the module is installed on a platform we have not bundled a binary for, then node-gyp-install will run the build locally as per normal node-gyp. Additionally, if anyone wants to force a build, they can npm install --build-from-source.

Notice: the create-release.yml workflow does not directly use the one from newrelic/node-newrelic. We need to do some extra steps to 1. build the binaries, 2. grab them from the GHA artifacts cache, 3. construct a project structure with the binaries and npm pack to build the shippable module, and 4. grab the packed module from the GHA actions cache and then publish it to npmjs.com.

The process can be seen in this dry run. The npm-module artifact from that run can be downloaded and:

  1. unzip npm-module.zip
  2. mkdir foo && cd foo && npm init && npm install ../newrelic-*.tgz
  3. echo -e "const nr = require('@newrelic/native-metrics')\nconsole.log(nr)" > index.js
  4. node index.js

You'll see the serialized representation of the exported module since the prebuilt binary gets loaded from the require line 😁

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.81%. Comparing base (02f7bce) to head (e51abcd).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #238 +/- ## ========================================== + Coverage 97.67% 97.81% +0.14% ========================================== Files 5 1 -4 Lines 644 183 -461 ========================================== - Hits 629 179 -450 + Misses 15 4 -11 ``` | [Flag](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | Coverage Δ | | |---|---|---| | [integration-tests-16-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `85.24% <100.00%> (?)` | | | [integration-tests-16-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `85.24% <100.00%> (?)` | | | [integration-tests-16-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `85.24% <100.00%> (?)` | | | [integration-tests-16-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `85.24% <100.00%> (?)` | | | [integration-tests-16.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-16.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-16.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-18-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-18-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-18-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-18-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-18.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-18.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-18.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-20-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-20-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-20-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-20-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `84.15% <100.00%> (?)` | | | [integration-tests-20.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-20.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [integration-tests-20.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-16-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `93.44% <100.00%> (?)` | | | [unit-tests-16-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `93.44% <100.00%> (?)` | | | [unit-tests-16-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `93.44% <100.00%> (?)` | | | [unit-tests-16-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `93.44% <100.00%> (?)` | | | [unit-tests-16.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-16.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-16.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-18-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-18-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-18-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-18-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-18.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-18.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-18.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-20-macos-14-arm64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-20-ubuntu-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-20-windows-latest-x64](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-20-windows-latest-x86](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `92.34% <100.00%> (?)` | | | [unit-tests-20.x-linux](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-20.x-windows-2019](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | | [unit-tests-20.x-windows-latest](https://app.codecov.io/gh/newrelic/node-native-metrics/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.