Last active
January 31, 2019 07:40
-
-
Save Geertvdc/12d112232ea37baee569a6ef679ca138 to your computer and use it in GitHub Desktop.
App insights telemetry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var telemetry = new DependencyTelemetry | |
{ | |
Type = "type", | |
Name = nameof(CalculationCycle) | |
}; | |
telemetry.Start(); | |
telemetry.Context.Operation.Id = telemetry.Id; | |
telemetry.Context.Operation.ParentId = telemetry.Id; | |
try | |
{ | |
//do stuff that takes long time | |
telemetry.Success = true; | |
} | |
finally | |
{ | |
telemetry.Stop(); | |
TelemetryClient c = new TelemetryClient(); | |
c.Track(telemetry); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment