![]() ![]() Of course, MongoDB isn’t a standard way of implementing a pub-sub mechanism, but this happens all the time in the day-to-day of developers – we repurpose existing tools for different purposes. Our customer used MongoDB as a pub-sub platform, where one microservice (A) wrote a document with some information to MongoDB and another microservice (B) was periodically reading from the same collection, fetching the written documents and performing some logic. Use case #1: Propagating context in a MongoDB-based async flow Here are some of the examples we encountered and how we solved them. We then helped them inject the context onto that “carrier” and then extract it at the other side of the transaction. To connect the disjointed parts of the flow into a single trace, we needed to first help our customers think about how and what could be the “carrier” for the context in non-HTTP communications. #Hello beyond manual#When the context fails to pass between two components in a specific flow, a new context will be initialized mid-flow, and it’ll be complex, time-consuming, and manual to connect between the parts. What happens if the context is not passed? #Hello beyond free#There are currently several protocols for context propagation that OTel recognizes which are implicit (performed automatically) and free the programmer from having to explicitly pass the context.įor those cases where context needs to be passed manually – though it may sound simple – it can be challenging to identify which mechanism (“carrier”) can be used to propagate the context (similar to using the request’s headers in HTTP communication) and how and where to implement it. Propagation is often performed by utilizing HTTP headers. Metadata collected from multiple components is reassembled into a coherent trace capturing what happened in that specific flow. Context propagation is a mechanism by which a context object (request metadata) passes in a transaction between and across components in microservices. Requests are tracked as they propagate through distributed systems. OpenTelemetry (OTel) enables organizations to use distributed tracing by streamlining end-to-end tracing. ![]() Some context on context propagationīut first, a few words on context propagation.Īs noted above, distributed tracing is a tool used to monitor applications, particularly those using microservices. We describe how we did this in two examples below those are just a drop in the ocean of creative solutions we need to come up with as we encounter more use cases in the field. We solved these issues by exposing an OpenTelemetry method of propagating context and guided our customers on where to apply it in their specific use-cases. We realized the issues our customers were facing stemmed from the trace’s context failing to pass between some components in the flow. When it works, it can save developers a great deal of time in building and operating modern applications. This meant they were missing the main benefits of distributed tracing, which allows you to track a specific flow, a request, as it moves and progresses through the system, enabling you to connect the dots between the different components to understand a certain flow. We’ve recently come across several interesting use cases across our customers who installed Helios to integrate distributed tracing into their system, and ended up seeing parts of a specific flow broken into several traces instead of a single one. ![]() Our customers too sometimes have to build creative solutions to deal with unique situations – which then motivates us to build creative solutions as well. In development in general, we often have our beliefs on what should happen in theory and we rely on Hello-World examples, only to be surprised by what happens in reality. In our line of work, it’s not uncommon to encounter customers that have custom workflows or architectures that may not always support distributed tracing mechanisms. Unlocking the magic of distributed tracing across all kinds of interactions between microservices ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |