rename some prom metrics and cleanup unused

This commit is contained in:
msukkari 2025-02-25 18:53:56 -08:00
parent fab2fea562
commit 8531b14a82
2 changed files with 6 additions and 22 deletions

View file

@ -5,13 +5,11 @@ export class PromClient {
private registry: Registry;
private app: express.Application;
public activeRepoIndexingJobs: Gauge<string>;
public repoIndexingDuration: Histogram<string>;
public repoIndexingErrorTotal: Counter<string>;
public repoIndexingReattemptsTotal: Counter<string>;
public repoIndexingFailTotal: Counter<string>;
public repoIndexingSuccessTotal: Counter<string>;
public activeRepoGarbageCollectionJobs: Gauge<string>;
public repoGarbageCollectionDuration: Histogram<string>;
public repoGarbageCollectionErrorTotal: Counter<string>;
public repoGarbageCollectionFailTotal: Counter<string>;
public repoGarbageCollectionSuccessTotal: Counter<string>;
@ -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',

View file

@ -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;