Skip to content

Return dummy metrics if ClickHouse host or URL is not set in Rotor#1251

Open
jberlyn wants to merge 1 commit intojitsucom:newjitsufrom
jberlyn:newjitsu
Open

Return dummy metrics if ClickHouse host or URL is not set in Rotor#1251
jberlyn wants to merge 1 commit intojitsucom:newjitsufrom
jberlyn:newjitsu

Conversation

@jberlyn
Copy link
Copy Markdown

@jberlyn jberlyn commented Mar 19, 2026

Problem

When running without ClickHouse (e.g. local dev without the clickhouse service), rotor crashes on startup with CLICKHOUSE_HOST is not defined. This happens because createMetrics() unconditionally calls getClickhouseConfig(), which throws when neither CLICKHOUSE_HOST nor CLICKHOUSE_URL is set.

This issue was raised by someone here:
#1243

Fix

eventsLogger already has a fallback for this case — it uses DummyEventsStore when ClickHouse env vars are absent (src/index.ts:77-81). This PR applies the same pattern to metrics by adding an early return in createMetrics() that yields the already-exported DummyMetrics when ClickHouse isn't configured.

AI Usage Disclosure

I used Claude Code to analyze the rotor codebase and identify the root cause and the existing pattern used for eventsLogger. The fix and this description are my own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants