This package has been deprecated

Author message:

This package has been deprecated in favor of https://www.npmjs.com/package/@salesforce/plugin-telemetry

@salesforce/plugin-analytics

1.12.1 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @salesforce/plugin-analytics

Weekly Downloads

7,194

Version

1.12.1

License

BSD-3-Clause

Unpacked Size

56 kB

Total Files

31

Last publish

Collaborators

  • dme722
  • nolanlawson
  • ire-npm-team-user
  • jburnie
  • abirchfieldsfdc
  • dlouvton
  • mobify
  • jmsjtu
  • jasonschroeder-sfdc
  • packagellama
  • maward
  • danielshox
  • duane.chew
  • dferro
  • jcourtner
  • jye-sf
  • adirasanam
  • hkii
  • iamaziz
  • dbreese-salesforce
  • ashokrudraraju
  • dhersam
  • demianbrecht
  • mbettio
  • damilareolowoniyi
  • mmadialagan
  • mjrust
  • salesforce-releases
  • mpsenn
  • kevinv11n
  • byao
  • pmdartus
  • ekashida
  • gr8gatsby
  • ravi.jayaramappa
  • apapko
  • jleen-sfdc
  • jqian
  • cwallsf
  • dhagberg-sf
  • khawkins
  • amphro
  • jodarove
  • sfdctaka
  • fernomac
  • jimjag
  • ivarley
  • jbartolotta-sfdc