Skip to content

Instantly share code, notes, and snippets.

@drub0y
Created June 25, 2013 16:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drub0y/5860125 to your computer and use it in GitHub Desktop.
Save drub0y/5860125 to your computer and use it in GitHub Desktop.
This is a proof of concept (read: not tested yet) Owin module that one could configure in an Owin pipeline to ensure that NewRelic will ignore the transaction.
public class NewRelicIgnoreTransactionOwinModule
{
private AppFunc _nextAppFunc;
public NewRelicIgnoreTransactionOwinModule(AppFunc nextAppFunc)
{
_nextAppFunc = nextAppFunc;
}
public Task Invoke(IDictionary<string, object> environment)
{
// Tell NewRelic to ignore this particular transaction
NewRelic.Api.Agent.NewRelic.IgnoreTransaction();
return _nextAppFunc(environment);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment