Skip to content

Commit 736db6f

Browse files
committed
Add gitpod_host to custom configcat custom attributes
1 parent 993213d commit 736db6f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gitpod-shared/src/experiments.ts

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type EXPERIMENTAL_SETTINGS = |
1717

1818
export class ExperimentalSettings {
1919
private configcatClient: configcatcommon.IConfigCatClient;
20+
private gitpodHostUrl: URL | undefined;
2021

2122
constructor(
2223
key: string,
@@ -26,6 +27,10 @@ export class ExperimentalSettings {
2627
private readonly pendingOwner: Promise<User>,
2728
private readonly pendingTeams: Promise<Team[]>,
2829
) {
30+
try {
31+
this.gitpodHostUrl = new URL(gitpodHost);
32+
} catch {
33+
}
2934
this.configcatClient = configcat.createClientWithLazyLoad(key, {
3035
baseUrl: new URL('/configcat', context.extensionMode === vscode.ExtensionMode.Production ? gitpodHost : 'https://gitpod-staging.com').href,
3136
logger: {
@@ -81,6 +86,9 @@ export class ExperimentalSettings {
8186
if (teamId) {
8287
attributes["team_id"] = teamId;
8388
}
89+
if (this.gitpodHostUrl) {
90+
attributes["gitpod_host"] = this.gitpodHostUrl.host;
91+
}
8492
return new configcatcommon.User(userId, email, undefined, attributes);
8593
}
8694

0 commit comments

Comments
 (0)