title: How to know if application insights telemetry client is functional?
body: <p>This code execute without any errors, but obviously will not log anything in ApplicationInsights. The <code>foobar</code> key is not valid.</p>
  
  <pre><code> var client = new TelemetryClient
   {
      Context = { InstrumentationKey = "foobar" }
   };
  
   client.TrackEvent(telemetryEvent);
  </code></pre>
  
  <p>I understand that it may be a good thing. I dont want my application to crash because AppInsights is not avalaible. But it would be nice to know somehow that it is not reachable, so I can do something else instead.</p>
  
  <p>Possible errors that I think could append :</p>
  
  <ul>
  <li>The api is not reachable</li>
  <li>The event is malformed</li>
  <li>the api key is invalid</li>
  <li>etc.</li>
  </ul>
  
  <p>Some of these may be transcient (api temporary not available), but others may not (invalid api key).</p>
  
  <p>Is there any way I could "test" the client to react to these cases?</p>
  
  <p>Something like :</p>
  
  <pre><code>if (!client.IsAppInsightReachable)
  {
    //Send an email to someone so he can check if everything is OK
  }
  </code></pre>