2017-05-16 7 views
0

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

+0

を行うことができる方法を説明している書いたブログですか? – Peter

+0

コードは私の元の投稿の一部として提供されています – SaiVikas

答えて

0

クラスにはTelemetryModuleインタフェースとともにWebTelemetryModuleを実装します。このように私はこの問題を解決しました。

ここで私は、これはあなたが失敗したクラスのコードと、ロードに失敗したコードを共有することができ、詳細に https://dtechonline.wordpress.com

関連する問題