Giter Site home page Giter Site logo

Comments (4)

andrewslotin avatar andrewslotin commented on June 12, 2024

@manojpandey, could you verify if the exit RabbitMQ spans have proper kind?

from python-sensor.

pglombardo avatar pglombardo commented on June 12, 2024

Because rabbitmq is a dual type span (entry & exit) based on the sort key it's registered in both ENTRY_SPANS and EXIT_SPANS.

So the default exit kind for all spans is 1 (entry):

self.k = 1

Then through the if statement the exit type condition gets hit (because rabbitmq is a member of ENTRY_SPANS):

elif span.operation_name in self.EXIT_SPANS:
self.k = 2 # exit
self._populate_exit_span_data(span)

Then we set it back to exit type if the sort key matches:

if "rabbitmq" in self.data and self.data["rabbitmq"]["sort"] == "consume":
self.k = 1 # entry

The path of the logic is solid although it's not that evident and could possibly be reorganised to be easier to understand. rabbitmq is special case because of the kind duality.

It looks like the tests are not validating the kind type so ideally that should be added to the test runs:
https://github.com/instana/python-sensor/blob/master/tests/clients/test_asynqp.py

from python-sensor.

andrewslotin avatar andrewslotin commented on June 12, 2024

Hey @pglombardo, great to see you again! I see the point, however the problem is that rabbitmq is listed both in ENTRY_SPANS and EXIT_SPANS, and while processing it we'll hit the branch that uses _populate_entry_span_data() and keeps the self.k unchanged, so by the time the if "rabbitmq" in self.data and self.data["rabbitmq"]["sort"] == "consume" is executed, self.k will be still set to 1.

from python-sensor.

pglombardo avatar pglombardo commented on June 12, 2024

Vacation has obviously made me weak. I see the bug now. :-)

from python-sensor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.