microsoft / ApplicationInsights-Profiler-AspNetCore

Application Insights Profiler sample and documentation
MIT License
66 stars 24 forks source link

Switching off the triggers by default #145

Closed GeorgeChackungal closed 2 years ago

GeorgeChackungal commented 3 years ago

Hi,

Is there a way I can add the profiler to a containerized app with all the triggers off? And only run the "Profile Run" from azure when I need it?

xiaomi7732 commented 3 years ago

Hi @GeorgeChackungal Thanks for the ask. We don't support a way to turn off all the triggers today. Is there a reason or concern that you want all the triggers off?

GeorgeChackungal commented 3 years ago

Do the team have any plan to support this in the future?

We wanted to run the profiler only when we encounter some failures etc. Also, we are not sure about the performance impact of having this enabled all the time.

GeorgeChackungal commented 3 years ago

Any update on the above?

xiaomi7732 commented 3 years ago

Hi @GeorgeChackungal, sorry for the delay. Here's what we usually do for that scenario:

  1. Enable Profiler, but with this settings in an environment variable:
ServiceProfiler__IsDisabled=True  // Profiler will be disabled.
  1. Set the value to False when profiler needs to be turned on.

For more configurations, refer to Configurations.

Will that address your scenario?

Thanks!