cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data collector for fetching http request properties

Hi!

 

I would like to fetch HTTP request properties (not headers, not parameters) - according to attached picture; like RawUrl, UrlReferrer, or any other HTTP request property. Looking into transaction snapshots -> any given segment -> More -> Properties they're all there - but how do I go about creating a data collector for fetching any of these properties? Been looking into https://docs.appdynamics.com/display/PRO45/Using+Getter+Chains which seemed promising, and thinking about method invocation data collectors - but haven't really succeeded yet.

 

Anyone been able to create a data collector fetching HTTP request properties?

 

Thanks!

 

/Mattiashttp_request_properties.PNG

8 REPLIES 8

Joshua.Lyons
AppDynamics Team

Hi Mattias,

 

Here is an MIDC example to get the UrlReferrer property of the Request in an MVC app.  You would use the Invoked Object and a Getter Chain that simply uses the Request object and any property.

 

Request-UrlReferrer-MIDC.png

Thank you very much! Will give it a shot right away

Method signature? Guess it depends on the application? Examples:

entry_point_http_request.PNGentry_point_http_request2.PNG

Ended up fetching HTTPContext from System.Web.UI.Page.ProcessRequest - and Request is a property of the context:data_collector_http_request.PNG

Unfortunately no data is being collected based on System.Web.UI.Page.ProcessRequest (https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.page.processrequest?view=netframework-4.8#...) - Parameter @ index 0 = HttpContext, fetching property Request from HttpContext and UrlReferrer from Request.

 

Am I missing something?

In your case you will need to add the fully qualified path which includes the Current context like so:

ParamIndex_0.Current.Request.UrlReferrer

You can read about why in the Remarks here in the Microsoft docs. https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcontext.request?view=netframework-4.8#rem...

Unfortunately, I am not on my dev machine to confirm this as I normally would but if my memory serves me, this should get you the results you need.

Unfortunately I can't get my data collector to pick up any HTTP request properties. Using Current.Request.UrlReferrer, also tried Request.UrlReferrer etc. Either I'm doing something wrong, or I've stumbled upon a bug! Any advice would be highly appreciated.

Weren't able to get the MIDC working - therefore fetched HTTP header Referer instead as a workaround.