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 1 commit
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,9 @@ private static Configuration loadConfigurationFile(Path agentJarPath) {
return getConfiguration(runtimeAttachedConfigurationContent, JsonOrigin.RUNTIME_ATTACHED);
}

if (SdkVersionPrefixHolder.isRpIntegration()) {
// any manual RP integration will support loading user's applcationinsights.json
heyams marked this conversation as resolved.
Show resolved Hide resolved
if (SdkVersionPrefixHolder.isRpIntegration()
&& RpAttachType.getRpAttachType() != RpAttachType.MANUAL) {
heyams marked this conversation as resolved.
Show resolved Hide resolved
// 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