1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

feat: report hostedBy and licenseType (#10141)

Added two new fields to FeatureInfo (what gets reported as telemetry)
reporting license type and hostedBy. Will be overriden in Enterprise.
This commit is contained in:
Christopher Kolstad 2025-06-13 14:44:21 +02:00 committed by GitHub
parent dbc34a10bd
commit c13ab85b1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View File

@ -433,6 +433,8 @@ export class InstanceStatsService {
userActive,
productionChanges,
postgresVersion,
licenseType,
hostedBy,
] = await Promise.all([
this.getToggleCount(),
this.getRegisteredUsers(),
@ -454,6 +456,8 @@ export class InstanceStatsService {
this.getActiveUsers(),
this.getProductionChanges(),
this.postgresVersion(),
this.getLicenseType(),
this.getHostedBy(),
]);
const versionInfo = await this.versionService.getVersionInfo();
@ -487,10 +491,20 @@ export class InstanceStatsService {
productionChanges60: productionChanges.last60,
productionChanges90: productionChanges.last90,
postgresVersion,
licenseType,
hostedBy,
};
return featureInfo;
}
getHostedBy(): string {
return 'self-hosted';
}
getLicenseType(): string {
return 'oss';
}
featuresExported(): Promise<number> {
return this.memorize('searchEventsCountFeaturesExported', () =>
this.eventStore.searchEventsCount([

View File

@ -41,6 +41,8 @@ const fakeTelemetryData = {
productionChanges60: 0,
productionChanges90: 0,
postgresVersion: '17.1 (Debian 17.1-1.pgdg120+1)',
licenseType: 'test',
hostedBy: 'self-hosted',
};
test('yields current versions', async () => {

View File

@ -50,6 +50,8 @@ export interface IFeatureUsageInfo {
productionChanges60: number;
productionChanges90: number;
postgresVersion: string;
licenseType: string;
hostedBy: string;
}
export default class VersionService {