Implementing open tracing mechanisms
When monitoring multiple, independent, and distributed microservices, the OpenTracing mechanism is preferred when managing API logs and traces. Tools such as Zipkin, Jaeger, and Skywalking are popular distributed tracing systems that can provide the setup for trace and log collections. In this prototype, we will be using the Jaeger tool to manage the application’s API traces and logs.
The current way to integrate an OpenTracing tool into FastAPI microservices is through the OpenTelemetry modules since the Opentracing for Python extension is already a deprecated module. To use Jaeger as the tracing service, OpenTelemetry has an OpenTelemetry Jaeger Thrift Exporter utility, which allows you to export traces to the Jaeger client applications. This exporter utility sends these traces to the configured agent using the Thrift compact protocol over UDP. But first, we need to install the following extension to utilize this exporter:
pip install...