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

ignore InProc sampling dependencies #3654

Open
tomaszwasik opened this issue Apr 18, 2024 · 0 comments
Open

ignore InProc sampling dependencies #3654

tomaszwasik opened this issue Apr 18, 2024 · 0 comments

Comments

@tomaszwasik
Copy link

I do have a spring boot - web flux (java 17) application with dependencies like:

<parent>
    <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.4</version>
    <relativePath/>
</parent>
...
...
<dependencies>
    <dependency>
        <groupId>com.azure.spring</groupId>
        <artifactId>spring-cloud-azure-starter-keyvault-secrets</artifactId>
        <version>5.11.0</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>applicationinsights-runtime-attach</artifactId>
        <version>3.5.1</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>applicationinsights-core</artifactId>
        <version>3.5.1</version>
    </dependency>
</dependencies>

Last days we enabled Azure Monitor - Application Insights.
We want to limit traffic a bit so I added applicationinsights.json file:

{
  "instrumentation": {
    "logging": {
      "level": "INFO"
    },
    "micrometer": {
      "enabled": false
    }
  },
  "sampling": {
    "percentage": 10,
    "overrides": [
      {
        "telemetryType": "request",
        "attributes": [
          {
            "key": "url.path",
            "value": ".*/health/.*",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      },
      {
        "telemetryType": "request",
        "attributes": [
          {
            "key": "url.path",
            "value": ".*/management/.*",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      },
      {
        "telemetryType": "dependency",
        "attributes": [
          {
            "key": "url.full",
            "value": ".*/eureka/.*",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      }
    ]
  }
}

Everything is working as expected except InProc dependencies that are still visible.
Screenshot from 2024-04-18 22-16-19

Screenshot from 2024-04-18 22-17-37

Based on https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#autocollect-inproc-dependencies-preview 'InProc' dependencies should be disabled by default.

From logs:

DEBUG c.m.a.a.i.exporter.AgentSpanExporter - exporting span: 
SpanData{spanContext=ImmutableSpanContext{traceId=57bb173a8a83c1bdf1bc4b0adeac7625, 
spanId=93aaf096f15a06aa, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, 
parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, 
spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, 
resource=Resource{schemaUrl=null, 
attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.35.0"}},
instrumentationScopeInfo=InstrumentationScopeInfo{name=azure-security-keyvault-secrets, version=4.8.1, schemaUrl=https://opentelemetry.io/schemas/1.17.0, attributes={}}, 
name=SecretClient.getSecretSync, kind=INTERNAL, startEpochNanos=1713446188727211374, endEpochNanos=1713446188751113865, 
attributes=AttributesMap{data={thread.id=1, thread.name=main, applicationinsights.internal.item_count=5, az.namespace=Microsoft.KeyVault}, 
capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], 
totalRecordedLinks=0, status=ImmutableStatusData{statusCode=UNSET, description=}, hasEnded=true}

I tried additionally few things, but it doesn't work:

      {
        "telemetryType": "dependency",
        "attributes": [
          {
            "key": "az.namespace",
            "value": "Microsoft.KeyVault",
            "matchType": "strict"
          }
        ],
        "percentage": 0
      },
      {
        "telemetryType": "dependency",
        "attributes": [
          {
            "key": "name",
            "value": "SecretClient.getSecretSync",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      },
      {
        "telemetryType": "dependency",
        "attributes": [
          {
            "key": "name",
            "value": ".*keyvault.*",
            "matchType": "regexp"
          }
        ],
        "percentage": 0
      }

Can you pls help me with that? Not sure if it is actually a bug or i am just doing something wrong. Thank you!

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

1 participant