@google-cloud/trace-agent
Advanced tools
Comparing version 2.3.3 to 2.4.0
@@ -19,2 +19,3 @@ "use strict"; | ||
const asyncHook = require("async_hooks"); | ||
const shimmer = require("shimmer"); | ||
const wrappedSymbol = Symbol('context_wrapped'); | ||
@@ -88,6 +89,9 @@ let contexts = {}; | ||
// tslint:disable:no-any | ||
const oldMethod = ee[method]; | ||
ee[method] = function (event, cb) { | ||
return oldMethod.call(this, event, ns.bind(cb)); | ||
}; | ||
if (ee[method]) { | ||
shimmer.wrap(ee, method, (oldMethod) => { | ||
return function (event, cb) { | ||
return oldMethod.call(this, event, ns.bind(cb)); | ||
}; | ||
}); | ||
} | ||
// tslint:enable:no-any | ||
@@ -94,0 +98,0 @@ }); |
@@ -39,2 +39,3 @@ "use strict"; | ||
'http': path.join(pluginDirectory, 'plugin-http.js'), | ||
'http2': path.join(pluginDirectory, 'plugin-http2.js'), | ||
'https': path.join(pluginDirectory, 'plugin-https.js'), | ||
@@ -45,2 +46,3 @@ 'knex': path.join(pluginDirectory, 'plugin-knex.js'), | ||
'mysql': path.join(pluginDirectory, 'plugin-mysql.js'), | ||
'mysql2': path.join(pluginDirectory, 'plugin-mysql2.js'), | ||
'pg': path.join(pluginDirectory, 'plugin-pg.js'), | ||
@@ -47,0 +49,0 @@ 'redis': path.join(pluginDirectory, 'plugin-redis.js'), |
@@ -475,3 +475,3 @@ /** | ||
file: 'src/client.js', | ||
versions: '1.7', | ||
versions: '1.7 - 1.8', | ||
patch: patchClient, | ||
@@ -482,3 +482,3 @@ unpatch: unpatchClient | ||
file: 'src/metadata.js', | ||
versions: '1.7', | ||
versions: '1.7 - 1.8', | ||
patch: patchMetadata, | ||
@@ -489,3 +489,3 @@ unpatch: unpatchMetadata | ||
file: 'src/server.js', | ||
versions: '1.7', | ||
versions: '1.7 - 1.8', | ||
patch: patchServer, | ||
@@ -492,0 +492,0 @@ unpatch: unpatchServer |
@@ -41,3 +41,3 @@ /** | ||
(options.hostname || options.host || 'localhost') + | ||
((isString(options.port) ? (':' + options.port) : '')) + | ||
(options.port ? (':' + options.port) : '') + | ||
(options.path || options.pathName || '/'); | ||
@@ -89,2 +89,3 @@ } | ||
if (eventName === 'data' && !listenerAttached) { | ||
listenerAttached = true; | ||
on.call(this, 'data', function (chunk) { | ||
@@ -91,0 +92,0 @@ numBytes += chunk.length; |
@@ -179,3 +179,11 @@ "use strict"; | ||
if (rootSpan.span.isClosed()) { | ||
// A closed root span suggests that we either have context confusion or | ||
// some work is being done after the root request has been completed. | ||
// The first case could lead to a memory leak, if somehow all spans end | ||
// up getting misattributed to the same root span – we get a root span | ||
// with continuously growing number of child spans. The second case | ||
// seems to have some value, but isn't representable. The user probably | ||
// needs a custom outer span that encompasses the entirety of work. | ||
this.logger.warn(this.pluginName + ': creating child for an already closed span', options.name, rootSpan.span.name); | ||
return null; | ||
} | ||
@@ -182,0 +190,0 @@ // Create a new child span and return it. |
{ | ||
"name": "@google-cloud/trace-agent", | ||
"version": "2.3.3", | ||
"version": "2.4.0", | ||
"description": "Node.js Support for StackDriver Trace", | ||
"main": "build/index.js", | ||
"main": "build/src/index.js", | ||
"types": "build/src/index.d.ts", | ||
"repository": "GoogleCloudPlatform/cloud-trace-nodejs", | ||
"scripts": { | ||
"test": "ts-node -P ./scripts ./scripts npm-check npm-compile init-test-fixtures run-unit-tests", | ||
"non-interference": "ts-node -P ./scripts ./scripts npm-compile test-non-interference", | ||
"system-test": "ts-node -P ./scripts ./scripts npm-compile decrypt-service-account-key run-system-tests", | ||
"test": "npm run script npm-check npm-compile init-test-fixtures run-unit-tests", | ||
"non-interference": "npm run script npm-compile test-non-interference", | ||
"system-test": "npm run script npm-compile decrypt-service-account-key run-system-tests", | ||
"changelog": "./bin/run-changelog.sh", | ||
"check-install": "ts-node -P ./scripts ./scripts npm-compile check-install", | ||
"coverage": "ts-node -P ./scripts ./scripts npm-check npm-compile init-test-fixtures run-unit-tests-with-coverage report-coverage", | ||
"check-install": "npm run script npm-compile check-install", | ||
"coverage": "npm run script npm-check npm-compile init-test-fixtures run-unit-tests-with-coverage report-coverage", | ||
"bump": "./bin/run-bump.sh", | ||
@@ -19,13 +20,14 @@ "check": "gts check", | ||
"compile-strict": "tsc -p .", | ||
"compile": "ts-node -P ./scripts ./scripts npm-compile-all npm-compile-strict", | ||
"compile": "npm run script npm-compile-all npm-compile-strict", | ||
"fix": "gts fix", | ||
"prepare": "npm run compile" | ||
"prepare": "npm run script npm-clean npm-compile", | ||
"script": "ts-node -P ./scripts ./scripts" | ||
}, | ||
"files": [ | ||
"build/*.js", | ||
"build/*.d.ts", | ||
"build/src/*.js", | ||
"build/src/config.d.ts", | ||
"build/src/constants.d.ts", | ||
"build/src/index.d.ts", | ||
"build/src/plugin-types.d.ts", | ||
"build/src/trace-labels.d.ts", | ||
"build/src/plugin-types.d.ts", | ||
"build/src/plugins/*.js", | ||
@@ -37,3 +39,2 @@ "doc", | ||
], | ||
"types": "build/index.d.ts", | ||
"keywords": [ | ||
@@ -54,13 +55,13 @@ "google", | ||
"@types/glob": "^5.0.32", | ||
"@types/is": "0.0.17", | ||
"@types/mocha": "^2.2.42", | ||
"@types/is": "0.0.18", | ||
"@types/mocha": "^2.2.44", | ||
"@types/ncp": "^2.0.1", | ||
"@types/node": "^8.0.32", | ||
"@types/node": "^8.0.58", | ||
"@types/once": "^1.4.0", | ||
"@types/pify": "^3.0.0", | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/request": "^2.0.3", | ||
"@types/request": "^2.0.8", | ||
"@types/semver": "^5.4.0", | ||
"@types/tmp": "0.0.33", | ||
"@types/uuid": "^3.4.2", | ||
"@types/uuid": "^3.4.3", | ||
"changelog-maker": "^2.2.2", | ||
@@ -70,5 +71,5 @@ "coveralls": "^3.0.0", | ||
"glob": "^7.0.3", | ||
"google-auto-auth": "^0.7.0", | ||
"google-auto-auth": "^0.9.0", | ||
"got": "^7.1.0", | ||
"gts": "^0.5.0", | ||
"gts": "^0.5.1", | ||
"istanbul": "^0.4.2", | ||
@@ -78,7 +79,7 @@ "jshint": "^2.9.1", | ||
"ncp": "^2.0.0", | ||
"nock": "^9.0.0", | ||
"nock": "^9.1.3", | ||
"once": "^1.4.0", | ||
"pify": "^3.0.0", | ||
"proxyquire": "^1.4.0", | ||
"request": "^2.81.0", | ||
"request": "^2.83.0", | ||
"source-map-support": "^0.5.0", | ||
@@ -88,8 +89,8 @@ "standard-version": "^4.2.0", | ||
"tmp": "0.0.33", | ||
"ts-node": "^3.3.0", | ||
"typescript": "^2.6.1" | ||
"ts-node": "^4.0.0", | ||
"typescript": "~2.6.2" | ||
}, | ||
"dependencies": { | ||
"@google-cloud/common": "^0.13.2", | ||
"continuation-local-storage": "^3.2.0", | ||
"@google-cloud/common": "^0.15.1", | ||
"continuation-local-storage": "^3.2.1", | ||
"extend": "^3.0.0", | ||
@@ -102,6 +103,6 @@ "gcp-metadata": "^0.4.1", | ||
"methods": "^1.1.1", | ||
"semver": "^5.0.1", | ||
"shimmer": "^1.0.0", | ||
"semver": "^5.4.1", | ||
"shimmer": "^1.2.0", | ||
"uuid": "^3.0.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
892692
4037
17
+ Added@google-cloud/common@0.15.2(transitive)
+ Addedgoogle-auth-library@0.12.0(transitive)
+ Addedgoogle-auto-auth@0.8.2(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedlog-driver@1.2.5(transitive)
- Removed@google-cloud/common@0.13.6(transitive)
- Removedgoogle-auth-library@0.10.0(transitive)
- Removedgoogle-auto-auth@0.7.2(transitive)
- Removedlodash.noop@3.0.1(transitive)
- Removedlog-driver@1.2.7(transitive)
Updated@google-cloud/common@^0.15.1
Updatedsemver@^5.4.1
Updatedshimmer@^1.2.0