File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
core/src/main/java/com/microsoft/applicationinsights/internal/statsbeat Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2121
2222package com .microsoft .applicationinsights .internal .statsbeat ;
2323
24- import com .google .common .annotations . VisibleForTesting ;
24+ import com .google .common .base . Strings ;
2525import com .microsoft .applicationinsights .TelemetryClient ;
2626import com .microsoft .applicationinsights .TelemetryConfiguration ;
2727import com .microsoft .applicationinsights .internal .util .ThreadPoolUtils ;
2828import com .microsoft .applicationinsights .telemetry .MetricTelemetry ;
29+
2930import org .slf4j .Logger ;
3031import org .slf4j .LoggerFactory ;
3132
@@ -64,6 +65,11 @@ private class StatsbeatSender implements Runnable {
6465 @ Override
6566 public void run () {
6667 try {
68+ // For Linux Consumption Plan, connection string is lazily set.
69+ // There is no need to send statsbeat when cikey is empty.
70+ if (Strings .isNullOrEmpty (CustomDimensions .get ().getCustomerIkey ())) {
71+ return ;
72+ }
6773 send ();
6874 }
6975 catch (Exception e ) {
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ public OperatingSystem getOperatingSystem() {
8787 return operatingSystem ;
8888 }
8989
90+ public String getCustomerIkey () { return customerIkey ; }
91+
9092 public void setResourceProvider (ResourceProvider resourceProvider ) {
9193 this .resourceProvider = resourceProvider ;
9294 }
You can’t perform that action at this time.
0 commit comments