6.0.3 • Published 8 days ago

@salesforce/telemetry v6.0.3

Weekly downloads
36,778
License
BSD-3-Clause
Repository
github
Last release
8 days ago

sfdx-telemetry

This package serves an interface for Microsoft's Application Insights npm module.

Install

yarn add @salesforce/telemetry --save

Usage

For long running process

import TelemetryReporter from '@salesforce/telemetry';

const reporter = await TelemetryReporter.create({ project: 'my-project-name', key: 'my-instrumentation-key' });
reporter.start();

// Now you can send events and the reporter will batch and send.
reporter.sendTelemetryEvent('event-name', { foo: 'bar', executionTime: 0.5912 });

By default, some common properties are hidden for GDPR. This is to protect client side tools that send telemetry. If the owner of the long running process controls the machines too, you can redefine the GDPR sensitive fields.

const reporter = await TelemetryReporter.create({
  project: 'my-project-name',
  key: 'my-instrumentation-key',
  gdprSensitiveKeys: [],
});

For short lived processes

import TelemetryReporter from '@salesforce/telemetry';

const reporter = await TelemetryReporter.create({ project: 'my-project-name', key: 'my-instrumentation-key' });

// Send events.
reporter.sendTelemetryEvent('event-name', { foo: 'bar', executionTime: 0.5912 });

// When all finished sending events, stop the reporter or the process may hang.
reporter.stop();

Note: For short lived processes, the telemetry can take 0-3 seconds to send all events to the server on stop, and even longer if there is a timeout. It is recommended to send telemetry in a detached spawned process. i.e. spawn(..., { stdio: 'ignore'}).unref();

Env Variables

SF_DISABLE_TELEMETRY: Set to true if you want to disable telemetry.

6.0.3

8 days ago

6.0.2

8 days ago

6.0.1

15 days ago

6.0.0

17 days ago

5.0.21

22 days ago

5.0.20

29 days ago

5.0.19

1 month ago

5.0.18

1 month ago

5.0.16

2 months ago

5.0.17

2 months ago

5.0.15

2 months ago

5.0.14

2 months ago

5.0.12

2 months ago

5.0.13

2 months ago

5.0.11

3 months ago

5.0.10

3 months ago

5.0.9

4 months ago

5.0.8

4 months ago

5.0.7

4 months ago

5.0.6

4 months ago

5.0.5

4 months ago

5.0.4

5 months ago

4.1.8

7 months ago

4.1.7

7 months ago

4.1.9

7 months ago

4.1.20

6 months ago

4.1.21

6 months ago

4.0.10

10 months ago

4.0.7

10 months ago

4.0.16

9 months ago

4.0.15

9 months ago

4.0.12

10 months ago

4.0.11

10 months ago

4.0.14

9 months ago

4.0.13

9 months ago

5.0.3

5 months ago

5.0.2

5 months ago

5.0.1

5 months ago

5.0.0

5 months ago

4.0.9

10 months ago

4.0.8

10 months ago

4.1.10

7 months ago

4.0.17-qa.0

9 months ago

4.1.11

7 months ago

4.1.16

6 months ago

4.1.17

6 months ago

4.1.18

6 months ago

4.1.19

6 months ago

4.1.12

7 months ago

4.1.13

7 months ago

4.1.14

7 months ago

4.1.15

6 months ago

4.1.4

8 months ago

4.1.3

8 months ago

4.1.6

7 months ago

4.1.5

8 months ago

4.1.0

9 months ago

4.1.2

8 months ago

4.1.1

8 months ago

3.2.28

12 months ago

3.2.29

12 months ago

4.0.5

11 months ago

4.0.4

11 months ago

4.0.6

10 months ago

4.0.1

11 months ago

4.0.3

11 months ago

4.0.2

11 months ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.26

12 months ago

3.2.25

1 year ago

3.2.27

12 months ago

3.2.20

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.19

1 year ago

3.2.17

1 year ago

3.2.18

1 year ago

3.2.13

1 year ago

3.2.12

1 year ago

3.2.15

1 year ago

3.2.14

1 year ago

3.2.16

1 year ago

3.2.11

1 year ago

3.2.10

1 year ago

3.2.9

1 year ago

3.2.8

1 year ago

3.2.7

1 year ago

3.2.2

2 years ago

3.2.6

1 year ago

3.2.5

1 year ago

3.2.4

1 year ago

3.2.3

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago