Hi all,
We have realized that we need to introduce some limitations to the CRMScript tracing functionality. This is a result of the following problems:
- Tracing is enabled and then forgotten (it does not disable automatically). We have seen traces from 4 years ago.
- Tracing is enabled for scripts that are executed every minute, causing lots of rows in the script_trace_run table.
- Tracing is enabled for scripts that generate lots of trace data (e.g. tracing inside tight loops), causing large blobs in the script_trace_run table.
In total, this has become a resource problem, and we need to introduce some limitations. We realize that tracing is an important tool for developers, so we would like to do this in a way that minimizes the negative impact. I am writing this post to get some feedback from you. Here are some ideas we have to remedy this problem. Please tell us what you think:
- A trace is automatically disabled when it has created X number of script_trace_run rows, or Y amount of script_trace_run data. Perhaps X will be 1000 and Y will be 100MB. We reserve the right to change these numbers until this is not a problem.
- We can introduce a new flag for a trace: Only save if exception is thrown or a new keepTrace() function has been called inside the CRMScript. This allows you to enable tracing for a script, but it will only save a trace-run if something interesting happened (either exception, or your own logic evaluation that tells you you should keep this trace).
- We can introduce a new feature where you can add an email address to a script-trace to be notified when a script-trace-run was saved. Will only alert once, until reset.
Sverre
All Replies (5)
What about adding an end date/duration on the edit trace screen? with a max of like 7 days (or something lower) and then it being auto-disabled?
Yes, we discussed this as well. However it would not solve the problem of massive tracing for even a short amount of time. We can absolutely add this as well, but it would be in addition to the other limitations.
Sverre
Regarding the following solution:
- A trace is automatically disabled when it has created X number of script_trace_run rows, or Y amount of script_trace_run data. Perhaps X will be 1000 and Y will be 100MB. We reserve the right to change these numbers until this is not a problem.
Wouldn't it be possible to do it the "opposite way"? Which would be:
- The oldest trace results are automatically cleaned up, if X number of script_trace_run rows....
- Or have the user be able to select what is the preferred option: "disable as you describe it" or "remove old data once limit is reached"