cf-deployment-tracker-client
Advanced tools
Comparing version 0.0.8 to 0.1.1
{ | ||
"name": "cf-deployment-tracker-client", | ||
"version": "0.0.8", | ||
"version": "0.1.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "main": "tracker.js", |
@@ -15,3 +15,6 @@ # Overview | ||
``` | ||
3. Add a copy of the Privacy Notice to the readme file. | ||
**Note:** All apps that have deployment tracker must include the Privacy Notice. | ||
# Example app | ||
@@ -31,4 +34,6 @@ | ||
* Application URIs (`application_uris`) | ||
* Labels of bound services | ||
* Number of instances for each bound service and associated plan information | ||
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked. | ||
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked. | ||
@@ -35,0 +40,0 @@ ## Disabling Deployment Tracking |
@@ -10,3 +10,4 @@ // Licensed under the Apache 2.0 License. See footer for details. | ||
var pkg = require(path.join(path.dirname(module.parent.filename), 'package.json')), | ||
vcapApplication; | ||
vcapApplication, | ||
vcapServices; | ||
@@ -39,3 +40,28 @@ if (process.env.VCAP_APPLICATION) { | ||
} | ||
if (process.env.VCAP_SERVICES) { | ||
// refer to http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES | ||
vcapServices = JSON.parse(process.env.VCAP_SERVICES); | ||
if(Object.keys(vcapServices).length > 0) { | ||
event.bound_vcap_services = {}; | ||
// for each bound service count the number of instances and identify used plans | ||
Object.keys(vcapServices).forEach(function(service_label) { | ||
event.bound_vcap_services[service_label] = { | ||
'count': vcapServices[service_label].length, // number of service_label instances | ||
'plans': [] // (optional) plan information for service_label | ||
}; | ||
vcapServices[service_label].forEach(function (serviceInstance) { | ||
if(serviceInstance.hasOwnProperty('plan')) { | ||
event.bound_vcap_services[service_label].plans.push(serviceInstance.plan); | ||
} | ||
}); | ||
// Keep plans property only if at least one plan is associated with this service | ||
if(event.bound_vcap_services[service_label].plans.length === 0) { | ||
delete event.bound_vcap_services[service_label].plans; | ||
} | ||
}); | ||
} | ||
} | ||
event.runtime = 'nodejs'; | ||
var url = 'https://deployment-tracker.mybluemix.net/api/v1/track'; | ||
@@ -42,0 +68,0 @@ restler.postJson(url, event).on('complete', function (data) { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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 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
18213
64
41
5
1