avatarYaron Dinur

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

4607

Abstract

id="5405">5. Modify the parameters to ensure reproduction. For example: – Configuring to the local environment</p><figure id="1b58"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*mdajBHv47ZvHuUaR.png"><figcaption></figcaption></figure><p id="4504">– Solving SSL issues:</p><figure id="0c07"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*tqXdjxI2ESXs25Cg.png"><figcaption></figcaption></figure><p id="407f">– Creating users – Changing users – And more</p><p id="66e4">(Changes can also be made straight in Helios).</p><p id="8468">6. Once the changes are made, track and visualize the traces in Helios again to ensure the issue was resolved:</p><figure id="9aca"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*0V8rTB6Zid4gEw6u.png"><figcaption></figcaption></figure><p id="21bf">The request we modified is now ok, but there is another error in a request to the payment service that caused the call to fail.</p><p id="9d7c">7. Open the trace:</p><figure id="7e12"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*gdPO8ipMQ8td_LXB.png"><figcaption></figcaption></figure><figure id="24f2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*8DwPWDo8gzUI_NTl.png"><figcaption></figcaption></figure><p id="2047">8. Generate the trigger code for the whole flow:</p><figure id="ad75"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*yAoy-L-0g_KWNnYp.png"><figcaption></figcaption></figure><p id="47e2">9. Make any required changes, in this case — change the amount to pass the minimum:</p><figure id="60e2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*ZB5B6n5HK2eMNqhw.png"><figcaption></figcaption></figure><p id="91d1">10. When printing the status code, Helios provides request information from deep inside the call:</p><figure id="561b"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*aQ0rYPRY684cyFAs.png"><figcaption></figcaption></figure><p id="f927">This provides more information in just a few minutes than any production monitoring tool, enabling fast troubleshooting, debugging, and issue resolution.</p><h1 id="350f">2. Reproduce Errors and Issues in Microservices with cURL</h1><p id="7ecd">Not everyone likes to use complex code to reproduce their issues. Maybe you’re a cURL type of person. This time we will look at using cURL to reproduce the call.</p><p id="8f54">11. Generate a trigger code like before. But this time, choose the cURL option:</p><figure id="94f3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*eMnYi_ao0Y4pOmXZ.png"><figcaption></figcaption></figure><p id="3c19">12. Modify any relevant parameters, like the host or the body.</p><p id="4e16">13. Copy the command and run it.</p><p id="84cc">14. You will see new, modified traces in Helios:</p><figure id="4420"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*zvZBF_YoR-ShmrBE.png"><figcaption></figcaption></figure><h1 id="78b7">3. Reproduce Errors and Issues in Microservices with Postman</h1><p id="b52f">Helios also works with Postman and lets you reproduce and troubleshoot issues there.</p><p id="af96">15. Open Postman and create a new HTTP request:</p><figure id="77c3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*nNcxL_XiIlJqHng2.png"><figcaption></figcaption></figure><p id="95f4">16. To fill in the parameters, go back to the trace in Helios and generate the trigger code.</p><figure id="ee38"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*acXOab2qOeKRqepE.png"><figcaption></figcaption></figure><p id="069e">17. Import the code into Postman.</p><figure id="fd07"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*WY_GoyGYvhGov7UN.png"><figcaption></figcaption></figure><p id="2658">18. The code can be modified straight in Postman:</p><figure id="2f26"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*WzDAs_pPkD4ITJD7.png"><figcaption></figcaption></figure><p id="85da">19. Go back to Helios and see the resolved changes in action:</p><figure id="988a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*bFNzH9t_oIamXMYa.png"><figcaption></figcaption></figure><h1 id="6fea">Wrap up</h1><p id="2ba2">In this blog post, we have seen that reproducing issues in distributed applications could be complex — as we do not always have all the data we need in order to make the exact same call. We have also seen here how tracing using OpenTelemetry with the help of the Helios platform turns this cumbersome process into a simple click of a button which

Options

saves us a lot of time and effort.</p><p id="11bc">Hope this helps. Thank you for reading.</p><h2 id="5b0a">Further Reading:</h2><div id="fb60" class="link-block"> <a href="https://gethelios.dev/blog/5-microservices-challenges-and-blindspots-for-developers/?utm_source=medium&amp;utm_medium=cloud+native+daily"> <div> <div> <h2>5 Microservices Challenges and Blindspots for Developers</h2> <div><h3>Microservices dev top 5 challenges and solutions: testing, observability, troubleshooting & debugging, services…</h3></div> <div><p>gethelios.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*BtNlPtus6zGHrd20)"></div> </div> </div> </a> </div><div id="6b65" class="link-block"> <a href="https://gethelios.dev/opentelemetry-a-full-guide/?utm_source=medium&amp;utm_medium=cloud+native+daily"> <div> <div> <h2>OpenTelemetry: A full guide</h2> <div><h3>Learn all about OpenTelemetry OpenSource and how it transforms microservices observability and troubleshooting</h3></div> <div><p>gethelios.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*14nkk-K--KvZUTPf)"></div> </div> </div> </a> </div><div id="5c2a" class="link-block"> <a href="https://gethelios.dev/blog/cut-engineering-costs-save-time-helios?utm_source=medium&amp;utm_medium=referral&amp;utm_campaign=cloud+native+daily"> <div> <div> <h2>Microservices Monitoring: Cutting Engineering Costs and Saving Time</h2> <div><h3>A few ways fort leveraging Helios to save on engineering costs and dev time for a more resource-efficient organization…</h3></div> <div><p>gethelios.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*mx26JXKwJL1su9Ej)"></div> </div> </div> </a> </div><div id="fb08" class="link-block"> <a href="https://javascript.plainenglish.io/9-best-distributed-tracing-tools-for-developers-185e415b7101"> <div> <div> <h2>9 Best Distributed Tracing Tools for Developers</h2> <div><h3>Decide Among The Best Tools For Distributing Tracing in your Backend Microservices Architecture</h3></div> <div><p>javascript.plainenglish.io</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*Zs2euUMGhcYfmkvnwYo3mQ.png)"></div> </div> </div> </a> </div><div id="ae09" class="link-block"> <a href="https://gethelios.dev/blog/evaluating-distributed-tracing-tools-a-guide/?utm_source=medium&amp;utm_medium=referral&amp;utm_campaign=cloud+native+daily"> <div> <div> <h2>Evaluating distributed tracing tools: A guide</h2> <div><h3>Explore this guide to establish a framework for evaluating distributed tracing tools based on core functionality…</h3></div> <div><p>gethelios.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*73h2-2V5cPg0yVX0)"></div> </div> </div> </a> </div><div id="f51b" class="link-block"> <a href="https://gethelios.dev/blog/combinining-opentelemetry-traces-with-prometheus-metrics-to-build-a-powerful-alerting-mechanism/?utm_source=medium&amp;utm_medium=referral&amp;utm_campaign=cloud+native+daily"> <div> <div> <h2>Combining OTel and Prometheus metrics for alerting machine</h2> <div><h3>Using both OpenTelemetry and Prometheus, we delivered a trace-based alerting mechanism quickly and efficiently - here's…</h3></div> <div><p>gethelios.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*1lZT5UCoskImwj1k)"></div> </div> </div> </a> </div></article></body>

3 Ways to Reproduce Issues in Microservices

How to reproduce issues in distributed applications in 3 different ways — Code (a Python or JavaScript Script), cURL, and Postman.

Let’s say we have an issue in production. We’ve all been there, right? The first thing we want to be able to do is reproduce errors and issues. By reproducing errors, we can confirm it’s a recurring issue, rather than a sporadic one, and that it requires a fix to ensure that our product is working properly.

When shifting from a monolith to microservices, the ability to reproduce errors becomes more of a challenge. Reproduction in monoliths is easy — most entry points are simple HTTP calls and there is just one service.

But reproducing issues in distributed systems is harder. When noticing an issue in a flow that involves service A, service B, databases, Kafka queues, service C, etc. — identifying the root cause of the issue is much more complex.

Today, developers often use logs and metrics with production monitoring solutions like Sentry or Airbrake. Once they get an alert, they parse the logs, copy the data into their UI or CLI, attempt a manual call at the endpoint, scrape information and eventually somehow find out they were missing a token or a header. The challenge is that solutions like Sentry don’t provide context. They lack information like who made the call, which makes reproducing issues more difficult.

In this blog post, we’ll show you how to use distributed tracing platforms like Helios to see the traces and spans (span = an operation in the system, trace = a collection of connected spans), and use them to modify requests when reproducing, gaining visibility into the system.

Learn more about the role of distributed tracing in identifying bottlenecks:

We will show how to reproduce issues in three different ways:

  1. Code — a Python or JavaScript Script
  2. cURL
  3. Postman

Let’s get started! You can also watch this video on debugging and troubleshooting production issues in microservices.

1. Reproduce Errors and Issues in Microservices with Python or JavaScript

Our trace provides us with all contextual data of the requests like payloads, attributes and data flows inside the system. It also shows the errors. In the image below, you can see the error we will be reproducing: “Invalid Currency Bitcoin”:

One option to reproduce issues is to write a Python or JavaScript script that will recreate the original call with the headers, body, URL, etc.

Helios now enables automatically generating the script straight from Helios. The code, available in either Python or JavaScript, already has all the payloads and errors in it and is ready for modification and running.

  1. Open the trace
  2. Click on the lightning icon — “Replay flow”

You will see this screen with the code:

4. Save the code and run it.

5. Modify the parameters to ensure reproduction. For example: – Configuring to the local environment

– Solving SSL issues:

– Creating users – Changing users – And more

(Changes can also be made straight in Helios).

6. Once the changes are made, track and visualize the traces in Helios again to ensure the issue was resolved:

The request we modified is now ok, but there is another error in a request to the payment service that caused the call to fail.

7. Open the trace:

8. Generate the trigger code for the whole flow:

9. Make any required changes, in this case — change the amount to pass the minimum:

10. When printing the status code, Helios provides request information from deep inside the call:

This provides more information in just a few minutes than any production monitoring tool, enabling fast troubleshooting, debugging, and issue resolution.

2. Reproduce Errors and Issues in Microservices with cURL

Not everyone likes to use complex code to reproduce their issues. Maybe you’re a cURL type of person. This time we will look at using cURL to reproduce the call.

11. Generate a trigger code like before. But this time, choose the cURL option:

12. Modify any relevant parameters, like the host or the body.

13. Copy the command and run it.

14. You will see new, modified traces in Helios:

3. Reproduce Errors and Issues in Microservices with Postman

Helios also works with Postman and lets you reproduce and troubleshoot issues there.

15. Open Postman and create a new HTTP request:

16. To fill in the parameters, go back to the trace in Helios and generate the trigger code.

17. Import the code into Postman.

18. The code can be modified straight in Postman:

19. Go back to Helios and see the resolved changes in action:

Wrap up

In this blog post, we have seen that reproducing issues in distributed applications could be complex — as we do not always have all the data we need in order to make the exact same call. We have also seen here how tracing using OpenTelemetry with the help of the Helios platform turns this cumbersome process into a simple click of a button which saves us a lot of time and effort.

Hope this helps. Thank you for reading.

Further Reading:

Microservices
Distributed Tracing
Observability
Opentelemetry
Distributed Systems
Recommended from ReadMedium