Skip to content

Commit b99d144

Browse files
authored
Add implementation of dependency metric collection for Livemetrics (#883)
* add implementation of dependency metric collection for QP * Fix Dependency metrics in Livestream
1 parent f448119 commit b99d144

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- Deprecated `ApplicationInsightsHttpResponseWrapper`
1212
- Fixed [#826](https://github.com/Microsoft/ApplicationInsights-Java/issues/826) Remove duplicate provider.
1313
- Fix incorrect sdk version being sent in Quick Pulse payload.
14+
- Fix [#882](https://github.com/Microsoft/ApplicationInsights-Java/issues/882) Dependency metrics does not show up on
15+
Livemetrics UX.
1416

1517
# Version 2.3.1
1618
- Fixed [#799](https://github.com/Microsoft/ApplicationInsights-Java/issues/799) Removed dependency on Guava vulnerable to [CVE-2018-10237](https://nvd.nist.gov/vuln/detail/CVE-2018-10237).

core/src/main/java/com/microsoft/applicationinsights/internal/quickpulse/QuickPulseDataCollector.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ public void add(Telemetry telemetry) {
177177
}
178178

179179
private void addDependency(RemoteDependencyTelemetry telemetry) {
180+
Counters counters = this.counters.get();
181+
if (counters == null) {
182+
return;
183+
}
184+
counters.rddsAndDuations.addAndGet(
185+
Counters.encodeCountAndDuration(1, telemetry.getDuration().getMilliseconds()));
186+
if (!telemetry.getSuccess()) {
187+
counters.unsuccessfulRdds.incrementAndGet();
188+
}
180189
}
181190

182191
private void addException() {

0 commit comments

Comments
 (0)