Skip to content
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

Fix applicationinsights.json config is not loaded in manual rp attach scenario #3288

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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