Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
fix: alias telemetry types as TelemetryData
Browse files Browse the repository at this point in the history
  • Loading branch information
jgellin-sf committed Jan 13, 2020
1 parent 088b604 commit b7e05ff
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/telemetry/src/telemetryReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type Attributes = {
[key: string]: string | number | undefined;
};

type TelemetryData = EventTelemetry | ExceptionTelemetry | MetricTelemetry | TraceTelemetry;

enum TelemetryMethod {
EVENT = 'trackEvent',
EXCEPTION = 'trackException',
Expand Down Expand Up @@ -102,11 +104,7 @@ export class TelemetryReporter extends AsyncCreatable<TelemetryOptions> {
this.sendTelemetry(TelemetryMethod.METRIC, metricName, { name: metricName, value, properties });
}

private sendTelemetry(
method: TelemetryMethod,
message: string,
data: EventTelemetry | ExceptionTelemetry | MetricTelemetry | TraceTelemetry
): void {
private sendTelemetry(method: TelemetryMethod, message: string, data: TelemetryData): void {
if (!isSfdxTelemetryEnabled(this.env)) return;

if (this.appInsightsClient) {
Expand Down

0 comments on commit b7e05ff

Please sign in to comment.