-
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
Better Azure Functions consumption plan behavior #2397
Conversation
6662e35
to
8f2a8f9
Compare
...metry/javaagent/instrumentation/azurefunctions/FunctionEnvironmentReloadInstrumentation.java
Outdated
Show resolved
Hide resolved
public static class ExecuteAdvice { | ||
@Advice.OnMethodExit(suppress = Throwable.class) | ||
public static void methodExit() { | ||
AzureFunctions.configureOnce(); |
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.
do we need to check any env vars before configure if i recalled correctly from the meeting with function team?
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 believe those are the env vars that are checked inside of configureOnce()
?
return; | ||
} | ||
if (instrumentation.removeTransformer(transformer)) { | ||
ClassFileTransformerHolder.setClassFileTransformer(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.
this does the magic of shutting down bytecode instrumentation?
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.
ya, I initially thought removeTransformer
was enough, but otel javaagent also uses ClassFileTransformerHolder.getClassFileTransformer() to transform lambda classes (which don't go through normal bytecode instrumentation process), so that's why also need to set that to null
void lazyLoad(); | ||
public static void configureOnce() { | ||
if (configure != null) { | ||
if (!hasConnectionString.get()) { |
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.
might just reuse the method: !hasConnectionString()
if (DiagnosticsHelper.useFunctionsRpIntegrationLogging()) { | ||
if (DiagnosticsHelper.isOsWindows()) { | ||
// TODO (trask) is there a preference where this should go? | ||
return DEFAULT_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.
String tempDirectory = System.getProperty("java.io.tmpdir"),
tempDirectory + "/applicationinsights/applicationinsights.log"?
This pull request introduces 1 alert when merging ab9d25a into f0d550e - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging f26c2a1 into 18be244 - view on LGTM.com new alerts:
|
No description provided.