Application Insights Java Agent: ConnectionStringOverrides Feature Fails to Route Telemetry as Expected
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- azure, java
調査の方向性
まず、Tomcat 10.1.33 上で Java agent を使用し、2 つのコンテキストパス /OsaEcommerceServerBE と /OsaEcommerceServerNL を使って 5 つの構成を再現します。preview.connectionStringOverrides とトップレベルの connectionString がどのように解釈されるかを追跡します。各パスが構成されたリソースにテレメトリをルーティングし、トップレベルの connection string が存在しない場合に agent がドキュメントどおりに動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Java
- スター
- 326
- フォーク
- 223
- 平均マージ
- 23時間 6分
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/ApplicationInsights-Java のほかの issue
-
Java 25 native-access warning from bundled Netty requires broad ALL-UNNAMED permission対応中かも @rajkumar-rangaraj が 17 日前に担当しました。 オープン
microsoft/ApplicationInsights-Java#4851 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
microsoft/ApplicationInsights-Java#4770 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
microsoft/ApplicationInsights-Java#4769 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/ApplicationInsights-Java#4729 · コメント 131 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/ApplicationInsights-Java#4712 ·
メンテナーはふだん 1 日以内に返信
microsoft/ApplicationInsights-Java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
objectionary/eo#9182 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
objectionary/hone-maven-plugin#1293 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
MaikuB/flutter_appauth#683 ·
-
type: possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100