Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Nothing should go in this section, please add to the latest unreleased version
(and update the corresponding date), or add a new version.

## [1.24.1] - 2026-06-11

### Fixed
- Fixed the server failing to boot when telemetry is enabled
(`CONJUR_TELEMETRY_ENABLED=true`): `Monitoring::Metrics::AuthenticatorGauge`
no longer resolves autoloaded application constants
(`DB::Repository::AuthenticatorConfigRepository`,
`Authentication::ImplementedAuthenticators`) during Rails initialization;
they are now resolved lazily on the first metrics update.
[cyberark/conjur#3026](https://github.com/cyberark/conjur/issues/3026)

## [1.24.0] - 2025-11-10

### Changed
Expand Down
14 changes: 9 additions & 5 deletions lib/monitoring/metrics/authenticator_gauge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ module Metrics
class AuthenticatorGauge
attr_reader :registry, :pubsub, :metric_name, :docstring, :labels, :sub_event_name

def initialize(
installed_authenticators: DB::Repository::AuthenticatorConfigRepository.new,
implemented_authenticators: Authentication::ImplementedAuthenticators
)
def initialize(installed_authenticators: nil, implemented_authenticators: nil)
@metric_name = :conjur_server_authenticator
@docstring = 'Number of authenticators enabled'
@labels = %i[type status]
Expand All @@ -19,7 +16,7 @@ def initialize(
def setup(registry, pubsub)
@registry = registry
@pubsub = pubsub

# Create/register the metric
Metrics.create_metric(self, :gauge)

Expand All @@ -28,6 +25,13 @@ def setup(registry, pubsub)
end

def update(*_payload)
# Resolve application constants lazily: this class is instantiated from
# config/initializers/prometheus.rb, before app constants under
# app/db and app/domain are autoloadable. By the time update runs
# (first request, via the initializer's lazy_init), autoloading is ready.
@installed_authenticators ||= DB::Repository::AuthenticatorConfigRepository.new
@implemented_authenticators ||= Authentication::ImplementedAuthenticators

metric = registry.get(metric_name)
update_enabled_authenticators(metric)
update_installed_authenticators(metric)
Expand Down