Comments (9)
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.
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.
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.
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.
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.
@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.
Should this issue be closed?
from dd-trace-rb.
@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.
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)
- Enhancement Request: Allow Manual Setting of Resource Name for Requests Failing in before_action
- Continuous Profiler does not support macOS HOT 4
- Resource tagging/management of Rails Engines dynamically mounted on initialization (SubSystem Resources) HOT 2
- ddtrace - throws error when deploying a rails 6.1 instance HOT 1
- Sinatra - missing trace_id when trying to correlate logs with traces HOT 2
- Qless support is missing from 2.0 HOT 1
- Capture tracing when a specific header is passed in an HTTP request HOT 3
- Instrumenting both Redis and Sidekiq leads to "stack level too deep (SystemStackError)" HOT 1
- GraphQL queries will error out after datadog upgrade ("Found two visible definitions") HOT 2
- With `datadog` 2.x, how can I mimic the 1.x test adapter that prints traces to `$stdout`? HOT 2
- Failed to report profiling data, connection closed before message completed HOT 3
- Anyway to make the faraday instrumentation split by domain but allow an override to not split by domain in some cases? HOT 5
- "Incompatible version of the passenger gem" even when Passenger has the right version HOT 7
- GRPC integration logging error even when tracing is disabled HOT 1
- We had a use case for Datadog::Tracing::Contrib::HTTP::Instrumentation.after_request HOT 3
- Wrong MIME/Content-Type for code provenance multipart data HOT 2
- Support tracing of Mysql2 gem prepared statements HOT 2
- Datadog::Tracing.correlation without trace information HOT 1
- AppSec crashes when parsing integer HTTP headers (undefined method `tr' for nil:NilClass (NoMethodError)) HOT 3
- Rails tracing produces duplicate mysql2 spans
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dd-trace-rb.