Я хочу настроить поведение ведения журнала Application Insights. Поэтому я хотел бы установить какой-то флаг в моем ActionFilter, а затем прочитать этот флаг в ITelemetryProcessor.
public class MyCustomFilterAttribute: ActionFilterAttribute
{
public override void OnActionExecuting(HttpActionContext filterContext)
{
//perform some logic and set the flag here
}
}
а потом
public class TelemetryFilter : ITelemetryProcessor
{
public void Process(ITelemetry item)
{
var request = item as RequestTelemetry;
//read the flag here and terminate processing
}
}
Это возможно ? Есть ли какие-то TempData, которые используются этими двумя типами? Я хотел бы избежать таких хаков, как установка временного заголовка и т.д. Заранее спасибо.