• Print
  • Share
  • Dark
    Light

Tracked Functions

  • Updated on 29 Jun 2018
  • 1 minute to read
  • Contributors

Tracked functions are used to track sub-transactions within a web request or custom transaction. This is useful for tracking something like a specific Elasticsearch query or any logic within your application.

Custom transactions define the larger operation to be tracked. Tracked functions allow you track a small part of that large transaction.

Learn more about Tracked Functions

Tracked functions are not custom transactions
Tracked functions must be used within a web application or within a custom transaction defined within a background service. A tracked function must be part of a larger operation.

To utilize Tracked Functions, you must add our StackifyLib nuget package to your project. You then surround your code as shown below with our tracer.

var tracer = StackifyLib.ProfileTracer.CreateAsTrackedFunction("Name the block of code"); 
tracer.Exec(() => 
{ 
   //Do some stuff 
});