@salesforce/plugin-analytics
Command usage and error analytics for the Salesforce CLI
Last updated a month ago by jgrantham .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @salesforce/plugin-analytics 
SYNC missed versions from official npm registry.

@salesforce/plugin-analytics

Logs command execution and error information to app insights using @salesforce/telemetry. All logs are recorded to a local file in the CLI cache directory. Before the CLI process exists, a new process will be spawned up to read the local file and send logs to app insights. This saves ~1-3 seconds of time it can take to spin up and tear down the telemetry services.

During the CLI process, other plugins and CLI code also record custom events to the local file to be sent in the spawned process. To do so, simply instantiate the Analytics class.

const analytics = await Analytics.create({});
analytics.record({
  eventName: 'SOME_EVENT_NAME',
  ...
});

To not output the acknowledgement warning, set SFDX_TELEMETRY_DISABLE_ACKNOWLEDGEMENT to true.

export SFDX_TELEMETRY_DISABLE_ACKNOWLEDGEMENT=true

Development

To set up the project, just run yarn && yarn test.

To debug the project, it is helpful to link it in the CLI.

# In sfdx-plugin-analytics
yarn link

# In sfdx-cli
yarn link @salesforce/plugin-analytics
DEBUG=sfdx:analytics ./bin/run force

To debug the spawned process, set the telemetry in debug mode.

SFDX_TELEMETRY_DEBUG=true DEBUG=sfdx:analytics ./bin/run

Current Tags

  • 1.12.0                                ...           latest (a month ago)

15 Versions

  • 1.12.0                                ...           a month ago
  • 1.11.0                                ...           a month ago
  • 1.10.0                                ...           a month ago
  • 1.9.1                                ...           2 months ago
  • 1.9.0                                ...           3 months ago
  • 1.8.0                                ...           5 months ago
  • 1.7.1                                ...           6 months ago
  • 1.7.0                                ...           6 months ago
  • 1.5.2                                ...           6 months ago
  • 1.4.1                                ...           7 months ago
  • 1.2.2                                ...           10 months ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.0                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |