Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 441 forks source link

Application Insights not recognising logLevel settings in host.json (Reopening of #5250) #7615

Open f0o opened 3 years ago

f0o commented 3 years ago

See #5250

Same thing, but with NodeJS.

I'm facing idle cost of 50 USD/Day for meaningless trace level logs the likes of:

Request successfully matched the route with name 'FooBar' and temaplate '/foobar'

Host lock lease acquired by instance ID '000000000000000000000000A45F81BF'.

Executed 'Functions.FooBar' (Succeeded,...-2e3b-43cd-8e25-02c6fb974707, Duration=7ms)

Posting invocation id:f1ec9d88-2e3b-43cd-8...rkerId:698e2cd8-1c16-4aac-b3b1-4874ceb4c660

Sending invocation id:f1ec9d88-2e3b-43cd-8e25-02c6fb974707

Configuration was set to:

   "logging": {
     "logLevel": {
       "default": "None"
     },

Function statically returns Hello World:

module.exports = async function (context, req) {
  return context.res.body = "Hello World"
}

Each HTTP Request triggers 5 lines of TRACE level entries quickly piling up to GB worth of logIngestion in a day with just basic WebTest monitoring. None of those lines should've been logged with None set as level.

It didn't matter much what I set, I always got Azure Internal spam at a very high price tag for log ingestion.

I'd say #5250 still applies and is an issue today.

Full Config:

 {
   "version": "2.0",
   "logging": {
     "fileLoggingMode": "never",
     "logLevel": {
       "default": "None"
     },
     "applicationInsights": {
       "samplingSettings": {
         "isEnabled": true,
       }
     }
   },
   "extensionBundle": {
     "id": "Microsoft.Azure.Functions.ExtensionBundle",
     "version": "[2.*, 3.0.0)"
   },
   "extensions": {
     "http": {
       "routePrefix": ""
     }
   }
 }
v-bbalaiagar commented 3 years ago

Hi @f0o, Triaging this issue as it requires investigation.