Skip to content

Commit

Permalink
fix: password auth metrics (#8735)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Nov 13, 2024
1 parent cb316f0 commit 61e297d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/features/instance-stats/instance-stats-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ export class InstanceStatsService {
'unleash.auth.simple',
);

return settings?.disabled !== false;
return (
typeof settings?.disabled === 'undefined' ||
settings.disabled === false
);
}

async hasSCIM(): Promise<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export function registerPrometheusMetrics(
});

dbMetrics.registerGaugeDbMetric({
name: 'password_auth',
name: 'password_auth_enabled',
help: 'Whether password auth is enabled',
query: () => instanceStatsService.hasPasswordAuth(),
map: (result) => ({ value: result ? 1 : 0 }),
Expand Down

0 comments on commit 61e297d

Please sign in to comment.