title: Adding custom telemetry module in Application insight
body: <p>I am trying to create a custom telemetry module in Java which can log custom http requests and responses headers. From my analysis telemetry modules are the one that has access to http request and http response objects. </p>
  
  <p>I created my own telemetry module by extending the Webtelemetrymodule interface and registered the same using Application insights.xml </p>
  
  <p>When my app boots I get error saying Failed to load class for my CustomTelemetry class</p>
  
  <p>Am I missing something??  there isn't much documentation about telemetry modules, so any help will be greatly appreciated </p>
  
  <p>Code </p>
  
  <p>The below is my custom telemetry module and it's registered in ApplicationInsights.xml</p>
  
  <p>public class CustomRequestTelemetryModule implements WebTelemetryModule {</p>
  
  <pre><code>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);
  
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Application Insight Config </p>
  
  <blockquote>
    <p>Blockquote</p>
  </blockquote>
  
  <pre><code>    &lt;Add type="custompackage.CustomRequestTelemetryModule"/&gt;
  </code></pre>
  
  <p>Logged Error by AI </p>
  
  <p>AI: ERROR 16-05-2017 12:13, 15: Failed to create custompackage..CustomRequestTelemetryModule, class custompackage.CustomRequestTelemetryModule</p>
  
  <p>TIA </p>