From 4ea3e7a0aed7d72a78662f48f45f08a8be5239db Mon Sep 17 00:00:00 2001 From: Helen Y <56097766+heyams@users.noreply.github.com> Date: Tue, 8 Jun 2021 12:40:26 -0700 Subject: [PATCH] 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 Co-authored-by: Trask Stalnaker --- CHANGELOG.md | 7 +++++++ .../agent/internal/AiComponentInstaller.java | 8 ++++++-- .../agent/internal/LazyConfigurationAccessor.java | 3 +++ gradle.properties | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11546f3910d..3542c1b7396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # CHANGELOG + +# Version 3.1.1 +* Fix 2.x interop of timestamps [#1726](https://github.com/microsoft/ApplicationInsights-Java/pull/1726). +* Add metric filtering to telemetry processor [#1728](https://github.com/microsoft/ApplicationInsights-Java/pull/1728). +* Add log processor to telemetry processor [#1713](https://github.com/microsoft/ApplicationInsights-Java/pull/1713). +* Fix app id retrieval 404 for Linux Consumption Plan [#1730](https://github.com/microsoft/ApplicationInsights-Java/pull/1730). + # Version 3.1.1-BETA.4 * Reduce agent jar file size back to normal [#1716](https://github.com/microsoft/ApplicationInsights-Java/pull/1716). diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/AiComponentInstaller.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/AiComponentInstaller.java index 3f6a6d7ddc6..f7ef2192f61 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/AiComponentInstaller.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/AiComponentInstaller.java @@ -103,8 +103,12 @@ public void beforeByteBuddyAgent(Config config) { public void afterByteBuddyAgent(Config config) { // only safe now to resolve app id because SSL initialization // triggers loading of java.util.logging (starting with Java 8u231) - // and JBoss/Wildfly need to install their own JUL manager before JUL is initialized - AppIdSupplier.registerAndStartAppIdRetrieval(); + // and JBoss/Wildfly need to install their own JUL manager before JUL is initialized. + // Delay registering and starting AppId retrieval to later when the connection string becomes available + // for Linux Consumption Plan. + if (!"java".equals(System.getenv("FUNCTIONS_WORKER_RUNTIME"))) { + AppIdSupplier.registerAndStartAppIdRetrieval(); + } } private static void start(Instrumentation instrumentation) { diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/LazyConfigurationAccessor.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/LazyConfigurationAccessor.java index 22fc407f3c1..91ef3bacabc 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/LazyConfigurationAccessor.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/LazyConfigurationAccessor.java @@ -86,6 +86,9 @@ private static void setValue(String value) { // TODO handle APPLICATIONINSIGHTS_SAMPLING_PERCENTAGE DelegatingSampler.getInstance().setAlwaysOnDelegate(); logger.info("Set connection string {} lazily for the Azure Function Consumption Plan.", value); + + // register and start app id retrieval after the connection string becomes available. + AppIdSupplier.registerAndStartAppIdRetrieval(); } } diff --git a/gradle.properties b/gradle.properties index a250ca80fe8..0e916e05ca8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ // Project properties -version=3.1.1-BETA.5 +version=3.1.1 group=com.microsoft.azure \ No newline at end of file