instana / ruby-sensor

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

Instana Agent process resolution problems. #178

Closed Adithya-copart closed 4 years ago

Adithya-copart commented 4 years ago

After a recent update to our instana-agent, the agent is unable to detect the ruby processes during announce and this is not an ephemeral error.

We updated the instana gem in our application running JRuby-9.2.9.0 to see if it solves the problem but it did not work.

A bare-bones reproduction using latest C-Ruby and the instana gem did not work either. Here is the Dockerfile used to test.

Dockerfile:

FROM ruby:latest
RUN apt-get -y update && \
  apt-get -y install dumb-init
RUN gem install instana
ENV INSTANA_HOST_IP='x.x.x.x'
ENV INSTANA_DEBUG=true
ENTRYPOINT ["/usr/bin/dumb-init", "-v","--"]
CMD ruby -r instana -e 'sleep 500'; sleep 600

Error in the agent: 2020-01-23T20:01:09.094+0000 | ERROR | -client-thread-4 | Ruby | 134 - com.instana.discovery-ruby - 1.3.2 | Could not find the process RubyProcess{pid='10', pidFromParentNS='false', name='ruby', arguments=[-r, instana, -e, sleep 500], cpuSetFileContent='/docker/48cde0be658d01961de1f207bd7ce295da774ffbf7b5e0ec0ebdcc00e8d72ec6', fd='5', inode='socket:[4179433779]'}.

One of my colleagues wonder if the update in https://github.com/instana/agent-updates/commit/eb06af88ffff666345ff74e0427fa76f1f99b9d1 is anyway responsible for this.

Feel free to close this bug if this is not an issue with the gem itself. I wanted to file this to make sure the announce payload generated by the gem is right and if it is being resolved by the agent correctly as per the attached logs.

pglombardo commented 4 years ago

Hi @Adithya-copart - you are right. We have a fix pending release that will be in agent-updates soon. Thanks for letting us know. I'll update here again once it's out.

pglombardo commented 4 years ago

And the fix (Ruby Discovery 1.4.1) is out: https://github.com/instana/agent-updates/commit/f7191546b21f30208bd885c7b3361a52f19ade5e

The agent sensor will update automatically overnight or you can manually restart the agent to get it sooner.

This should resolve the issue - could you confirm let me know?

Adithya-copart commented 4 years ago

@pglombardo Confirmed that the issue is resolved on our end after agent upgrade.

I hope changes are being made to address how this issue is missed. Maybe use a live agent instance for some tests here or spin up different clients in the instana-agent specs?