Hi, I'm instrumenting an app manually because it uses the windows self-host to run as a local service, when creating a new transaction how can I get the content of the body and set it manually in the new transaction?
The body is stored in the transaction.Context.Request property - in general things that the agent stores on specific events is on the Context.
So you'd do something like this:
transaction.Context.Request = new Request(method, new Url{Full = url}){Body = "[SET BODY HERE]"};
Remaining question is, how do you get the URL values, the method and the body itself. I don't know the specifics of your app, but don't you have access to the static HttpContext property? These things are usually stored there. So, ideally you'd be able to read the values via the HttpContext and just store those on Transaction.Context.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.