Skip to content

Commit 43db2c0

Browse files
committed
Include proxy version in telemetry
1 parent 6308e36 commit 43db2c0

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/start-proxy-action.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
122122
languages: language === undefined ? undefined : [language],
123123
},
124124
proxyConfig.all_credentials.map((c) => c.type),
125+
{ proxy_version: proxyBin.version },
125126
logger,
126127
);
127128
} catch (unwrappedError) {

‎src/start-proxy/status-report.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,30 @@ import {
1212
} from "../status-report";
1313
import * as util from "../util";
1414

15+
/** Additional status report data from `start-proxy`. */
16+
export interface StartProxyStatus {
17+
proxy_version: string;
18+
}
19+
20+
/** The type of successful status reports from `start-proxy`. */
21+
type StartProxySuccessReport = StatusReportBase & {
22+
start_proxy: StartProxyStatus;
23+
};
24+
1525
/**
1626
* Sends a status report for the `start-proxy` action indicating a successful outcome.
1727
*
1828
* @param startedAt When the action was started.
1929
* @param config The configuration used.
2030
* @param registry_types The types of registries that are configured.
31+
* @param status Status information.
2132
* @param logger The logger to use.
2233
*/
2334
export async function sendSuccessStatusReport(
2435
startedAt: Date,
2536
config: Partial<Config>,
2637
registry_types: string[],
38+
status: StartProxyStatus,
2739
logger: Logger,
2840
) {
2941
const statusReportBase = await createStatusReportBase(
@@ -35,9 +47,10 @@ export async function sendSuccessStatusReport(
3547
logger,
3648
);
3749
if (statusReportBase !== undefined) {
38-
const statusReport: StatusReportBase = {
50+
const statusReport: StartProxySuccessReport = {
3951
...statusReportBase,
4052
registry_types: registry_types.join(","),
53+
start_proxy: status,
4154
};
4255
await sendStatusReport(statusReport);
4356
}

0 commit comments

Comments
 (0)