@newrelic/native-metrics
Advanced tools
Comparing version 7.0.2 to 7.1.0
@@ -0,1 +1,12 @@ | ||
### v7.1.0 (2022-01-11) | ||
* Added ability to download pre-builts through a proxy host. | ||
* Use `NR_NATIVE_METRICS_PROXY_HOST=<proxy_host> npm i @newrelic/native-metrics`. | ||
* Fixed deprecated code, updated `fs.existsSync` to `fs.accessSync` and using `NULL` vs. the more modern `nullptr`. | ||
* Added workflow to automate preparing release notes by reusing the newrelic/node-newrelic/.github/workflows/prep-release.yml@main workflow from agent repository. | ||
* Added job to automatically add issues/pr to Node.js Engineering board | ||
### v7.0.2 (2021-08-26): | ||
@@ -2,0 +13,0 @@ * Updated code to only check `node-gyp` version when the module needs to be built to avoid hanging node and subsequently causing OOM errors. |
@@ -24,2 +24,3 @@ /* | ||
const zlib = require('zlib') | ||
const ProxyAgent = require('proxy-agent') | ||
const { | ||
@@ -99,5 +100,4 @@ getBinFileName, | ||
gypPath = process.env.npm_config_node_gyp | ||
if (fs.existsSync(gypPath)) { | ||
return gypPath | ||
} | ||
fs.accessSync(gypPath) | ||
return gypPath | ||
} catch (err) { | ||
@@ -113,5 +113,4 @@ // This method failed, hopefully the next will succeed... | ||
gypPath = path.resolve(gypPkgPath, '../../bin/node-gyp.js') | ||
if (fs.existsSync(gypPath)) { | ||
return gypPath | ||
} | ||
fs.accessSync(gypPath) | ||
return gypPath | ||
} catch (err) { | ||
@@ -126,5 +125,4 @@ // This method failed, hopefully the next will succeed... | ||
gypPath = path.resolve(npmPkgPath, '../../node_modules/node-gyp/bin/node-gyp.js') | ||
if (fs.existsSync(gypPath)) { | ||
return gypPath | ||
} | ||
fs.accessSync(gypPath) | ||
return gypPath | ||
} catch (err) { | ||
@@ -137,7 +135,8 @@ // This method failed, hopefully the next will succeed... | ||
gypPath = path.join(nodeNpmPkgPath, 'node_modules/node-gyp/bin/node-gyp.js') | ||
if (fs.existsSync(gypPath)) { | ||
try { | ||
fs.accessSync(gypPath) | ||
return gypPath | ||
} catch { | ||
return null | ||
} | ||
return null | ||
} | ||
@@ -219,11 +218,21 @@ | ||
let hasCalledBack = false | ||
let options = {} | ||
if (DOWNLOAD_HOST.startsWith('https:')) { | ||
client = https | ||
if (process.env.NR_NATIVE_METRICS_PROXY_HOST) { | ||
const proxy = process.env.NR_NATIVE_METRICS_PROXY_HOST | ||
options.host = new URL(DOWNLOAD_HOST).host | ||
options.path = REMOTE_PATH + fileName | ||
options.agent = new ProxyAgent(proxy) | ||
client = /^https:/.test(proxy) ? https : http | ||
} else { | ||
console.log('Falling back to http, please consider enabling SSL on ' + DOWNLOAD_HOST) | ||
client = http | ||
options = url | ||
if (DOWNLOAD_HOST.startsWith('https:')) { | ||
client = https | ||
} else { | ||
console.log('Falling back to http, please consider enabling SSL on ' + DOWNLOAD_HOST) | ||
client = http | ||
} | ||
} | ||
client.get(url, function getFile(res) { | ||
client.get(options, function getFile(res) { | ||
if (res.statusCode === 404) { | ||
@@ -230,0 +239,0 @@ return cb(new Error('No pre-built artifacts for your OS/architecture.')) |
{ | ||
"name": "@newrelic/native-metrics", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"description": "A module for generating metrics from V8.", | ||
@@ -99,2 +99,3 @@ "main": "index.js", | ||
"nan": "^2.14.2", | ||
"proxy-agent": "^5.0.0", | ||
"semver": "^5.5.1" | ||
@@ -101,0 +102,0 @@ }, |
@@ -65,2 +65,10 @@ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus) | ||
You can also specify a proxy host to route requests through using the `NR_NATIVE_METRICS_PROXY_HOST` environment variable: | ||
```sh | ||
$ export NR_NATIVE_METRICS_NO_BUILD=true | ||
$ export NR_NATIVE_METRICS_PROXY_HOST=http://your-proxy-host/ | ||
$ npm install @newrelic/native-metrics | ||
``` | ||
For more information, please see the agent [installation guide][install-node] and [compatibility and requirements][compatibility]. | ||
@@ -174,2 +182,2 @@ | ||
[install-node]: https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/install-nodejs-agent | ||
[compatibility]: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent | ||
[compatibility]: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent |
@@ -18,2 +18,3 @@ # Third Party Notices | ||
* [nan](#nan) | ||
* [proxy-agent](#proxy-agent) | ||
* [semver](#semver) | ||
@@ -64,2 +65,18 @@ | ||
### proxy-agent | ||
This product includes source derived from [proxy-agent](https://github.com/TooTallNate/node-proxy-agent) ([v5.0.0](https://github.com/TooTallNate/node-proxy-agent/tree/v5.0.0)), distributed under the [MIT License](https://github.com/TooTallNate/node-proxy-agent/blob/v5.0.0/README.md): | ||
``` | ||
MIT License | ||
Copyright (c) <year> <copyright holders> | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
``` | ||
### semver | ||
@@ -66,0 +83,0 @@ |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
131319
583
182
3
22
+ Addedproxy-agent@^5.0.0
+ Added@tootallnate/once@1.1.2(transitive)
+ Addedacorn@8.11.3(transitive)
+ Addedacorn-walk@8.3.2(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedast-types@0.13.4(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddata-uri-to-buffer@3.0.1(transitive)
+ Addeddebug@4.3.4(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddegenerator@3.0.4(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfile-uri-to-path@2.0.0(transitive)
+ Addedfs-extra@8.1.0(transitive)
+ Addedftp@0.3.10(transitive)
+ Addedget-uri@3.0.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-proxy-agent@4.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedip@1.1.9(transitive)
+ Addedip-address@9.0.5(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedjsonfile@4.0.0(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedms@2.1.2(transitive)
+ Addednetmask@2.0.2(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedpac-proxy-agent@5.0.0(transitive)
+ Addedpac-resolver@5.0.1(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedproxy-agent@5.0.0(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.8.3(transitive)
+ Addedsocks-proxy-agent@5.0.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtslib@2.6.2(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addeduniversalify@0.1.2(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedvm2@3.9.19(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxregexp@2.0.0(transitive)
+ Addedyallist@3.1.1(transitive)