azure-webjobs-sdk icon indicating copy to clipboard operation
azure-webjobs-sdk copied to clipboard

Add option to enable query params logging in http request auto-collection

Open krish-gh opened this issue 4 years ago • 6 comments

Currently auto-request logging specifically skips logging the query params in the request URL. I also validated by looking at the code: https://github.com/Azure/azure-webjobs-sdk/blob/b243ac087e6efcd75b432cce327fa95eca37eb98/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsTelemetryInitializer.cs#L154 Can we expose a new option in logging->applicationInsights->httpAutoCollectionOptions configuration in host.json to enable full URL logging?

krish-gh avatar Oct 19 '20 03:10 krish-gh

This is really relevant for rest api's where there could be parameters both from the url and the querystring, e.g. url pattern "/customers/{customerid}" and then a parameter "includeorderdata=true" can be added to the querystring. So the incoming url would be https://ourazurefunction/api/customers/12345?includeorderdata=true.

mronnlun avatar Oct 19 '20 18:10 mronnlun

Hi @krish-gh , Moving this to feature request to keep a track of the request. Let us know if this has already been fulfilled

v-anvari avatar Jan 20 '21 12:01 v-anvari

Hi team, this feature would be really appreciated!

phenixita avatar Apr 29 '21 09:04 phenixita

We'd also be really interested in this. Switching from WebApp to Functions for our API offerings, we've lost the query parameters in our logs.

emilbm avatar Nov 19 '21 13:11 emilbm

I'm also down in a deep rabbit hole and could have really used this to get out of a big mess.

nielsbosma avatar Jan 24 '23 15:01 nielsbosma

Support for this was added in #3026 and looks to have been released in appinsights-v3.0.39.

You can enable it by setting the enableQueryStringTracing parameter in your host.json file:

{
    "logging": {
        "applicationInsights": {
            "enableQueryStringTracing": true
        }
    }
}

jacobjmarks avatar May 08 '24 11:05 jacobjmarks