Code Monkey home page Code Monkey logo

Comments (3)

dgoffredo avatar dgoffredo commented on July 2, 2024 1

I don't know what parent_based_always_on and parent_based_always_off mean, but I would assume they mean "use the sampling decision extracted from the parent, or otherwise default to (on|off)."

If my assumption is correct, then that means that the (Java, in your example) tracer would always honor a sampling decision extracted from the traceparent request header.

The behavior in the nginx module, though, is that it will not extract the sampling decision from traceparent by default. I was asking why that is the default.

from opentelemetry-cpp-contrib.

trajano avatar trajano commented on July 2, 2024 1

Yeah I think they should make these consistent across instrumentation. So in my case I think both parent_based_always_on (which is my default) and parent_based_always_off is equivalent to sampler.parent_based=true and the line before that

OtelSamplerType type = OtelSamplerAlwaysOn;

will be equivalent to always_on So the equivalent default for your instrumentation with the Java instrumentation is always_on .
Like I said earlier hopefully they streamline the defaults so those switching from one language to the another won't get dinged by assuming the default.

from opentelemetry-cpp-contrib.

trajano avatar trajano commented on July 2, 2024

In my case I found it the other way by default with Java instrumentation which is parent_based_always_on which I actually set to parent_based_always_off in my service.

The advantage of parent_based_always_off is it allows me to drop the whole span if the parent trace is filtered using a filter in OpenTelemetry Collector like this

  filter/grafana_noise:
    error_mode: ignore
    traces:
      span:
        - (resource.attributes["service.name"] == "grafana") and (attributes["http.url"] == "/grafana/metrics") and (attributes["http.method"] == "GET")
        - (resource.attributes["service.name"] == "grafana") and (name == "open session") and (attributes["transaction"] == false)

  filter/drop_actuator:
    traces:
      span:
        - (attributes["http.method"] != nil) and (attributes["http.method"] == "GET") and (attributes["http.route"] == "/actuator/prometheus")
        - (attributes["http.method"] != nil) and (attributes["http.method"] == "GET") and (attributes["http.route"] == "/actuator/health")
        - (attributes["http.url"] == "/grafana/metrics") and (attributes["http.method"] == "GET")
        - (attributes["http.url"] == "/metrics") and (attributes["http.method"] == "GET")

When the traefik span that starts the whole process gets dropped the whole trace itself gets dropped. Primarily I want to remove the /metrics polling and /health checks

So IMHO I think parent_based_always_off is a more reasonable default and hope that is the case in Java instrumentation.

However... I would rather the default be consistent across all tooling so what you've flagged here is an inconsistency between instrumentation libraries.

from opentelemetry-cpp-contrib.

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.