From eb6d62338a3a83114d777d4fff63de5444739f27 Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Wed, 6 Dec 2023 10:46:07 +0100 Subject: [PATCH] Review fixes --- .../apm/agent/embeddedotel/proxy/ProxyLongHistogramBuilder.java | 2 +- .../apm/agent/otelmetricsdk/ElasticOtelMetricsExporter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-embedded-metrics-sdk/src/main/java/co/elastic/apm/agent/embeddedotel/proxy/ProxyLongHistogramBuilder.java b/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-embedded-metrics-sdk/src/main/java/co/elastic/apm/agent/embeddedotel/proxy/ProxyLongHistogramBuilder.java index 6f21a53441..4ff5bee219 100644 --- a/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-embedded-metrics-sdk/src/main/java/co/elastic/apm/agent/embeddedotel/proxy/ProxyLongHistogramBuilder.java +++ b/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-embedded-metrics-sdk/src/main/java/co/elastic/apm/agent/embeddedotel/proxy/ProxyLongHistogramBuilder.java @@ -31,7 +31,7 @@ public class ProxyLongHistogramBuilder { public ProxyLongHistogramBuilder(LongHistogramBuilder delegate) { this.delegate = delegate; - //apply default bucket boundaries + //apply default bucket boundaries, they are guaranteed to be ordered List boundaries = GlobalTracer.get().getConfig(MetricsConfiguration.class).getCustomMetricsHistogramBoundaries(); delegate.setExplicitBucketBoundariesAdvice(convertToLongBoundaries(boundaries)); } diff --git a/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-metricsdk-plugin/src/main/java/co/elastic/apm/agent/otelmetricsdk/ElasticOtelMetricsExporter.java b/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-metricsdk-plugin/src/main/java/co/elastic/apm/agent/otelmetricsdk/ElasticOtelMetricsExporter.java index d07abdbe53..950459f4c2 100644 --- a/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-metricsdk-plugin/src/main/java/co/elastic/apm/agent/otelmetricsdk/ElasticOtelMetricsExporter.java +++ b/apm-agent-plugins/apm-opentelemetry/apm-opentelemetry-metricsdk-plugin/src/main/java/co/elastic/apm/agent/otelmetricsdk/ElasticOtelMetricsExporter.java @@ -121,7 +121,7 @@ private static boolean checkOtelApiSupportsHistogramBucketAdvice() { try { DoubleHistogramBuilder.class.getMethod("setExplicitBucketBoundariesAdvice", List.class); return true; - } catch (NoSuchMethodException e) { + } catch (NoSuchMethodException | SecurityException e) { return false; } }