Skip to content

Commit 2eab2da

Browse files
authored
Correct metric type. (#10987)
This metric should be a DD distribution instead of a gauge since we want percentiles.
1 parent 6564996 commit 2eab2da

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/DogStatsDMetricSingleton.java

+12
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,16 @@ public static void recordTimeGlobal(final MetricsRegistry metric, final Runnable
159159
recordTimeGlobal(metric, val, tags);
160160
}
161161

162+
/**
163+
* Wrapper around {@link #recordTimeGlobal(MetricsRegistry, double, String...)} with a different
164+
* name to better represent what this function does.
165+
*
166+
* @param metric
167+
* @param val
168+
* @param tags
169+
*/
170+
public static void percentile(final MetricsRegistry metric, final double val, final String... tags) {
171+
recordTimeGlobal(metric, val, tags);
172+
}
173+
162174
}

airbyte-metrics/reporter/src/main/java/io/airbyte/metrics/reporter/ReporterApp.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static void main(final String[] args) throws IOException, InterruptedExce
7272
try {
7373
final var age = configDatabase.query(MetricQueries::numberOfActiveConnPerWorkspace);
7474
for (long count : age) {
75-
DogStatsDMetricSingleton.gauge(MetricsRegistry.NUM_ACTIVE_CONN_PER_WORKSPACE, count);
75+
DogStatsDMetricSingleton.percentile(MetricsRegistry.NUM_ACTIVE_CONN_PER_WORKSPACE, count);
7676
}
7777
} catch (final SQLException e) {
7878
e.printStackTrace();

0 commit comments

Comments
 (0)