add histogram for gpa fetch

This commit is contained in:
wphan
2023-11-30 18:59:31 -08:00
parent 06b428e386
commit a11c5b67d3
2 changed files with 18 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ enum METRIC_TYPES {
runtime_specs = 'runtime_specs',
endpoint_response_times_histogram = 'endpoint_response_times_histogram',
endpoint_response_status = 'endpoint_response_status',
gpa_fetch_duration = 'endpoint_response_status',
health_status = 'health_status',
}
@@ -70,6 +71,12 @@ const meterProvider = new MeterProvider({
meterName,
aggregation: createHistogramBuckets(0, 20, 30),
}),
new View({
instrumentName: METRIC_TYPES.gpa_fetch_duration,
instrumentType: InstrumentType.HISTOGRAM,
meterName,
aggregation: createHistogramBuckets(0, 500, 20),
}),
],
});
meterProvider.addMetricReader(exporter);
@@ -109,6 +116,13 @@ const endpointResponseTimeHistogram = meter.createHistogram(
unit: 'ms',
}
);
const gpaFetchDurationHistogram = meter.createHistogram(
METRIC_TYPES.gpa_fetch_duration,
{
description: 'Duration of GPA fetches',
unit: 'ms',
}
);
const responseStatusCounter = meter.createCounter(
METRIC_TYPES.endpoint_response_status,
@@ -170,6 +184,7 @@ const handleHealthCheck = (slotSource: SlotSource) => {
export {
endpointResponseTimeHistogram,
gpaFetchDurationHistogram,
responseStatusCounter,
handleHealthCheck,
};