Git Product home page Git Product logo

Comments (9)

palazzem avatar palazzem commented on August 22, 2024 5

Hello @abstrctn ! Sorry, I forgot to follow-up here! Actually we've implemented a filter to exclude traces if a condition is satisfied. You have two different options:

  • filter the healthcheck from the Datadog agent using our configuration with the [trace.ignore] option;
  • filter the healthcheck from the Datadog Ruby client using our processing pipeline with the SpanFilter class. In the second case, this could be an example:
# skipping the health check: if it returns true, the trace is dropped
controller_filter = Datadog::Pipeline::SpanFilter.new do |span|
  span.name == "rack.request" && span.get_tag("http.url") == "/healthz"
end

Datadog::Pipeline.before_flush(controller_filter)

Remember that if you drop traces in the client, stats are dropped too. If the healthcheck is not important for your stats, filtering from the client is a good approach. Let me know if it helps and solves your issue!

(the client filter is available from 0.9.0)

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

Sure @DennisSchmidt, this is a feature request that definitely makes sense. Indeed we implemented something in the Python client to discard some traces when the given URL matches a specific value. You can see the high level PR (not yet released) here: DataDog/dd-trace-py#303
Also, the implementation is generic, so you can write your own filters.

Considering that our plan is to implement something similar for Ruby, would it help you solving your problem?

from dd-trace-rb.

DennisSchmidt avatar DennisSchmidt commented on August 22, 2024

That sounds like it would solve my problem.

I made a simple and quick approach, which solves my usecase for now. Of course, yours is more generic and would help more people I guess.

Thx for answering 👍

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

you're welcome! I'll keep this issue opened so that it can be linked to the PR when it will be available! Thanks also for providing your approach! It could help other users till the filtering pipeline is shipped!

from dd-trace-rb.

cabello avatar cabello commented on August 22, 2024

IMHO for flexibility this could be part of the tracer API instead of a list of routes, for example tracer.skip, tracer.ignore, etc could be the first thing you call in your controller or be a before_action callback.

from dd-trace-rb.

abstrctn avatar abstrctn commented on August 22, 2024

@palazzem Are there any general approaches being considered for implementing this feature, or concerns about ones proposed so far?

FWIW, our use case sounds the same as @DennisSchmidt, where we have a single healthcheck action we'd want to exclude

from dd-trace-rb.

cabello avatar cabello commented on August 22, 2024

Should this issue be closed?

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

@cabello yes we can consider that one closed. But feel free to re-open it if it doesn't solve your issue! Thanks a lot!

from dd-trace-rb.

abstrctn avatar abstrctn commented on August 22, 2024

Thanks for the quick response @palazzem! Both of those options look really useful and should handle everything we need.

from dd-trace-rb.

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.