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

ApplicationInsights-Java agent should ignore to capture InProc span dependencies

Open n0n0213 opened this issue 1 year ago • 1 comments

After Java SDK version upgrading, we observed the ApplicationInsights-Java agent always capture InProc span dependencies (from CosmosDB SDK, Azure KeyVault SDK, ...) and send to Application Insights which caused the cost increasing. Azure SDK version details:

  • ApplicationInsights-Java agent: applicationinsights-agent-3.4.17.jar
  • azure-cosmos: 4.56.0
  • azure-security-keyvault-secrets: 4.8.0
  • azure-messaging-servicebus: 7.15.1

As of now, we are using sampling rule to capture cosmos HTTP dependency and this is working fine but not work for InProc dependency.

   {
      "telemetryType": "dependency",
      "attributes": [
        {
          "key": "http.url",
          "value": "https?://[^/]+.documents.azure.com/.*",
          "matchType": "regexp"
        }
      ],
      "percentage": 10
    }

The ApplicationInsights-Java agent should ignore to capture InProc dependency as the HTTP dependency (which has more helpful information) is captured.

n0n0213 avatar Oct 10 '24 21:10 n0n0213

Hi @trask , I have created this issue to keep track the release timeline. Thanks!

n0n0213 avatar Oct 10 '24 21:10 n0n0213

Hi @trask

Any ETA when this is implemented?

simplyanything avatar Jan 02 '25 15:01 simplyanything

This is unblocked by https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/12489

which will be included in this month's Application Insights Java release (we were under end of year critical change only advisory the past two months)

with https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/12489, you will then be able to disable specific Azure SDK tracing programmatically using https://github.com/Azure/azure-sdk-for-java/blob/005ceb4d68849b29cd0dab5f7890c166378da500/sdk/core/azure-core/src/main/java/com/azure/core/util/TracingOptions.java#L90,

while maintaining the underlying auto-instrumentation of the HTTP client spans

trask avatar Jan 06 '25 19:01 trask

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.