-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix azure functions diagnostic logging #2433
Conversation
...in/java/com/microsoft/applicationinsights/agent/internal/init/AzureFunctionsInitializer.java
Outdated
Show resolved
Hide resolved
d3bfa21
to
88d424e
Compare
dfba9bf
to
53cc55c
Compare
This pull request fixes 1 alert when merging 53cc55c into 0385228 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 21121a8 into 0385228 - view on LGTM.com fixed alerts:
|
21121a8
to
edc0834
Compare
@heyams can you re-review? I've made several additional changes, thx |
This pull request fixes 1 alert when merging a82998e into 0385228 - view on LGTM.com fixed alerts:
|
...in/java/com/microsoft/applicationinsights/agent/internal/init/AzureFunctionsInitializer.java
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/applicationinsights/agent/internal/init/AzureFunctionsInitializer.java
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/applicationinsights/agent/internal/init/AzureFunctionsInitializer.java
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/applicationinsights/agent/internal/init/AzureFunctionsInitializer.java
Outdated
Show resolved
Hide resolved
@@ -126,7 +126,7 @@ public void onStartupSuccess() { | |||
MDC.put(DiagnosticsHelper.MDC_PROP_OPERATION, "Startup"); | |||
try (MDC.MDCCloseable ignored = INITIALIZATION_SUCCESS.makeActive()) { | |||
LoggerFactory.getLogger(DiagnosticsHelper.DIAGNOSTICS_LOGGER_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static final diagnostics logger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't here because it would trigger the logger to be initialized too early
@Nullable String statsbeatEndpoint) { | ||
|
||
if (Strings.isNullOrEmpty(connectionString)) { | ||
this.connectionString = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessary to set it to null?
if (!Strings.isNullOrEmpty(conenctionString)) {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is helpful because we have a couple of places that get the connection string / ikey, and then those won't get outdated ones (Azure Spring Cloud can set the connection string to null at runtime)
if (Strings.isNullOrEmpty(connectionString)) { | ||
this.connectionString = null; | ||
this.statsbeatConnectionString = null; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (Strings.isNullOrEmpty(connectionString)) { | |
this.connectionString = null; | |
this.statsbeatConnectionString = null; | |
} else { | |
if (!Strings.isNullOrEmpty(connectionString)) { |
This pull request fixes 1 alert when merging 76bbf86 into 1f6f3b5 - view on LGTM.com fixed alerts:
|
No description provided.