API
Storing handled exceptions
To record exceptions handled by a try-catch block, use RevDeBugAPI.Snapshot.RecordException and pass the exception object as a parameter. For example:
The recorded snapshot of code execution that led to the exception will be stored on a Recording Server and visible on the RevDeBug DevOps Monitoring dashboard in the same manner unhandled exceptions are.
Recordings of complex objects
To record inside an object of any class use RevDeBugAPI.RecordObject(object). This function records the interior of the object at a given moment of the program operation.
Using the RecordSnapshot function
RevDeBug offers the possibility to create code recordings even when there is no unexpected exception. To use the function of creating snapshots, you should use the RevDeBugAPI.Snapshot.RecordSnapshot(RecordingName) function anywhere in the program code. The place in the code where we used the snapshot function will be the end of the recording.
How to add RevDeBug Trace ID to your logs
To use RevDeBug API in your ASP.NET Core project you need to add IRevDeBugTraceInfoAccessor to IOC of your controller or middleware and then simply call method GetTraceId()
Example ExceptionMiddleware.cs could look like this:
How to add custom tags to span in Trace
To add custom tagging to your trace span, you need to add the following changes to your endpoints, please replace TagName
and TagValue
with your custom tag:
Last updated
Was this helpful?