instana / ruby-sensor

💎 Ruby Distributed Tracing & Metrics Sensor for Instana
https://www.instana.com/
MIT License
26 stars 25 forks source link

No backtrace button seeing related stack traces #187

Closed daande closed 3 years ago

daande commented 3 years ago

Locally I have backtracing working correct with an instana agent running locally and seeing logs like this:

Reporting 47 spans
Reporting 14 spans
Reporting 16 spans
Reporting 16 spans
Reporting 16 spans
...

And the backtracing button is available image

However inside our infrastructure we are seeing the following stack traces and no backtracing button:

2020-11-19 15:24:44 +0000: DEBUG Instana:  Reporting 6 spans
2020-11-19 15:24:44 +0000: DEBUG Instana:  report_spans:agent.rb:366: Failed to dump Resolv::IPv4 Object to JSON in strict mode.

2020-11-19 15:24:44 +0000: DEBUG Instana:  /usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:354:in `dump'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:354:in `report_spans'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/tracing/processor.rb:55:in `send'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:172:in `block in setup'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/timer.rb:119:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/events.rb:64:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/events.rb:105:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/group.rb:115:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/group.rb:100:in `wait'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:203:in `start'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:109:in `block (2 levels) in spawn_background_thread'
2020-11-19 15:24:44 +0000: DEBUG Instana:  Reporting 11 spans
2020-11-19 15:24:44 +0000: DEBUG Instana:  report_spans:agent.rb:366: Failed to dump Resolv::IPv4 Object to JSON in strict mode.

2020-11-19 15:24:44 +0000: DEBUG Instana:  /usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:354:in `dump'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:354:in `report_spans'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/tracing/processor.rb:55:in `send'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:172:in `block in setup'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/timer.rb:119:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/events.rb:64:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/events.rb:105:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/group.rb:115:in `fire'
/usr/local/bundle/gems/timers-4.3.2/lib/timers/group.rb:100:in `wait'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:203:in `start'
/usr/local/bundle/gems/instana-1.11.6/lib/instana/agent.rb:109:in `block (2 levels) in spawn_background_thread'
2020-11-19 15:24:52 +0000: DEBUG Instana:  Reporting 3 spans

Wondering how we can fix it?

pglombardo commented 3 years ago

HI @daande,

Failed to dump Resolv::IPv4 Object to JSON in strict mode.

It looks like you could be calling set_tag with a value that can't be serialized - (Resolv::IPv4 Object). I don't believe we ever log an IPv4 object ourselves.

If you are setting that value, could you instead call set_tag with a string value of that object instead?

On my side, I'll will add some protections in the next gem version to better handle these cases.

daande commented 3 years ago

@pglombardo We are not calling set_tag anywhere in the codebase any other ideas?

It is working locally if you want to hop on a call to see what I am looking at that might be helpful as well?

pglombardo commented 3 years ago

Hi Dane - Just saw your reply and ticket. It's after hours for me and I responded on the ticket to schedule something hopefully tomorrow if possible. Let's continue on the ticket to schedule.

daande commented 3 years ago

@pglombardo I think we can close this ticket now as your recent release to the gem have fixed the issue reported above