Application Insights Java Agent: ConnectionStringOverrides Feature Fails to Route Telemetry as Expected
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- azure, java
- Ambito
- observability
Direzione di ricerca
Inizia riproducendo le cinque configurazioni con il Java agent su Tomcat 10.1.33, utilizzando i due context path /OsaEcommerceServerBE e /OsaEcommerceServerNL. Traccia il modo in cui vengono interpretati preview.connectionStringOverrides e il connectionString di primo livello. Il lavoro è completato quando ogni path instrada la telemetria verso la risorsa configurata e l’agent si comporta come documentato quando il connection string di primo livello è assente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected behavior
I expected requests to be tracked in the respective Application Insights resources based on the httpPathPrefix defined in the configuration. Specifically:
- Requests to
/OsaEcommerceServerBE/should be tracked inTHE_ONE_BE. - Requests to
/OsaEcommerceServerNL/should be tracked inTHE_ONE_NL.
Actual behavior
The behavior observed differs depending on the configuration JSON:
Case 1
Configuration:
{
"role": {
"name": "testrolename",
"instance": "testroleinstance"
},
"sampling": {
"percentage": 100
},
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/OsaEcommerceServerBE",
"connectionString": "THE_ONE_BE"
},
{
"httpPathPrefix": "/OsaEcommerceServerNL",
"connectionString": "THE_ONE_NL"
}
]
},
"connectionString": "THE_ONE_BE"
}
Observed Behavior:
/OsaEcommerceServerBE/is tracked inTHE_ONE_BE./OsaEcommerceServerNL/is not tracked anywhere.
Case 2
Configuration:
{
"role": {
"name": "testrolename",
"instance": "testroleinstance"
},
"sampling": {
"percentage": 100
},
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/OsaEcommerceServerNL",
"connectionString": "THE_ONE_BE"
},
{
"httpPathPrefix": "/OsaEcommerceServerNL",
"connectionString": "THE_ONE_NL"
}
]
},
"connectionString": "THE_ONE_BE"
}
Observed Behavior:
- Both
/OsaEcommerceServerBE/and/OsaEcommerceServerNL/are tracked inTHE_ONE_BE.
Case 3
Configuration:
{
"role": {
"name": "testrolename",
"instance": "testroleinstance"
},
"sampling": {
"percentage": 100
},
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/OsaEcommerceServerBE",
"connectionString": "THE_ONE_BE"
},
{
"httpPathPrefix": "/OsaEcommerceServerBE",
"connectionString": "THE_ONE_NL"
}
]
},
"connectionString": "THE_ONE_BE"
}
Observed Behavior:
/OsaEcommerceServerBE/is tracked inTHE_ONE_BE./OsaEcommerceServerNL/is also tracked inTHE_ONE_BE.
Case 4
Configuration:
{
"role": {
"name": "testrolename",
"instance": "testroleinstance"
},
"sampling": {
"percentage": 100
},
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/OsaEcommerceServerNL",
"connectionString": "THE_ONE_BE"
},
{
"httpPathPrefix": "/OsaEcommerceServerBE",
"connectionString": "THE_ONE_NL"
}
]
},
"connectionString": "THE_ONE_BE"
}
Observed Behavior:
/OsaEcommerceServerBE/is not tracked anywhere./OsaEcommerceServerNL/is tracked inTHE_ONE_BE.
Case 5
Configuration:
{
"role": {
"name": "testrolename",
"instance": "testroleinstance"
},
"sampling": {
"percentage": 100
},
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/OsaEcommerceServerNL",
"connectionString": "THE_ONE_BE"
},
{
"httpPathPrefix": "/OsaEcommerceServerBE",
"connectionString": "THE_ONE_NL"
}
]
}
}
Observed Behavior:
- No requests are tracked at all.
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 the connectionStringOverrides feature does not work as expected without a main connectionString specified.
To Reproduce
- Set up a Tomcat server with two applications running on distinct context paths (
/OsaEcommerceServerBEand/OsaEcommerceServerNL). - Configure the Application Insights agent using the provided JSON configurations for each case.
- Make requests to
http://localhost:8081/OsaEcommerceServerBE/andhttp://localhost:8081/OsaEcommerceServerNL/. - Observe the Application Insights telemetry data.
System information
- SDK Version: 21
- OS type and version: Windows 10
- Application Server type and version: Apache Tomcat 10.1.33
- Using spring-boot? Yes, version 3.1.5
- Additional relevant libraries: None applicable
- Lingua principale
- Java
- Stelle
- 327
- Fork
- 222
- Merge medio
- 22h 34m
- PR unite (30g)
- 14
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/ApplicationInsights-Java#4817 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
microsoft/ApplicationInsights-Java#4770 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
microsoft/ApplicationInsights-Java#4769 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/ApplicationInsights-Java#4729 · 121 commenti ·
Tutte le issue di microsoft/ApplicationInsights-Java
Issue simili
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Apertaarea/plugin
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/rocketmq-dashboard#5064 ·