Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Enrich existing open tracing spans with additional data #787
Comments
|
I'd like to take a look at implementing this. I'm reading up on the Jaeger project and open traces and then should have a plan. |
|
Great @nwneisen :) Take your time for research, then we can sync here and agree about implementation. |
|
@nwneisen fantastic! What would be great also is that - once this is done - you document it through a blogpost (with nice screenshots), so that we have a documentation for other developers how to use OpenTarcing with Mainflux. Your text will be then featured on Mainflux official blog: https://medium.com/mainflux-iot-platform (you can ping @Sale72 to help you with the draft process). Also, it would be great to add a chapter in the official documentation as well. |
|
After playing around with Jaeger and its examples, I think I've got my head wrapped around traces. I found were spans are currently being created in mainflux. One such location is things/tracing/things.go. Here From here the span will be passed to the database code at things/postgres/things.go via the context parameter. The span can be pulled out and have tags such as the query string and parameters added here. There are also some error cases that could be added to the span logs. |
|
@nwneisen yes, that is basically what we would like to have. The query string will be problematic to add to the span because driver creates end SQL statement that will be sent to the PostgreSQL under the hood. There are some interceptors (such as this one) that are being developed, but they are not stable IMHO and shouldn't be used in Mainflux. I'm not sure how we should approach this SQL statement logging problem. |
|
I pushed a draft of my current changes. While I made sure everything built, I put the code in place to pull the span from the context. Right now it it adds the SQL query before it has values in place. I can only think of two options for the sql.statement:
The first option would not follow the open tracing recommendations but would provide the same tracing information until an interceptor looks more stable. The second option doesn't really seem like an option as I think it suggests it is the final query to be ran on the database when it is not. |
|
@nwneisen, @anovakovic01, @drasko as #869 has been merged, can this issue be closed or is there something more to do? |
|
@chombium we weren't able to add all of the tags suggested in the specification. This might be still open to keep those additional tags in mind to be added later. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

FEATURE REQUEST
Is there an open issue addressing this request? If it does, please add a "+1" reaction to the
existing issue, otherwise proceed to step 2.
No.
Describe the feature you are requesting, as well as the possible use case(s) for it.
After adding base open tracing support, spans should be enriched with additional tags. There is a recommendation of what should be added to the span and you can check it out here. One of the problems that we'll have to solve is how to write some kind of interceptor to the existing DB client in order to fetch SQL statements and passed params. The end goal should be removing separate logging and metrics middleware.
Indicate the importance of this feature to you (must-have, should-have, nice-to-have).
The text was updated successfully, but these errors were encountered: