TangibleTeeth
TangibleTeeth

Reputation: 33

Suppressing Telemetry types in ApplicationInsights V3 Codeless Approach

Folks,

I am using the v3.2.4 of the applicationinsights.jar on a Wildfly application server and am able to see all information go into Azure (Application Insights) portal.

https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent

However, I'm needing to do this for many application instances and am thinking it could be wise to suppress certain kinds of telemetry types (e.g. dependencies as one example) as it creates a lot of noise and data.

Is it possible to do this via the applicationinsights.json file?

Any guidance into this appreciated!

Update (5th Jan 2022): I am using a codeless solution whereby all configuration and thus suppression is done in the .json file.

Solutions involving v2 approaches via C#/java are out of scope (although this is what I have used in the past).

https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-telemetry-processors shows some ideas but it is not explicit with respect to supression of certain types as the default approach seems to push too much data to Azure.

Upvotes: 3

Views: 1614

Answers (2)

Alex
Alex

Reputation: 18556

You could try using sampling and sampling overrides (preview) to achieve the desired results. Though I am not certain if you can easily match only dependency calls by certain attributes. Sampling overrides are the reccomended way to filter out telemetry for cost reasons.

Example: Suppress collecting telemetry for a noisy dependency call

This will suppress collecting telemetry for all GET my-noisy-key redis calls.

{
  "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000",
  "preview": {
    "sampling": {
      "overrides": [
        {
          "attributes": [
            {
              "key": "db.system",
              "value": "redis",
              "matchType": "strict"
            },
            {
              "key": "db.statement",
              "value": "GET my-noisy-key",
              "matchType": "strict"
            }
          ],
          "percentage": 0
        }
      ]
    }
  }
}

You can also disable certain telemetry sources, though I admit that this is not exactly the same as what you are asking for:

{
  "instrumentation": {
    "azureSdk": {
      "enabled": false
    },
    "cassandra": {
      "enabled": false
    },
    "jdbc": {
      "enabled": false
    },
    "jms": {
      "enabled": false
    },
    "kafka": {
      "enabled": false
    },
    "micrometer": {
      "enabled": false
    },
    "mongo": {
      "enabled": false
    },
    "rabbitmq": {
      "enabled": false
    },
    "redis": {
      "enabled": false
    },
    "springScheduling": {
      "enabled": false
    }
  }
}

Upvotes: 1

SaiKarri-MT
SaiKarri-MT

Reputation: 1301

Below are few steps to suppress Application insights telemetry:

  1. Create the telemetry process
  2. Registering a Telemetry Process.
  3. Adding the filters.
  4. Enabling based on LogLevel.

This is one of the possible way.

You can get the full details from this blog

Upvotes: 0

Related Questions