Skip to content

Commit

Permalink
Delay app id retrieval for Linux consumption plan and increment versi…
Browse files Browse the repository at this point in the history
…on (#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 <trask.stalnaker@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
  • Loading branch information
heyams and trask authored Jun 8, 2021
1 parent 421f082 commit 4ea3e7a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Project properties
version=3.1.1-BETA.5
version=3.1.1
group=com.microsoft.azure

0 comments on commit 4ea3e7a

Please sign in to comment.