Skip to content

The open alternative to Salesforce, designed for AI.

feat(server): attach app attributes to application rate-limited metric (#23500)

Paul Rastoine99452e00daa
diff --git a/packages/twenty-server/src/engine/api/common/common-query-runners/common-base-query-runner.service.ts b/packages/twenty-server/src/engine/api/common/common-query-runners/common-base-query-runner.service.ts
index 0189c6c80f8..6ba0750ce62 100644
--- a/packages/twenty-server/src/engine/api/common/common-query-runners/common-base-query-runner.service.ts
+++ b/packages/twenty-server/src/engine/api/common/common-query-runners/common-base-query-runner.service.ts
@@ -373,6 +373,11 @@ export abstract class CommonBaseQueryRunnerService<
await this.metricsService.incrementCounterForEvent({
key: MetricsKeys.CommonApiApplicationQueryRateLimited,
shouldStoreInCache: false,
+ attributes: {
+ universal_identifier: authContext.application.universalIdentifier,
+ app_name: authContext.application.name,
+ source_type: authContext.application.sourceType,
+ },
});
}