Skip to content

Commit 4ea3e7a

Browse files
heyamstrask
andauthored
Delay app id retrieval for Linux consumption plan and increment version (#1730)
* Delay appId retrieval for Linux Consumption Plan * Prepare for 3.1.1 GA release * Add link * Remove extra brackets Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent 421f082 commit 4ea3e7a

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# CHANGELOG
2+
3+
# Version 3.1.1
4+
* Fix 2.x interop of timestamps [#1726](https://github.com/microsoft/ApplicationInsights-Java/pull/1726).
5+
* Add metric filtering to telemetry processor [#1728](https://github.com/microsoft/ApplicationInsights-Java/pull/1728).
6+
* Add log processor to telemetry processor [#1713](https://github.com/microsoft/ApplicationInsights-Java/pull/1713).
7+
* Fix app id retrieval 404 for Linux Consumption Plan [#1730](https://github.com/microsoft/ApplicationInsights-Java/pull/1730).
8+
29
# Version 3.1.1-BETA.4
310
* Reduce agent jar file size back to normal [#1716](https://github.com/microsoft/ApplicationInsights-Java/pull/1716).
411

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ public void beforeByteBuddyAgent(Config config) {
103103
public void afterByteBuddyAgent(Config config) {
104104
// only safe now to resolve app id because SSL initialization
105105
// triggers loading of java.util.logging (starting with Java 8u231)
106-
// and JBoss/Wildfly need to install their own JUL manager before JUL is initialized
107-
AppIdSupplier.registerAndStartAppIdRetrieval();
106+
// and JBoss/Wildfly need to install their own JUL manager before JUL is initialized.
107+
// Delay registering and starting AppId retrieval to later when the connection string becomes available
108+
// for Linux Consumption Plan.
109+
if (!"java".equals(System.getenv("FUNCTIONS_WORKER_RUNTIME"))) {
110+
AppIdSupplier.registerAndStartAppIdRetrieval();
111+
}
108112
}
109113

110114
private static void start(Instrumentation instrumentation) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ private static void setValue(String value) {
8686
// TODO handle APPLICATIONINSIGHTS_SAMPLING_PERCENTAGE
8787
DelegatingSampler.getInstance().setAlwaysOnDelegate();
8888
logger.info("Set connection string {} lazily for the Azure Function Consumption Plan.", value);
89+
90+
// register and start app id retrieval after the connection string becomes available.
91+
AppIdSupplier.registerAndStartAppIdRetrieval();
8992
}
9093
}
9194

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Project properties
2-
version=3.1.1-BETA.5
2+
version=3.1.1
33
group=com.microsoft.azure

0 commit comments

Comments
 (0)