Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter/Sample requests based on captured header value via app insights config using sampling override feature #2285

Closed
kaynat12 opened this issue May 16, 2022 · 7 comments · Fixed by #2308

Comments

@kaynat12
Copy link

kaynat12 commented May 16, 2022

Is your feature request related to a problem? Please describe.
I am using 3.2.11 app insights agent and could capture header values as below in config file,

"preview": {
"captureHttpServerHeaders": {
"requestHeaders": [ "test"] }

I could see that values are stored under custom dimensions as http.request.header.test in requests table

I want to filter out the requests with header 'test' value as true. I tried sampling as below but doesn't seems to work
"sampling": {
"overrides": [{
"attributes": [ {
"key": "http.request.header.test",
"value": "true",
"matchType": "strict"}],
"percentage": 0
}
I tried with key as customDimensions.["http.request.header.test"] also, still same issue.

Describe the solution you would like

  1. Need to have a feature to filter requests based on header value via sampling or possible attribute key for it.
  2. Any other alternative if above is not possible
@ghost ghost added the Needs: Triage 🔍 label May 16, 2022
@kaynat12 kaynat12 changed the title Filter/Sample requests based on captured header value via app insights config Filter/Sample requests based on captured header value via app insights config using sampling override feature May 16, 2022
@trask
Copy link
Member

trask commented May 16, 2022

hi @kaynat12, I would expect the sampling override to work, can you put together a small repro that we can use to troubleshoot / identify the issue?

@kaynat12
Copy link
Author

hi @trask , Thank you for the reply, I have created one sample application and have added you for the repository access, could you take a look?

@kaynat12
Copy link
Author

hi @trask , could you find any solution?

@trask
Copy link
Member

trask commented May 25, 2022

hi @kaynat12! yes, the problem is that http.request.header.* attributes have type of string array, and the sampling overrides only support string attributes. we'll add support for string array soon, hopefully before 3.3.0 is released

@trask
Copy link
Member

trask commented Jun 1, 2022

hi @kaynat12, if you have a chance, give the latest SNAPSHOT build a try:

https://github.com/microsoft/ApplicationInsights-Java/suites/6753934261/artifacts/258125728

@kaynat12
Copy link
Author

kaynat12 commented Jun 3, 2022

hi @trask , the sampling is working now, thank you!

@trask
Copy link
Member

trask commented Jun 4, 2022

3.3.0-BETA.2 has been released with this fix

@ghost ghost locked as resolved and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants