Skip to content

Commit 0985da3

Browse files
committed
fix(webapp): default LLM_PRICING_RELOAD_PUBSUB_ENABLED to off
Most processes that import the registry (dashboard, workers, single- service self-hosted webapp) don't actually need real-time pricing freshness — the existing 5-minute interval is fine. Only OTel-ingesting services where pricing directly affects span cost enrichment need to subscribe. Default off, opt-in on the span-ingesting services in multi-service deployments. Self-hosters running a single webapp can flip it on if they want sub-second freshness, but the default keeps reload load off processes that don't benefit from it.
1 parent 1381c9d commit 0985da3

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/webapp/app/env.server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,11 +1427,11 @@ const EnvironmentSchema = z
14271427
LLM_PRICING_RELOAD_CHANNEL: z.string().default("llm-registry:reload"),
14281428
LLM_PRICING_RELOAD_DEBOUNCE_MS: z.coerce.number().int().default(1000),
14291429
// Whether to subscribe this process to the LLM_PRICING_RELOAD_CHANNEL.
1430-
// Defaults to true so single-service self-hosted deployments work without
1431-
// tuning. In multi-service deployments, set this to false on services
1432-
// that don't ingest spans (dashboard, workers) — only the OTel-ingesting
1433-
// services need the registry to reload in real time.
1434-
LLM_PRICING_RELOAD_PUBSUB_ENABLED: BoolEnv.default(true),
1430+
// Default off — only OTel-ingesting services need real-time pricing
1431+
// freshness; dashboard/worker processes are fine on the existing
1432+
// 5-minute periodic reload. In multi-service deployments, set this to
1433+
// true on the span-ingesting services.
1434+
LLM_PRICING_RELOAD_PUBSUB_ENABLED: BoolEnv.default(false),
14351435
LLM_PRICING_SEED_ON_STARTUP: BoolEnv.default(false),
14361436
LLM_PRICING_READY_TIMEOUT_MS: z.coerce.number().int().default(500),
14371437
LLM_METRICS_BATCH_SIZE: z.coerce.number().int().default(5000),

apps/webapp/app/v3/llmPricingRegistry.server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export const llmPricingRegistry = singleton("llmPricingRegistry", () => {
3737
});
3838
}, reloadInterval);
3939

40-
// Pub/sub reload is opt-in per process. Without it, the registry stays
41-
// accurate via the existing 5-minute interval. In multi-service deployments
42-
// we only want the OTel-ingesting services subscribed — the dashboard and
43-
// worker services don't need real-time pricing freshness and shouldn't pile
44-
// onto each publish with a full-table reload.
40+
// Pub/sub reload is opt-in per process (default off). Without it, the
41+
// registry stays accurate via the existing 5-minute interval. Enable on
42+
// the OTel-ingesting services where pricing freshness directly affects
43+
// span cost enrichment; dashboard and worker services don't need it and
44+
// shouldn't pile onto each publish with a full-table reload.
4545
if (env.LLM_PRICING_RELOAD_PUBSUB_ENABLED) {
4646
const subscriber = createRedisClient("llm-pricing:subscriber", {
4747
keyPrefix: "llm-pricing:subscriber:",

0 commit comments

Comments
 (0)