Skip to content

Commit 420ace2

Browse files
Merge pull request #415 from Microsoft/dhaval/RevertSetSampleRateNullCheck
Dhaval/revert set sample rate null check
2 parents 46fdca0 + 8e221cf commit 420ace2

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CHANGELOG
22

33
## Version 1.0.10
4+
- Fixed Request Telemetry Sending bug with new schema
45
- Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`.
56
- Class `SendableData` in internal namespace deleted.
67
- Class `com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry` takes generic class qualifier `Domain` instead of `SendableData`.

core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public double getSampleRate() {
140140
* Sets the SampleRate property.
141141
*/
142142
public void setSampleRate(double value) {
143-
this.sampleRate = value;
143+
this.sampleRate = value;
144144
}
145145

146146
/**

core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public void reset() {
1717
@Override
1818
protected void setSampleRate(Envelope envelope) {
1919
Double currentSP = getSamplingPercentage();
20-
envelope.setSampleRate(currentSP);
20+
if (currentSP != null) {
21+
envelope.setSampleRate(currentSP);
22+
}
2123
}
2224
}

core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void close() throws IOException {
6969

7070
public void write(String name, Duration value) throws IOException {
7171
writeName(name);
72-
out.write(String.valueOf(value));
72+
write(String.valueOf(value));
7373
separator = JSON_SEPARATOR;
7474
}
7575

0 commit comments

Comments
 (0)