Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(telemetry): update telemetry event aggregation timeout and interval

Victor Hugo dos Santos27226efb3e1e
diff --git a/backend/src/keystore/keystore.ts b/backend/src/keystore/keystore.ts
index 18bdfdc12a..1898f52685 100644
--- a/backend/src/keystore/keystore.ts
+++ b/backend/src/keystore/keystore.ts
@@ -199,7 +199,7 @@ export const KeyStoreTtls = {
StepUpMfaAttemptWindowInSeconds: 300, // 5 minutes - rolling window for counting failed step-up attempts
StepUpMfaLockoutInSeconds: 300, // 5 minutes - temporary lockout after too many failed step-up attempts
TelemetryGroupIdentifyInSeconds: 3600, // 1 hour
- TelemetryAggregatedEventInSeconds: 600, // 10 minutes
+ TelemetryAggregatedEventInSeconds: 1800, // 30 minutes
SecretEtagInSeconds: 900, // 15 minutes
PkiAcmeNonceInSeconds: 300, // 5 minutes
GatewayRelayCredentialInSeconds: 600, // 10 minutes - TURN credential lifetime
diff --git a/backend/src/services/telemetry/telemetry-queue.ts b/backend/src/services/telemetry/telemetry-queue.ts
index a61d5d40b8..05475b5122 100644
--- a/backend/src/services/telemetry/telemetry-queue.ts
+++ b/backend/src/services/telemetry/telemetry-queue.ts
@@ -14,6 +14,8 @@ import {
} from "./telemetry-service";
import { PostHogEventTypes } from "./telemetry-types";
+const AGGREGATED_EVENTS_HANDLER_TIMEOUT_MS = 8 * 60 * 1000;
+
type TTelemetryQueueServiceFactoryDep = {
cronJob: TCronJobFactory;
keyStore: Pick<TKeyStoreFactory, "getItem" | "deleteItem">;
@@ -75,8 +77,10 @@ export const telemetryQueueServiceFactory = ({
cronJob.register({
name: CronJobName.TelemetryAggregatedEvents,
- pattern: "*/5 * * * *",
+ pattern: "*/10 * * * *",
runHashTtlS: 60 * 60,
+ handlerTimeoutMs: AGGREGATED_EVENTS_HANDLER_TIMEOUT_MS,
+ leaseDurationMs: AGGREGATED_EVENTS_HANDLER_TIMEOUT_MS,
handler: async () => {
await telemetryService.processAggregatedEvents();
}