-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JMX Metrics to OTLP & Breeze #3406
Conversation
…stead of 2 - seems like timing issue
…r metric when defaults not in json
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/applicationinsights/agent/internal/init/PerformanceCounterInitializer.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java
Outdated
Show resolved
Hide resolved
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/applicationinsights/agent/internal/init/PerformanceCounterInitializer.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/applicationinsights/agent/internal/init/PerformanceCounterInitializer.java
Outdated
Show resolved
Hide resolved
…ar/ApplicationInsights-Java into harskaur/jmkMetricsToOtlp
…ar/ApplicationInsights-Java into harskaur/jmkMetricsToOtlp
.../JmxMetric/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/JmxMetricTest.java
Outdated
Show resolved
Hide resolved
} catch (RuntimeException e) { | ||
try (MDC.MDCCloseable ignored = CUSTOM_JMX_METRIC_ERROR.makeActive()) { | ||
logger.error("Failed to register JMX performance counters: '{}'", e.toString()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like previously we had try/catch around each JMX metric, which could be better since then a single JMX metric problem wouldn't affect the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is another try block above.
This PR contains changes for customers to collect JMX metrics via OTLP and application insights. It expects that the customer sets the environment variable or system property for the otel metrics exporter to use OTLP when launching their own application. However, application insights will set the
otel.metric.export.interval
to matchmetricIntervalSeconds
from applicationinsights.json. An example launch of the spring pet clinic sample app below:java -javaagent:"<path to app insights java agent>" -Dotel.metrics.exporter=otlp -jar target\spring-petclinic-3.1.0-SNAPSHOT.jar
A customer could then set up an OTLP collector/endpoint to receive metrics.
A few notes about behavior:
observableDoubleMeasurement
that gets observed once for export to Breeze and another time for the OTLP collector. This behavior may be revisited in a future sprint./
characters open-telemetry/opentelemetry-specification#3422 (comment)). I am working on a separate PR to make sure that the jmx metric still reports to Breeze the original spaces: Using the jmx metric attribute as the metric name for JMX metrics Azure/azure-sdk-for-java#37880Test coverage: