Contrast causes my application to misbehave

  • Updated

Issue

While very uncommon, our instrumentation can introduce some errors. These types of problems are very high priority for us and are usually quickly escalated to one of our engineers; any information you can provide about the bug is very helpful to us in getting it fixed as fast as possible. When this happens, it's usually in one of three ways:

  • Contrast itself throws an error.
  • Contrast has changed data in a way that causes the application to throw an error.
  • Contrast has changed data in a way that changes the behavior of the application

Cause

[1] Contrast itself throws an error.
Possible issue in agent code.

[2] Contrast has changed data in a way that causes the application to throw an error.
When we cause an error to be thrown in your code, it's almost always because we've manipulated the type of an argument being passed to a function.

[3] Contrast has changed data in a way that changes the behavior of the application 
For example, data has been malformed by the agent and may break some business logic or cause conditional statements to pass or fail incorrectly. This is very rare, as Contrast tries to avoid ever modifying the meaning of the data. This is often the hardest type of problem to pin down, as on the surface it may seem like the application is fully functional.

Resolution

[1] Contrast itself throws an error.
This usually results in a clear error message. If there isn't one, run the agent with the agent.logger.level option set to debug, which will enable more verbose logging. The error message and stack trace is often enough for us to fix the issue, since it occurred in our code.

[2] Contrast has changed data in a way that causes the application to throw an error.
This will also probably result in an error message. Again, use the agent.logger.level option to enable more verbose logging from the agent.  In this case, any information you can provide about the types the function expects, and what the function does with its arguments, can help us more quickly reproduce and patch the issue.

[3] Contrast has changed data in a way that changes the behavior of the application 
If you suspect the agent is doing this somewhere, please try to track down what behavior is changing and how it is changing from when the application is run without Contrast. With a known behavior, it becomes easier to track which data is being incorrectly changed. If it is possible to cause a stack trace once you know where this is happening, this information can make it much easier for us to figure out what we're breaking.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request