diff --git a/src/shadowbox/server/shared_metrics.ts b/src/shadowbox/server/shared_metrics.ts index 7534ebfab..a02e0e4fa 100644 --- a/src/shadowbox/server/shared_metrics.ts +++ b/src/shadowbox/server/shared_metrics.ts @@ -94,9 +94,12 @@ export class PrometheusUsageMetrics implements UsageMetrics { constructor(private prometheusClient: PrometheusClient) {} - private async queryUsage(metric: string, deltaSecs: number): Promise { + private async queryUsage( + timeSeriesSelector: string, + deltaSecs: number + ): Promise { const query = ` - sum(increase(${metric}[${deltaSecs}s])) + sum(increase(${timeSeriesSelector}[${deltaSecs}s])) by (${PROMETHEUS_COUNTRY_LABEL}, ${PROMETHEUS_ASN_LABEL}) `; const queryResponse = await this.prometheusClient.query(query);