Skip to content

Instantly share code, notes, and snippets.

@johndowns
Created January 16, 2019 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndowns/fa0df0587cb78f3c3eeff32e6fba7f7c to your computer and use it in GitHub Desktop.
Save johndowns/fa0df0587cb78f3c3eeff32e6fba7f7c to your computer and use it in GitHub Desktop.
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Metrics;
using Microsoft.Extensions.Logging;
private static TelemetryClient TelemetryClient = new TelemetryClient();
private static Random Random = new Random();
public static void Run(TimerInfo timer, ILogger log)
{
var randomValue = (int)Random.NextValue(0, 10);
TelemetryClient.GetMetric("My Test Metric").TrackValue(randomValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment