Skip to content

Sampling override issue #4205

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

Open
mkocicdigit opened this issue May 8, 2025 · 2 comments
Open

Sampling override issue #4205

mkocicdigit opened this issue May 8, 2025 · 2 comments

Comments

@mkocicdigit
Copy link

mkocicdigit commented May 8, 2025

I have issue with sampling override. I want to exclude some dependencies from application insights.

This is an example how i configured applicationinsights json config file.

I am using applicationinsights-runtime-attach 3.7.1 version

{
"sampling": {
    "overrides": [
      {
        "telemetryType": "dependency",
        "attributes": [
          {
            "key": "http.target",
            "value": "/path/.*",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      }
    ]
  }
}

I am not sure what I need to put in key properties in attributes list. My idea is to disable all dependecies requests that contains /path/* in url link.

But with this configuration logs with /path in url appears in application insights (transaction search)

Do you have comment/suggestion?

BR.

@mkocicdigit
Copy link
Author

mkocicdigit commented May 8, 2025

One additional topic.

With the following configuration, HTTP dependencies are not shown in Application Insights
{"sampling": { "overrides": [ { "telemetryType": "dependency", "attributes": [ { "key": "url.path", "value": ".*", "matchType": "regexp" } ], "percentage": 0 } ] }}

However, when I use the following configuration:

{"sampling": { "overrides": [ { "telemetryType": "dependency", "attributes": [ { "key": "url.path", "value": ".*test.*", "matchType": "regexp" } ], "percentage": 0 } ] }}

I still see all dependency logs in Application Insights, including those where the path contains "test".

It seems like the regular expression in the value field is not being applied correctly.

Could you please investigate this issue?

BR.

@TimothyMothra
Copy link
Contributor

Please review this doc and see if this helps:

To see the exact set of attributes captured by Application Insights Java for your application, set the self-diagnostics level to debug, and look for debug messages starting with the text "exporting span".

https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-sampling-overrides#span-attributes-available-for-sampling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants