@google-cloud/trace-agent
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -95,14 +95,17 @@ "use strict"; | ||
this.getInstanceId((instanceId) => { | ||
const labels = {}; | ||
labels[trace_labels_1.TraceLabels.AGENT_DATA] = | ||
'node ' + pjson.name + ' v' + pjson.version; | ||
labels[trace_labels_1.TraceLabels.GCE_HOSTNAME] = hostname; | ||
// tslint:disable-next-line:no-any | ||
const addDefaultLabel = (key, value) => { | ||
this.defaultLabels[key] = `${value}`; | ||
}; | ||
this.defaultLabels = {}; | ||
addDefaultLabel(trace_labels_1.TraceLabels.AGENT_DATA, `node ${pjson.name} v${pjson.version}`); | ||
addDefaultLabel(trace_labels_1.TraceLabels.GCE_HOSTNAME, hostname); | ||
if (instanceId) { | ||
labels[trace_labels_1.TraceLabels.GCE_INSTANCE_ID] = instanceId; | ||
addDefaultLabel(trace_labels_1.TraceLabels.GCE_INSTANCE_ID, instanceId); | ||
} | ||
const moduleName = this.config.serviceContext.service || hostname; | ||
labels[trace_labels_1.TraceLabels.GAE_MODULE_NAME] = moduleName; | ||
addDefaultLabel(trace_labels_1.TraceLabels.GAE_MODULE_NAME, moduleName); | ||
const moduleVersion = this.config.serviceContext.version; | ||
if (moduleVersion) { | ||
labels[trace_labels_1.TraceLabels.GAE_MODULE_VERSION] = moduleVersion; | ||
addDefaultLabel(trace_labels_1.TraceLabels.GAE_MODULE_VERSION, moduleVersion); | ||
const minorVersion = this.config.serviceContext.minorVersion; | ||
@@ -115,7 +118,6 @@ if (minorVersion) { | ||
versionLabel += moduleVersion + '.' + minorVersion; | ||
labels[trace_labels_1.TraceLabels.GAE_VERSION] = versionLabel; | ||
addDefaultLabel(trace_labels_1.TraceLabels.GAE_VERSION, versionLabel); | ||
} | ||
} | ||
Object.freeze(labels); | ||
this.defaultLabels = labels; | ||
Object.freeze(this.defaultLabels); | ||
if (--pendingOperations === 0) { | ||
@@ -122,0 +124,0 @@ cb(); |
{ | ||
"name": "@google-cloud/trace-agent", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "Node.js Support for StackDriver Trace", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
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
591620
4438