ApplicationInsights-Java icon indicating copy to clipboard operation
ApplicationInsights-Java copied to clipboard

Problem to configure sampling override

Open pasomaal opened this issue 5 months ago • 6 comments

Is your feature request related to a problem? Please describe. How do I configure sampling to e.g. 30% and keep all underlying process exceptions logged. I have a running process where requests are logged and sampled at 30%. A background process is generating exceptions and these seem also to be sampled at 30%. How do I keep all exceptions logged?

Describe the solution you would like Keep all exceptions logged using a sampling override.

Additional context I tried the below configuration, but doesn't seem to work.

{
  "connectionString": "someconnectionstring",
  "role": {
    "name": "SomeRoleName"
  },
  "instrumentation": {
	"logging": {
	  "level": "WARN"
	}
  },
  "sampling": {
	"percentage": 30
  },
  "preview": {
	"sampling": {
	  "overrides": [
	    {
		  "telemetryType": "exception",
		  "attributes": [
		    {
			  "key": "exception.type",
			  "value": ".*",
			  "matchType": "regexp"
			}
		  ],
		  "percentage": 100
		}
	  ]
	}
  }
}
```

pasomaal avatar Jan 23 '24 15:01 pasomaal