@google-cloud/trace-agent
Advanced tools
Comparing version 5.1.3 to 5.1.4
@@ -42,5 +42,8 @@ "use strict"; | ||
getContext() { | ||
const result = this.getNamespace().get(AsyncListenerCLS.ROOT_CONTEXT_KEY); | ||
if (result) { | ||
return result; | ||
const namespace = this.getNamespace(); | ||
if (namespace) { | ||
const result = namespace.get(AsyncListenerCLS.ROOT_CONTEXT_KEY); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
@@ -47,0 +50,0 @@ return this.defaultContext; |
@@ -20,3 +20,2 @@ "use strict"; | ||
/** Constant values. */ | ||
// tslint:disable-next-line:variable-name | ||
exports.Constants = { | ||
@@ -23,0 +22,0 @@ /** The metadata key under which trace context is stored as a binary value. */ |
@@ -19,3 +19,2 @@ "use strict"; | ||
// Bluebird is a class. | ||
// tslint:disable-next-line:variable-name | ||
patch: (Bluebird, tracer) => { | ||
@@ -37,3 +36,2 @@ // any is a type arg; args are type checked when read directly, otherwise | ||
}); | ||
// tslint:enable:no-any | ||
}, | ||
@@ -40,0 +38,0 @@ }, |
@@ -23,3 +23,2 @@ "use strict"; | ||
// used at once. | ||
// tslint:disable-next-line:variable-name | ||
let MetadataModuleValue; | ||
@@ -182,3 +181,2 @@ function patchMetadata(metadata) { | ||
// Client is a class. | ||
// tslint:disable-next-line:variable-name | ||
// eslint-disable-next-line prefer-rest-params | ||
@@ -185,0 +183,0 @@ const Client = makeClientConstructor.apply(this, arguments); |
@@ -99,3 +99,2 @@ "use strict"; | ||
// Request is a class name. | ||
// tslint:disable-next-line:variable-name | ||
patch: (Request, api) => { | ||
@@ -113,3 +112,2 @@ // TODO(kjin): shimmer cannot wrap AsyncFunction objects. | ||
// Request is a class name. | ||
// tslint:disable-next-line:variable-name | ||
unpatch: Request => { | ||
@@ -116,0 +114,0 @@ if (Request.prototype._execute[ORIGINAL]) { |
@@ -53,8 +53,10 @@ "use strict"; | ||
this.tracer = tracer; | ||
this.maybePopulateLabelsFromInputs = tracer.enhancedDatabaseReportingEnabled() | ||
? populateLabelsFromInputs | ||
: noOp; | ||
this.maybePopulateLabelsFromOutputs = tracer.enhancedDatabaseReportingEnabled() | ||
? populateLabelsFromOutputs | ||
: noOp; | ||
this.maybePopulateLabelsFromInputs = | ||
tracer.enhancedDatabaseReportingEnabled() | ||
? populateLabelsFromInputs | ||
: noOp; | ||
this.maybePopulateLabelsFromOutputs = | ||
tracer.enhancedDatabaseReportingEnabled() | ||
? populateLabelsFromOutputs | ||
: noOp; | ||
} | ||
@@ -71,3 +73,2 @@ patchSubmittable(pgQuery, span) { | ||
...args) { | ||
// tslint:enable:no-any | ||
if (!spanEnded) { | ||
@@ -92,3 +93,2 @@ const err = args[0]; | ||
...args) { | ||
// tslint:enable:no-any | ||
if (!spanEnded) { | ||
@@ -131,3 +131,2 @@ maybePopulateLabelsFromOutputs(span, null, this._result); | ||
// TS: Client is a class name. | ||
// tslint:disable-next-line:variable-name | ||
patch: (Client, api) => { | ||
@@ -173,3 +172,2 @@ const pgPatch = new PostgresPatchUtility(api); | ||
// TS: Client is a class name. | ||
// tslint:disable-next-line:variable-name | ||
unpatch(Client) { | ||
@@ -183,3 +181,2 @@ shimmer.unwrap(Client.prototype, 'query'); | ||
// TS: Client is a class name. | ||
// tslint:disable-next-line:variable-name | ||
patch: (Client, api) => { | ||
@@ -243,3 +240,2 @@ const pgPatch = new PostgresPatchUtility(api); | ||
// TS: Client is a class name. | ||
// tslint:disable-next-line:variable-name | ||
unpatch(Client) { | ||
@@ -246,0 +242,0 @@ shimmer.unwrap(Client.prototype, 'query'); |
@@ -35,3 +35,2 @@ "use strict"; | ||
function randomSpanId() { | ||
// tslint:disable-next-line:ban Needed to parse hexadecimal. | ||
return parseInt(spanRandomBuffer().toString('hex'), 16).toString(); | ||
@@ -68,3 +67,4 @@ } | ||
// stack trace label has its own size constraints. | ||
this.span.labels[trace_labels_1.TraceLabels.STACK_TRACE_DETAILS_KEY] = traceUtil.truncate(JSON.stringify({ stack_frame: stackFrames }), constants_1.Constants.TRACE_SERVICE_LABEL_VALUE_LIMIT); | ||
this.span.labels[trace_labels_1.TraceLabels.STACK_TRACE_DETAILS_KEY] = | ||
traceUtil.truncate(JSON.stringify({ stack_frame: stackFrames }), constants_1.Constants.TRACE_SERVICE_LABEL_VALUE_LIMIT); | ||
} | ||
@@ -71,0 +71,0 @@ } |
@@ -22,3 +22,2 @@ "use strict"; | ||
*/ | ||
// tslint:disable-next-line:variable-name | ||
exports.TraceLabels = { | ||
@@ -25,0 +24,0 @@ /** |
@@ -79,3 +79,2 @@ "use strict"; | ||
} | ||
// tslint:enable:no-any | ||
} | ||
@@ -82,0 +81,0 @@ return defaultValue; |
# Changelog | ||
### [5.1.4](https://www.github.com/googleapis/cloud-trace-nodejs/compare/v5.1.3...v5.1.4) (2021-08-19) | ||
### Bug Fixes | ||
* **build:** migrate to using main branch ([#1373](https://www.github.com/googleapis/cloud-trace-nodejs/issues/1373)) ([f065f97](https://www.github.com/googleapis/cloud-trace-nodejs/commit/f065f97259da372ca53abca0d06df6a8cc5cd146)) | ||
### [5.1.3](https://www.github.com/googleapis/cloud-trace-nodejs/compare/v5.1.2...v5.1.3) (2021-02-09) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@google-cloud/trace-agent", | ||
"version": "5.1.3", | ||
"version": "5.1.4", | ||
"description": "Node.js Support for StackDriver Trace", | ||
@@ -27,5 +27,3 @@ "main": "build/src/index.js", | ||
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", | ||
"prelint": "cd samples; npm link ../; npm i", | ||
"api-extractor": "api-extractor run --local", | ||
"api-documenter": "api-documenter yaml --input-folder=temp" | ||
"prelint": "cd samples; npm link ../; npm i" | ||
}, | ||
@@ -54,5 +52,5 @@ "files": [ | ||
"devDependencies": { | ||
"@compodoc/compodoc": "1.1.11", | ||
"@compodoc/compodoc": "1.1.13", | ||
"@google-cloud/datastore": "^6.0.0", | ||
"@grpc/proto-loader": "^0.5.0", | ||
"@grpc/proto-loader": "^0.6.0", | ||
"@types/builtin-modules": "^2.0.0", | ||
@@ -68,4 +66,3 @@ "@types/console-log-level": "^1.4.0", | ||
"@types/mongoose": "^5.3.26", | ||
"@types/nock": "^10.0.0", | ||
"@types/node": "^12.7.2", | ||
"@types/node": "^14.0.0", | ||
"@types/node-fetch": "^2.5.0", | ||
@@ -77,3 +74,3 @@ "@types/once": "^1.4.0", | ||
"@types/source-map-support": "^0.5.1", | ||
"@types/tmp": "0.2.0", | ||
"@types/tmp": "0.2.1", | ||
"@types/uuid": "^8.0.0", | ||
@@ -86,3 +83,3 @@ "axios": "^0.21.0", | ||
"glob": "^7.0.3", | ||
"grpc": "1.24.4", | ||
"grpc": "1.24.10", | ||
"gts": "^3.0.0", | ||
@@ -98,6 +95,4 @@ "js-green-licenses": "^3.0.0", | ||
"tmp": "0.2.1", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^3.9.6", | ||
"@microsoft/api-documenter": "^7.8.10", | ||
"@microsoft/api-extractor": "^7.8.10" | ||
"ts-node": "^10.0.0", | ||
"typescript": "^3.9.6" | ||
}, | ||
@@ -104,0 +99,0 @@ "dependencies": { |
@@ -9,3 +9,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
[![npm version](https://img.shields.io/npm/v/@google-cloud/trace-agent.svg)](https://www.npmjs.org/package/@google-cloud/trace-agent) | ||
[![codecov](https://img.shields.io/codecov/c/github/googleapis/cloud-trace-nodejs/master.svg?style=flat)](https://codecov.io/gh/googleapis/cloud-trace-nodejs) | ||
[![codecov](https://img.shields.io/codecov/c/github/googleapis/cloud-trace-nodejs/main.svg?style=flat)](https://codecov.io/gh/googleapis/cloud-trace-nodejs) | ||
@@ -19,3 +19,3 @@ | ||
A comprehensive list of changes in each version may be found in | ||
[the CHANGELOG](https://github.com/googleapis/cloud-trace-nodejs/blob/master/CHANGELOG.md). | ||
[the CHANGELOG](https://github.com/googleapis/cloud-trace-nodejs/blob/main/CHANGELOG.md). | ||
@@ -217,8 +217,8 @@ * [Stackdriver Trace Node.js Client API Reference][client-docs] | ||
Samples are in the [`samples/`](https://github.com/googleapis/cloud-trace-nodejs/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | ||
Samples are in the [`samples/`](https://github.com/googleapis/cloud-trace-nodejs/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | ||
| Sample | Source Code | Try it | | ||
| --------------------------- | --------------------------------- | ------ | | ||
| App | [source code](https://github.com/googleapis/cloud-trace-nodejs/blob/master/samples/app.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/cloud-trace-nodejs&page=editor&open_in_editor=samples/app.js,samples/README.md) | | ||
| Snippets | [source code](https://github.com/googleapis/cloud-trace-nodejs/blob/master/samples/snippets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/cloud-trace-nodejs&page=editor&open_in_editor=samples/snippets.js,samples/README.md) | | ||
| App | [source code](https://github.com/googleapis/cloud-trace-nodejs/blob/main/samples/app.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/cloud-trace-nodejs&page=editor&open_in_editor=samples/app.js,samples/README.md) | | ||
| Snippets | [source code](https://github.com/googleapis/cloud-trace-nodejs/blob/main/samples/snippets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/cloud-trace-nodejs&page=editor&open_in_editor=samples/snippets.js,samples/README.md) | | ||
@@ -271,3 +271,3 @@ | ||
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/cloud-trace-nodejs/blob/master/CONTRIBUTING.md). | ||
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/cloud-trace-nodejs/blob/main/CONTRIBUTING.md). | ||
@@ -277,4 +277,4 @@ Please note that this `README.md`, the `samples/README.md`, | ||
are generated from a central template. To edit one of these files, make an edit | ||
to its template in this | ||
[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). | ||
to its templates in | ||
[directory](https://github.com/googleapis/synthtool). | ||
@@ -285,3 +285,3 @@ ## License | ||
See [LICENSE](https://github.com/googleapis/cloud-trace-nodejs/blob/master/LICENSE) | ||
See [LICENSE](https://github.com/googleapis/cloud-trace-nodejs/blob/main/LICENSE) | ||
@@ -288,0 +288,0 @@ [client-docs]: https://googleapis.dev/nodejs/trace/latest/ |
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
41
332008
6932