docs/en/developers/trace-tools/Trace.md
A Distributed Trace, more commonly known as a Trace, records the paths taken by requests (made by an application or end-user) as they propagate through multi-service architectures, like microservice and serverless applications. Without tracing, it is challenging to pinpoint the cause of performance problems in a distributed system. It improves the visibility of our application or system’s health and lets us debug behavior that is difficult to reproduce locally. Tracing is essential for distributed systems, which commonly have nondeterministic problems or are too complicated to reproduce locally. Tracing makes debugging and understanding distributed systems less daunting by breaking down what happens within a request as it flows through a distributed system. A Trace is made of one or more Spans. The first Span represents the Root Span. Each Root Span represents a request from start to finish. The Spans underneath the parent provide a more in-depth context of what occurs during a request (or what steps make up a request). Many Observability back-ends visualize Traces as waterfall diagrams that may look something like this picture.
Waterfall diagrams show the parent-child relationship between a Root Span and its child Spans. When a Span encapsulates another Span, this also represents a nested relationship. Recently SR added a tracing framework. It leverages opentelemetry and jaeger to trace distributed events in the system.
Steps to enable tracing in SR:
decster@decster-MS-7C94:~/soft/jaeger-1.31.0-linux-amd64$ ll
total 215836
drwxr-xr-x 2 decster decster 4096 02-05 05:01:30 ./
drwxrwxr-x 28 decster decster 4096 05-18 18:24:07 ../
-rwxr-xr-x 1 decster decster 19323884 02-05 05:01:31 example-hotrod*
-rwxr-xr-x 1 decster decster 23430444 02-05 05:01:29 jaeger-agent*
-rwxr-xr-x 1 decster decster 51694774 02-05 05:01:29 jaeger-all-in-one*
-rwxr-xr-x 1 decster decster 41273869 02-05 05:01:30 jaeger-collector*
-rwxr-xr-x 1 decster decster 37576660 02-05 05:01:30 jaeger-ingester*
-rwxr-xr-x 1 decster decster 47698843 02-05 05:01:30 jaeger-query*
decster@decster-MS-7C94:~/soft/jaeger-1.31.0-linux-amd64$ ./jaeger-all-in-one
fe.conf
# Enable jaeger tracing by setting jaeger_grpc_endpoint
# jaeger_grpc_endpoint = http://localhost:14250
be.conf
# Enable jaeger tracing by setting jaeger_endpoint
# jaeger_endpoint = localhost:6831
http://localhost:16686/search(trace_pic2.png) (trace_pic3.png)
common/tracer.h/cpp (cpp), it's current usage(like write txn(load/insert/update/delete) trace, and its propagation to BE).