Allow connectionString to be overridden multiple times without restarting the AppInsights Agent
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- java, spring-boot
調査の方向性
まず BytecodeUtilImpl.java の 70-73 行付近から始めて、ConnectionString.configure() が現在一度しか実行されない理由を理解し、次に InheritedConnectionStringSpanProcessor.java の 58-62 行付近と、リンクされている connection string のオーバーライドに関するドキュメントを調べます。connection string が span およびテレメトリの宛先とどのように関連付けられているかを追跡します。完了の条件は、アプリケーションのライフサイクル全体で宛先を変更する場合、または個別のカスタム span に対して宛先を変更する場合に対応した、サポートされる設計があることです。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
As per your documentation, it's possible to override connection strings per each httpPathPrefix:
https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#connection-string-overrides-preview
{
"preview": {
"connectionStringOverrides": [
{
"httpPathPrefix": "/myapp1",
"connectionString": "..."
},
{
"httpPathPrefix": "/myapp2",
"connectionString": "..."
}
]
}
}
This config is being processed in the following class of AppInsights Agent: InheritedConnectionStringSpanProcessor.java:L58-L62
I understand that this feature is geared towards a use-case where an app being instrumented with AppInsights is an MVC app, and a connectionStringOverride is applied at a Controller method level, where each Controller method has a different PathPrefix. I.e. this use-case is described in OpenTelemetryAPI documentation as creating a custom span per controller method:
https://opentelemetry.io/docs/instrumentation/java/manual/#create-spans
Describe the solution you would like
We are looking for a way to change connectionString multiple times throughout application lifecycle, not per httpPathPrefix
Ideally we would be able to run ConnectionString.configure() and change to a desired connectionString, and ApplicationInsight agent taking that into account, and posting metrics to a newly specified location.
com.microsoft.applicationinsights.connectionstring.ConnectionString.configure(CONNECTION_STRING)
Currently ConnectionString.configure(CONNECTION_STRING) can be run only once to set ConnectionString:
https://github.com/microsoft/ApplicationInsights-Java/blob/main/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/classicsdk/BytecodeUtilImpl.java#L70-L73
We need a way to determine custom OpenTelemetry spans, and have a different ConnectionString per each of these spans.
Describe alternatives you have considered
Describe any alternative solutions or features you've considered.
Additional context
Our app is not Spring MVC app that has different httpPathPrefix, but is rather a SpringBoot cron-executed org.springframework.boot.CommandLineRunner task, that runs periodically, and needs to send AppInsights telemetry to 3 different AppInsights containers.
- 主要言語
- Java
- スター
- 327
- フォーク
- 222
- 平均マージ
- 22時間 34分
- マージ済み PR(30日)
- 14
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/ApplicationInsights-Java のほかの issue
-
microsoft/ApplicationInsights-Java#4851 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoft/ApplicationInsights-Java#4817 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
microsoft/ApplicationInsights-Java#4770 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
microsoft/ApplicationInsights-Java#4769 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/ApplicationInsights-Java#4729 · コメント 121 件 ·
microsoft/ApplicationInsights-Java の issue をすべて見る
似ている issue
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/flink-agents#1156 ·
-
[source-shopify] FAILED bulk operation without partialDataUrl is silently treated as successful オープンarea/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100