Skip to content

Commit 043e2c2

Browse files
authored
fix: Ensure LMDB store metrics have hard coded descriptions (#10642)
This PR is to fix some of the metrics.
1 parent c75fee0 commit 043e2c2

File tree

4 files changed

+4
-40
lines changed

4 files changed

+4
-40
lines changed

yarn-project/archiver/src/archiver/instrumentation.ts

-9
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ export class ArchiverInstrumentation {
6767

6868
this.dbMetrics = new LmdbMetrics(
6969
meter,
70-
{
71-
description: 'Database map size for the archiver',
72-
},
73-
{
74-
description: 'Database used size for the archiver',
75-
},
76-
{
77-
description: 'Num items in the archiver database',
78-
},
7970
{
8071
[Attributes.DB_DATA_TYPE]: 'archiver',
8172
},

yarn-project/p2p/src/mem_pools/instrumentation.ts

-9
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,6 @@ export class PoolInstrumentation<PoolObject extends Gossipable> {
8787

8888
this.dbMetrics = new LmdbMetrics(
8989
meter,
90-
{
91-
description: 'Database map size for the Tx mempool',
92-
},
93-
{
94-
description: 'Database used size for the Tx mempool',
95-
},
96-
{
97-
description: 'Num items in database for the Tx mempool',
98-
},
9990
{
10091
[Attributes.DB_DATA_TYPE]: 'tx-pool',
10192
},

yarn-project/prover-client/src/proving_broker/proving_broker_database/persisted.ts

-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
1313
constructor(private store: AztecKVStore, client: TelemetryClient) {
1414
this.metrics = new LmdbMetrics(
1515
client.getMeter('KVBrokerDatabase'),
16-
{
17-
description: 'Database map size for the proving broker',
18-
},
19-
{
20-
description: 'Database used size for the proving broker',
21-
},
22-
{ description: 'Number of items in the broker database' },
2316
{
2417
[Attributes.DB_DATA_TYPE]: 'prover-broker',
2518
},

yarn-project/telemetry-client/src/lmdb_metrics.ts

+4-15
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,24 @@ import {
77
ValueType,
88
} from './telemetry.js';
99

10-
export type LmdbMetricDescriptor = {
11-
description: string;
12-
};
13-
1410
export type LmdbStatsCallback = () => { mappingSize: number; numItems: number; actualSize: number };
1511

1612
export class LmdbMetrics {
1713
private dbMapSize: ObservableGauge;
1814
private dbUsedSize: ObservableGauge;
1915
private dbNumItems: ObservableGauge;
2016

21-
constructor(
22-
meter: Meter,
23-
dbMapSizeDescriptor: LmdbMetricDescriptor,
24-
dbUsedSizeDescriptor: LmdbMetricDescriptor,
25-
dbNumItemsDescriptor: LmdbMetricDescriptor,
26-
private attributes?: Attributes,
27-
private getStats?: LmdbStatsCallback,
28-
) {
17+
constructor(meter: Meter, private attributes?: Attributes, private getStats?: LmdbStatsCallback) {
2918
this.dbMapSize = meter.createObservableGauge(DB_MAP_SIZE, {
30-
description: dbMapSizeDescriptor.description,
19+
description: 'LMDB Map Size',
3120
valueType: ValueType.INT,
3221
});
3322
this.dbUsedSize = meter.createObservableGauge(DB_USED_SIZE, {
34-
description: dbUsedSizeDescriptor.description,
23+
description: 'LMDB Used Size',
3524
valueType: ValueType.INT,
3625
});
3726
this.dbNumItems = meter.createObservableGauge(DB_NUM_ITEMS, {
38-
description: dbNumItemsDescriptor.description,
27+
description: 'LMDB Num Items',
3928
valueType: ValueType.INT,
4029
});
4130

0 commit comments

Comments
 (0)