Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
737 stars 358 forks source link

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

Open krish-gh opened 3 years ago

krish-gh commented 3 years ago

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?

mronnlun commented 3 years ago

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.

v-anvari commented 3 years ago

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

phenixita commented 3 years ago

Hi team, this feature would be really appreciated!

emilbm commented 2 years ago

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.

nielsbosma commented 1 year ago

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

jacobjmarks commented 4 months ago

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
        }
    }
}