GithubHelp home page GithubHelp logo

Comments (5)

gleidson avatar gleidson commented on May 28, 2024 1

Hey @heyams, thanks for your quick response.

I'm using the version 3.4.18.

With the HTTP dependency, I was able to use sampling overrides to ignore some requests.

I will set the self-diagnostics level to debug as suggested to get the attributes.

from applicationinsights-java.

gleidson avatar gleidson commented on May 28, 2024 1

@heyams, it works!

Thank you!

from applicationinsights-java.

heyams avatar heyams commented on May 28, 2024

https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#autocollect-inproc-dependencies-preview

{
  "preview": {
    "captureControllerSpans": false
  }
}

since version 3.2.0, we don't collect controller "InProc" dependencies by default. Which version of Java agent are you using?
If those are not controller InProc dependencies, you can certainly use sampling overrides like this:

{
  "connectionString": "...",
  "preview": {
    "sampling": {
      "overrides": [
        {
          "telemetryType": "dependency",
          "attributes": [
            {
              "key": "<attributre_key>", // replace it with an actual attribute key
              "value": "<attribute_value>", // repleace it with an actual attribute value
              "matchType": "strict" //or "regexp"
            }
          ]
          "percentage": 0
        }
      ]
    }
  }
}

image

@gleidson please let me know if you have further questions.

from applicationinsights-java.

gleidson avatar gleidson commented on May 28, 2024

Hey @heyams, I tried the configuration below

        {
          "telemetryType": "dependency",
          "attributes": [
            {
              "key": "thread.name",
              "value": "boundedElastic*",
              "matchType": "regexp"
            }
          ],
          "percentage": 0
        }

For the "exporting span" below:

2024-01-19 17:49:02.883-03:00 DEBUG c.m.a.a.i.exporter.AgentSpanExporter - exporting span: SpanData{spanContext=ImmutableSpanContext{traceId=4def5e93043cea4c5fa41f757a081c7f, spanId=9bc7fea1441e1d9e, 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=https://opentelemetry.io/schemas/1.21.0, attributes={service.name="my-service", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.31.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=azure-storage-blob, version=12.24.1, schemaUrl=https://opentelemetry.io/schemas/1.17.0, attributes={}}, name=AzureBlobStorageBlob.setMetadata, kind=INTERNAL, startEpochNanos=1705697342693931300, endEpochNanos=1705697342843649200, attributes=AttributesMap{data={applicationinsights.internal.item_count=1, thread.name=boundedElastic-6, thread.id=193, az.namespace=Microsoft.Storage}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=UNSET, description=}, hasEnded=true}

But it didn't work as expected. Can you help me with an example to ignore the span above?

from applicationinsights-java.

heyams avatar heyams commented on May 28, 2024

@gleidson

please try this instead:

        {
          "telemetryType": "dependency",
          "attributes": [
            {
              "key": "thread.name",
              "value": "boundedElastic.*", // use '.*'
              "matchType": "regexp"
            }
          ],
          "percentage": 0
        }

https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-sampling-overrides#troubleshooting

from applicationinsights-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.