Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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