Skip to content

Commit 3a4a568

Browse files
committed
Display byos message for profiler
1 parent 083724a commit 3a4a568

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/profiler/ProfilingInitializer.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,17 @@ private void pullProfilerSettings(ConfigService configService) {
163163
}
164164

165165
private void logProfilerPullError(Throwable e) {
166+
String exceptionMessage = e.getMessage();
167+
boolean displayByosMessage = exceptionMessage.contains("Received error code 403 from");
168+
String byosMessage =
169+
" If you bring your own storage, please follow these instructions: "
170+
+ "https://learn.microsoft.com/azure/azure-monitor/profiler/profiler-bring-your-own-storage";
171+
String logMessage =
172+
"Error pulling service profiler settings." + (displayByosMessage ? byosMessage : "");
166173
if (currentlyEnabled.get()) {
167-
logger.error("Error pulling service profiler settings", e);
174+
logger.error(logMessage, e);
168175
} else {
169-
logger.debug("Error pulling service profiler settings", e);
176+
logger.debug(logMessage, e);
170177
}
171178
}
172179

0 commit comments

Comments
 (0)