JavaでカスタムのHTTP要求と応答ヘッダを記録できるカスタムテレメトリモジュールを作成しようとしています。私の分析から遠隔測定モジュールは、http要求オブジェクトとhttp応答オブジェクトにアクセスできるモジュールです。 Application insightでのカスタムテレメトリモジュールの追加
は、私は私のCustomTelemetryクラスアムIのクラスをロードできませんでしたと言っWebtelemetrymoduleインターフェイスを拡張することで、自分自身の遠隔測定モジュールを作成し、
私のアプリの起動は、私はエラーを取得する
insights.xml同じ使用したアプリケーションを登録しました何かが欠けている?そこテレメトリモジュールに関する多くのドキュメントがないので、任意のヘルプは大歓迎されますコード
以下の私のカスタムテレメトリモジュールであり、
パブリッククラスCustomRequestTelemetryModuleがWebTelemetryModuleを{実装し、それはApplicationInsights.xmlに登録されています
public static final String REQUEST_ID_HEADER = "CUSTOM_HEADER";
@Override
public void onBeginRequest(ServletRequest request, ServletResponse response) {
}
@Override
public void onEndRequest(ServletRequest req, ServletResponse res) {
//logger.info("Inside Custom Telemetry Module");
HttpServletResponse response = (HttpServletResponse)res;
String REQID = response.getHeader("REQUEST_ID_HEADER");
RequestTelemetryContext context = ThreadContext.getRequestTelemetryContext();
RequestTelemetry telemetry = context.getHttpRequestTelemetry();
//telemetry.setId(REQID);
telemetry.getProperties().put("ID",REQID);
}
}
アプリケーション洞察構成
BLOCKQUOTE
<Add type="custompackage.CustomRequestTelemetryModule"/>
AI
AIによって
記録されたエラー:ERROR 16-05-2017午前12時13分、15:custompackage..CustomRequestTelemetryModuleの作成に失敗しました、クラスcustompackage.CustomRequestTelemetryModule
TIA
を行うことができる方法を説明している書いたブログですか? – Peter
コードは私の元の投稿の一部として提供されています – SaiVikas