Skip to content

Instantly share code, notes, and snippets.

@hd9
Last active February 18, 2020 22:02
Show Gist options
  • Save hd9/34d0c7a947fdfb8cc54652eb0bb6ae5e to your computer and use it in GitHub Desktop.
Save hd9/34d0c7a947fdfb8cc54652eb0bb6ae5e to your computer and use it in GitHub Desktop.
Posting a custom event from an ASP.NET Core web application to Application Insights
// **********************************************
// Fore more information, visit:
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html
// **********************************************
public IActionResult Privacy()
{
_telemetry.TrackEvent($"Privacy requested @ {DateTime.UtcNow} UTC");
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment