Display byos message for profiler

This commit is contained in:
Jean Bisutti 2024-10-14 15:01:21 +02:00
Родитель 083724a052
Коммит 3a4a5681ac
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -163,10 +163,17 @@ public class ProfilingInitializer {
}
private void logProfilerPullError(Throwable e) {
String exceptionMessage = e.getMessage();
boolean displayByosMessage = exceptionMessage.contains("Received error code 403 from");
String byosMessage =
" If you bring your own storage, please follow these instructions: "
+ "https://learn.microsoft.com/azure/azure-monitor/profiler/profiler-bring-your-own-storage";
String logMessage =
"Error pulling service profiler settings." + (displayByosMessage ? byosMessage : "");
if (currentlyEnabled.get()) {
logger.error("Error pulling service profiler settings", e);
logger.error(logMessage, e);
} else {
logger.debug("Error pulling service profiler settings", e);
logger.debug(logMessage, e);
}
}