Skip to content
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

Rails tracing produces duplicate mysql2 spans #3784

Open
mmarinaccio opened this issue Jul 16, 2024 · 2 comments
Open

Rails tracing produces duplicate mysql2 spans #3784

mmarinaccio opened this issue Jul 16, 2024 · 2 comments
Assignees
Labels
bug Involves a bug community Was opened by a community member

Comments

@mmarinaccio
Copy link

mmarinaccio commented Jul 16, 2024

Current behaviour
After upgrading to version 2.2.0 of this gem, I'm now seeing duplicate mysql spans for my Rails application. It seems that both active_record and mysql2 components are producing redundant traces. I've tried disabling them but it they continue to appear.

Expected behaviour
A single mysql2 span for each mysql2 request made in my app process.

Steps to reproduce
image
image
image

How does datadog help you?
My team and I benefit immensely from Datadog observability! Quick debugging, performance optimization and proactive alerting.

Environment

  • datadog version: 2.2.0
  • Configuration block (Datadog.configure ...):
require 'datadog'

Datadog.configure do |c|
  c.env = Rails.env
  c.tracing.enabled = Rails.application.config.datadog_enabled

  # activate rails and framework configuration - https://docs.datadoghq.com/tracing/setup/ruby/#library-compatibility
  c.tracing.instrument :rails, enabled: true
  c.tracing.instrument :redis, enabled: true
  c.tracing.instrument :sidekiq, enabled: true, service_name: 'loyalsnap-sidekiq'
  c.tracing.instrument :rest_client, enabled: true, service_name: 'loyalsnap-rest-client'
  c.tracing.instrument :mysql2, enabled: false
  c.tracing.instrument :active_record, enabled: false
end
  • Ruby version: 3.3.3
  • Operating system: Ubuntu 22.04.4 LTS
  • Relevant library versions: Rails 6.1.7.7
@mmarinaccio mmarinaccio added bug Involves a bug community Was opened by a community member labels Jul 16, 2024
@gtrias
Copy link

gtrias commented Nov 13, 2024

Did you found how to fix it? We're facing the same issue with the mysql2 integration

@mmarinaccio
Copy link
Author

Did you found how to fix it? We're facing the same issue with the mysql2 integration

@gtrias Sadly, no. I never figured it out and since moved onto other things. I just upgraded from Rails 6 to 7. Maybe that will make a difference. I'll try again soon and post back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member
Projects
None yet
Development

No branches or pull requests

3 participants