Announcement: Limitations to CRMScript tracing

lock
push_pin
done
Answered
5

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:

  1. Tracing is enabled and then forgotten (it does not disable automatically). We have seen traces from 4 years ago.
  2. Tracing is enabled for scripts that are executed every minute, causing lots of rows in the script_trace_run table.
  3. 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:

  1. 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.
  2. 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). 
  3. 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

7 Nov 2023 | 08:52 AM

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?

 

7 Nov 2023 | 08:57 AM
+1 for this idea. Trace "until date X". Additionally, I think it would also be useful to add a checkbox setting to evaluate "after this date" if the trace should be kept at all (or should be fully removed/deleted).
7 Nov 2023 | 09:06 AM

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

7 Nov 2023 | 09:17 AM

Regarding the following solution:

  1. 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"

7 Nov 2023 | 10:31 AM
Hi,

Yes, removing the oldest traces would solve the problem with database volume. However, transactions also come with a cost. This solution would allow you to create a trace for script, and leave it there forever, always creating new script_trace_run rows and removing old ones. Our thought was that there are two scenarios for tracing that we would like to support:
1. You are developing something right now, so you enable tracing, and check in with the customer in a couple of days and check that everything is working hunky dory. This will work because you have probably not passed X or Y.
2. You have a script that works fine for the customer, and you move on to do something else. If the script for some reason misbehaves down the road (lets say in half a year), it would be really great to have a trace of what happened (and be notified about it). This will be solved by the "only trace for exceptions" and notification feature.

Sverre
8 Nov 2023 | 08:47 AM

Add reply