-
Notifications
You must be signed in to change notification settings - Fork 203
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
Application Insights Java Agent: ConnectionStringOverrides Feature Fails to Route Telemetry as Expected #4049
Comments
hi @lobregliolu, is there any info in the |
Hi @trask thanks for replying! When the "main" connectionString is provided in the json (that's not what I want but I tried just to try figruing out), I just receive When I start the agent with the "Case 5" json, so with the connectionStringOverrides object without the main connectionString
|
this is expected let's focus on Case 1 which looks correct to me (and we have smoke tests validating a similar configuration) can you enable self-diagnostic logging at debug level and post an examples of the "exporting span" diagnostic for both |
In the server.xml I have these two service elements
In the setenv.bat I have
So I have two application running and reachable at (due to war names): This is my applicationinsights.json file the agent read because is in the tomcat lib folder
In the applicationinsights.log I just see
This line |
I think all jar files in the tomcat lib are automatically added to the classpath, can you try moving the agent jar to another location? |
Yes, thank you. Moving it in another folder changing the -javaagent option solved that line. |
ah, this is a good point, I don't believe that live metrics is respecting the connection overrides, we will need to investigate |
Expected behavior
I expected requests to be tracked in the respective Application Insights resources based on the
httpPathPrefix
defined in the configuration. Specifically:/OsaEcommerceServerBE/
should be tracked inTHE_ONE_BE
./OsaEcommerceServerNL/
should be tracked inTHE_ONE_NL
.Actual behavior
The behavior observed differs depending on the configuration JSON:
Case 1
Configuration:
Observed Behavior:
/OsaEcommerceServerBE/
is tracked inTHE_ONE_BE
./OsaEcommerceServerNL/
is not tracked anywhere.Case 2
Configuration:
Observed Behavior:
/OsaEcommerceServerBE/
and/OsaEcommerceServerNL/
are tracked inTHE_ONE_BE
.Case 3
Configuration:
Observed Behavior:
/OsaEcommerceServerBE/
is tracked inTHE_ONE_BE
./OsaEcommerceServerNL/
is also tracked inTHE_ONE_BE
.Case 4
Configuration:
Observed Behavior:
/OsaEcommerceServerBE/
is not tracked anywhere./OsaEcommerceServerNL/
is tracked inTHE_ONE_BE
.Case 5
Configuration:
Observed Behavior:
Logs
When the
connectionString
field is not specified in the configuration, the Application Insights Java agent failed to start, citing that no connection string was provided. This indicates that theconnectionStringOverrides
feature does not work as expected without a mainconnectionString
specified.To Reproduce
/OsaEcommerceServerBE
and/OsaEcommerceServerNL
).http://localhost:8081/OsaEcommerceServerBE/
andhttp://localhost:8081/OsaEcommerceServerNL/
.System information
The text was updated successfully, but these errors were encountered: