diff --git a/packages/backend/src/promClient.ts b/packages/backend/src/promClient.ts index 7dbcdbc0..70f75517 100644 --- a/packages/backend/src/promClient.ts +++ b/packages/backend/src/promClient.ts @@ -5,13 +5,11 @@ export class PromClient { private registry: Registry; private app: express.Application; public activeRepoIndexingJobs: Gauge; - public repoIndexingDuration: Histogram; - public repoIndexingErrorTotal: Counter; + public repoIndexingReattemptsTotal: Counter; public repoIndexingFailTotal: Counter; public repoIndexingSuccessTotal: Counter; public activeRepoGarbageCollectionJobs: Gauge; - public repoGarbageCollectionDuration: Histogram; public repoGarbageCollectionErrorTotal: Counter; public repoGarbageCollectionFailTotal: Counter; public repoGarbageCollectionSuccessTotal: Counter; @@ -28,19 +26,12 @@ export class PromClient { }); this.registry.registerMetric(this.activeRepoIndexingJobs); - this.repoIndexingDuration = new Histogram({ - name: 'repo_indexing_duration', - help: 'The duration of repo indexing jobs', + this.repoIndexingReattemptsTotal = new Counter({ + name: 'repo_indexing_reattempts', + help: 'The number of repo indexing reattempts', labelNames: ['repo'], }); - this.registry.registerMetric(this.repoIndexingDuration); - - this.repoIndexingErrorTotal = new Counter({ - name: 'repo_indexing_errors', - help: 'The number of repo indexing errors', - labelNames: ['repo'], - }); - this.registry.registerMetric(this.repoIndexingErrorTotal); + this.registry.registerMetric(this.repoIndexingReattemptsTotal); this.repoIndexingFailTotal = new Counter({ name: 'repo_indexing_fails', @@ -63,13 +54,6 @@ export class PromClient { }); this.registry.registerMetric(this.activeRepoGarbageCollectionJobs); - this.repoGarbageCollectionDuration = new Histogram({ - name: 'repo_garbage_collection_duration', - help: 'The duration of repo garbage collection jobs', - labelNames: ['repo'], - }); - this.registry.registerMetric(this.repoGarbageCollectionDuration); - this.repoGarbageCollectionErrorTotal = new Counter({ name: 'repo_garbage_collection_errors', help: 'The number of repo garbage collection errors', diff --git a/packages/backend/src/repoManager.ts b/packages/backend/src/repoManager.ts index 6941532c..20bbd959 100644 --- a/packages/backend/src/repoManager.ts +++ b/packages/backend/src/repoManager.ts @@ -259,7 +259,7 @@ export class RepoManager implements IRepoManager { break; } catch (error) { attempts++; - this.promClient.repoIndexingErrorTotal.inc(); + this.promClient.repoIndexingReattemptsTotal.inc(); if (attempts === maxAttempts) { this.logger.error(`Failed to sync repository ${repo.id} after ${maxAttempts} attempts. Error: ${error}`); throw error;