我有一个像这样的自定义对象。
public class Propertey
{
public string Key { get; set; }
public string Value { get; set; }
}
public class MonitoringEvent
{
public string AppName { get; set; }
public string Service { get; set; }
public string Fuction { get; set; }
public string CorrelationId { get; set; }
public List<Propertey> Properties { get; set; }
public string EventName { get; set; }
public DateTime TimeStamp { get; set; } = DateTime.UtcNow;
}
这个对象是从系统外部填充的,在我的函数应用程序中,我试图将它记录到 App Insights 中。
[FunctionName("EventMonitoring")]
public async Task Run([ServiceBusTrigger(
"cta-event-monitoring",
"monitoring",
Connection = "ServiceBusConnectionString",
IsSessionsEnabled = false)]string mySbMsg, ILogger log)
{
try
{
MonitoringEvent me = JsonConvert.DeserializeObject<MonitoringEvent>(mySbMsg);
log.LogInformation("MonitoringEvent", me);
}
catch (Exception ex)
{
log.LogError("MonitoringEventError",ex);
}
}
当我看到应用洞察时,我在应用洞察中看不到“AppName”“服务”等属性。我在哪里可以找到它们?后来我也希望能够查询它们。但我在应用洞察中看到的都是这样的