Skip to content

Commit 02408ce

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c1e8f73 commit 02408ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

disk-buffering/src/test/java/io/opentelemetry/contrib/disk/buffering/IntegrationTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,20 @@ private void createMetric() {
285285
clearInvocations(metricCallback);
286286
}
287287

288+
private static final String TEST_METRIC_INSTRUMENTATION_SCOPE_NAME = "MetricInstrumentationScope";
289+
288290
/**
289291
* Filters out upstream's self-instrumentation metrics (e.g. {@code
290292
* otel.sdk.metric_reader.collection.duration}) that {@link PeriodicMetricReader} automatically
291293
* records, returning only metrics from the test's instrumentation scope.
292294
*/
293295
private static List<MetricData> filterTestMetrics(List<MetricData> metrics) {
294296
return metrics.stream()
295-
.filter(m -> m.getInstrumentationScopeInfo().getName().equals("MetricInstrumentationScope"))
297+
.filter(
298+
m ->
299+
m.getInstrumentationScopeInfo()
300+
.getName()
301+
.equals(TEST_METRIC_INSTRUMENTATION_SCOPE_NAME))
296302
.collect(Collectors.toList());
297303
}
298304

0 commit comments

Comments
 (0)