Skip to content

Commit

Permalink
Fix applicationinsights.json config is not loaded in manual rp attach…
Browse files Browse the repository at this point in the history
… scenario (#3288)
  • Loading branch information
heyams authored Sep 14, 2023
1 parent 9128b61 commit 98a5e0a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.microsoft.applicationinsights.agent.internal.configuration;

import com.azure.monitor.opentelemetry.exporter.implementation.statsbeat.RpAttachType;
import com.azure.monitor.opentelemetry.exporter.implementation.utils.HostName;
import com.azure.monitor.opentelemetry.exporter.implementation.utils.Strings;
import com.fasterxml.jackson.core.JsonParseException;
Expand Down Expand Up @@ -478,7 +479,8 @@ private static Configuration loadConfigurationFile(Path agentJarPath) {
return getConfiguration(runtimeAttachedConfigurationContent, JsonOrigin.RUNTIME_ATTACHED);
}

if (SdkVersionPrefixHolder.isRpIntegration()) {
// only RP auto integrations do not support loading applicationinsights.json
if (RpAttachType.getRpAttachType() == RpAttachType.INTEGRATED_AUTO) {
// users do not have write access to agent directory in rp integrations
// and rp integrations should not use applicationinsights.json because that makes it difficult
// to merge rp intent and user intent
Expand Down

0 comments on commit 98a5e0a

Please sign in to comment.