-
Notifications
You must be signed in to change notification settings - Fork 179
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
Support ignoring queries in the pg instrumentation #955
Support ignoring queries in the pg instrumentation #955
Conversation
|
Thank you for your contribution. We strive to reduce the number of configuration options and complexity in client instrumentation. Generally speaking we recommend using the otel collector or vendor solution to filter spans. Have you considered adding a span filter for this in your collector? https://opentelemetry.io/docs/collector/transforming-telemetry/#basic-filtering |
@arielvalentin, thats an interesting perspective. At $work we've been taking the "dumb-pipes" approach and keeping as much logic out of collector as possible. This has the advantage of folks being able to get a good sense of how the app is instrumented as our logs emit a waterfall view of the trace in a cognitively similar way to our production observability tool. What is driving the philosophy of leveraging the collector for this sort of thing? |
@robertlaurin thank you for the comprehensive response, this seems like a very reasonable path forward and I may go with it. Would taking this approach imply that all events will be subjected to the sampler, i.e. every span will be tested to see if it matches |
That's correct, every span is evaluated against the sampler on create so you want to keep that in mind when you write your sampling logic. Depending on the volume of spans you emit in any given operation in your service this may or may not be considered a hot path. Internally at our org we typically short circuit all the sampler rules with a For example we would do the following to drop database spans in a sampler kind == :client && attributes&.key?('db.system') |
This PR adds support for ignoring queries sent to the
pg
instrumentation, similar tountraced_hosts
for thenet_http
instrumentation.The motivation for the feature is to ignore some frequent but low-value queries, in our case, the
;
query which is used by ActiveRecord to check if a connection is active.