mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
feat: metrics for password and scim enabled (#8730)
This commit is contained in:
parent
7feba0c4d4
commit
bb0403d551
@ -219,6 +219,22 @@ export class InstanceStatsService {
|
|||||||
return settings?.enabled || false;
|
return settings?.enabled || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async hasPasswordAuth(): Promise<boolean> {
|
||||||
|
const settings = await this.settingStore.get<{ disabled: boolean }>(
|
||||||
|
'unleash.auth.simple',
|
||||||
|
);
|
||||||
|
|
||||||
|
return settings?.disabled !== false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async hasSCIM(): Promise<boolean> {
|
||||||
|
const settings = await this.settingStore.get<{ enabled: boolean }>(
|
||||||
|
'scim',
|
||||||
|
);
|
||||||
|
|
||||||
|
return settings?.enabled || false;
|
||||||
|
}
|
||||||
|
|
||||||
async getStats(): Promise<InstanceStats> {
|
async getStats(): Promise<InstanceStats> {
|
||||||
const versionInfo = await this.versionService.getVersionInfo();
|
const versionInfo = await this.versionService.getVersionInfo();
|
||||||
const [
|
const [
|
||||||
@ -239,6 +255,8 @@ export class InstanceStatsService {
|
|||||||
strategies,
|
strategies,
|
||||||
SAMLenabled,
|
SAMLenabled,
|
||||||
OIDCenabled,
|
OIDCenabled,
|
||||||
|
passwordAuthEnabled,
|
||||||
|
SCIMenabled,
|
||||||
clientApps,
|
clientApps,
|
||||||
featureExports,
|
featureExports,
|
||||||
featureImports,
|
featureImports,
|
||||||
@ -265,6 +283,8 @@ export class InstanceStatsService {
|
|||||||
this.strategiesCount(),
|
this.strategiesCount(),
|
||||||
this.hasSAML(),
|
this.hasSAML(),
|
||||||
this.hasOIDC(),
|
this.hasOIDC(),
|
||||||
|
this.hasPasswordAuth(),
|
||||||
|
this.hasSCIM(),
|
||||||
this.appCount ? this.appCount : this.getLabeledAppCounts(),
|
this.appCount ? this.appCount : this.getLabeledAppCounts(),
|
||||||
this.eventStore.deprecatedFilteredCount({
|
this.eventStore.deprecatedFilteredCount({
|
||||||
type: FEATURES_EXPORTED,
|
type: FEATURES_EXPORTED,
|
||||||
|
@ -407,6 +407,20 @@ export function registerPrometheusMetrics(
|
|||||||
map: (result) => ({ value: result ? 1 : 0 }),
|
map: (result) => ({ value: result ? 1 : 0 }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dbMetrics.registerGaugeDbMetric({
|
||||||
|
name: 'password_auth',
|
||||||
|
help: 'Whether password auth is enabled',
|
||||||
|
query: () => instanceStatsService.hasPasswordAuth(),
|
||||||
|
map: (result) => ({ value: result ? 1 : 0 }),
|
||||||
|
});
|
||||||
|
|
||||||
|
dbMetrics.registerGaugeDbMetric({
|
||||||
|
name: 'scim_enabled',
|
||||||
|
help: 'Whether SCIM is enabled',
|
||||||
|
query: () => instanceStatsService.hasSCIM(),
|
||||||
|
map: (result) => ({ value: result ? 1 : 0 }),
|
||||||
|
});
|
||||||
|
|
||||||
const clientSdkVersionUsage = createCounter({
|
const clientSdkVersionUsage = createCounter({
|
||||||
name: 'client_sdk_versions',
|
name: 'client_sdk_versions',
|
||||||
help: 'Which sdk versions are being used',
|
help: 'Which sdk versions are being used',
|
||||||
|
Loading…
Reference in New Issue
Block a user