Esempio n. 1
0
 public AiLogRequest(int sequence, AiConfig aiConfig, string action)
 {
     Name               = $"Microsoft.ApplicationInsights.{aiConfig.InstrumentationKey}.{action}";
     Time               = $"{DateTime.UtcNow:O}";
     Sequence           = sequence.ToString("0000000000");
     InstrumentationKey = aiConfig.InstrumentationKey;
     Tags               = new AiTags
     {
         OSVersion          = aiConfig.XTBVersion,
         DeviceType         = aiConfig.PluginName,
         ApplicationVersion = aiConfig.PluginVersion,
         SessionId          = aiConfig.SessionId.ToString(),
         OperationName      = aiConfig.OperationName
     };
     Data = new AiData
     {
         BaseType = $"{action}Data",
         BaseData = new AiBaseData()
     };
 }
Esempio n. 2
0
 public AppInsights(AiConfig aiConfig)
 {
     _aiConfig = aiConfig;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes Application Insights instance.
 /// When called from a tool, make sure to pass Assembly.GetExecutingAssembly() as loggingassembly parameter!!
 /// </summary>
 /// <param name="endpoint">AppInsights endpoint, usually https://dc.services.visualstudio.com/v2/track</param>
 /// <param name="ikey">Instrumentation Key for the AppInsights instance in the Azure portal</param>
 /// <param name="loggingassembly">Assembly info to include in logging, usually pass Assembly.GetExecutingAssembly()</param>
 /// <param name="toolname">Override name of the tool, defaults to last part of the logging assembly name</param>
 public AppInsights(string endpoint, string ikey, Assembly loggingassembly, string toolname = null)
 {
     _aiConfig = new AiConfig(endpoint, ikey, loggingassembly, toolname);
 }