Skip to content

Commit 8531b14

Browse files
committed
rename some prom metrics and cleanup unused
1 parent fab2fea commit 8531b14

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

packages/backend/src/promClient.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ export class PromClient {
55
private registry: Registry;
66
private app: express.Application;
77
public activeRepoIndexingJobs: Gauge<string>;
8-
public repoIndexingDuration: Histogram<string>;
9-
public repoIndexingErrorTotal: Counter<string>;
8+
public repoIndexingReattemptsTotal: Counter<string>;
109
public repoIndexingFailTotal: Counter<string>;
1110
public repoIndexingSuccessTotal: Counter<string>;
1211

1312
public activeRepoGarbageCollectionJobs: Gauge<string>;
14-
public repoGarbageCollectionDuration: Histogram<string>;
1513
public repoGarbageCollectionErrorTotal: Counter<string>;
1614
public repoGarbageCollectionFailTotal: Counter<string>;
1715
public repoGarbageCollectionSuccessTotal: Counter<string>;
@@ -28,19 +26,12 @@ export class PromClient {
2826
});
2927
this.registry.registerMetric(this.activeRepoIndexingJobs);
3028

31-
this.repoIndexingDuration = new Histogram({
32-
name: 'repo_indexing_duration',
33-
help: 'The duration of repo indexing jobs',
29+
this.repoIndexingReattemptsTotal = new Counter({
30+
name: 'repo_indexing_reattempts',
31+
help: 'The number of repo indexing reattempts',
3432
labelNames: ['repo'],
3533
});
36-
this.registry.registerMetric(this.repoIndexingDuration);
37-
38-
this.repoIndexingErrorTotal = new Counter({
39-
name: 'repo_indexing_errors',
40-
help: 'The number of repo indexing errors',
41-
labelNames: ['repo'],
42-
});
43-
this.registry.registerMetric(this.repoIndexingErrorTotal);
34+
this.registry.registerMetric(this.repoIndexingReattemptsTotal);
4435

4536
this.repoIndexingFailTotal = new Counter({
4637
name: 'repo_indexing_fails',
@@ -63,13 +54,6 @@ export class PromClient {
6354
});
6455
this.registry.registerMetric(this.activeRepoGarbageCollectionJobs);
6556

66-
this.repoGarbageCollectionDuration = new Histogram({
67-
name: 'repo_garbage_collection_duration',
68-
help: 'The duration of repo garbage collection jobs',
69-
labelNames: ['repo'],
70-
});
71-
this.registry.registerMetric(this.repoGarbageCollectionDuration);
72-
7357
this.repoGarbageCollectionErrorTotal = new Counter({
7458
name: 'repo_garbage_collection_errors',
7559
help: 'The number of repo garbage collection errors',

packages/backend/src/repoManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export class RepoManager implements IRepoManager {
259259
break;
260260
} catch (error) {
261261
attempts++;
262-
this.promClient.repoIndexingErrorTotal.inc();
262+
this.promClient.repoIndexingReattemptsTotal.inc();
263263
if (attempts === maxAttempts) {
264264
this.logger.error(`Failed to sync repository ${repo.id} after ${maxAttempts} attempts. Error: ${error}`);
265265
throw error;

0 commit comments

Comments
 (0)