@@ -81,21 +81,32 @@ Now that you have created your server, lets see how GoFr by default manages obse
8181
8282 GoFr also provides supports to create requirement specific metrics using [ custom metrics] ( /docs/advanced-guide/publishing-custom-metrics ) .
8383
84-
8584## Tracing
85+ Tracing is a powerful tool for gaining insights into your application's behaviour, identifying bottlenecks, and improving
86+ system performance. A trace is a tree of spans. It is a collective of observable signals showing the path of work
87+ through a system. A trace on its own is distinguishable by a ` TraceID ` .
8688
87- GoFr adds traces by default for all the request and response,which allows you to export it to zipkin by adding the configs.
88- It allows to monitor the request going through different parts of application like database, handler etc.
89+ In complex distributed systems, understanding how requests flow through the system is crucial for troubleshooting performance
90+ issues and identifying bottlenecks. Traditional logging approaches often fall short, providing limited visibility into
91+ the intricate interactions between components.
8992
90- To see the traces install zipkin image using the following docker command
9193
92- ### Setup
94+ To know more about Tracing click [ here ] ( https://opentelemetry.io/docs/concepts/signals/#traces ) .
9395
94- ``` bash
95- docker run --name gofr-zipkin -p 2005:9411 -d openzipkin/zipkin:latest
96- ```
9796
98- ### Configuration & Usage
97+ ### Automated Tracing in GoFr
98+ GoFr makes it easy to use tracing by automatically adding traces to all requests and responses. GoFr uses
99+ [ OpenTelemetry] ( https://opentelemetry.io/docs/concepts/what-is-opentelemetry/ ) , a popular tracing framework, to
100+ automatically add traces to all requests and responses.
101+
102+ ** Automatic Correlation ID Propagation:**
103+
104+ When a request enters your GoFr application, GoFr automatically generates a correlation ID X-Correlation-ID and adds it
105+ to the request headers. This correlation ID is then propagated to all downstream requests. This means that you can track
106+ a request as it travels through your distributed system by simply looking at the correlation ID in the request headers.
107+
108+
109+ ### Configuration & Usage
99110
100111 Add Tracer configs in ` .env ` file, your .env will be updated to
101112
@@ -112,12 +123,16 @@ Now that you have created your server, lets see how GoFr by default manages obse
112123 DB_NAME=test_db
113124 DB_PORT=3306
114125
126+ # tracing configs
115127 TRACER_HOST=localhost
116128 TRACER_PORT=2005
117129
118130 LOG_LEVEL=DEBUG
119131 ```
120132
121- Open [ zipkin] ( http://localhost:2005/zipkin/ ) and search by TraceID (correlationID) to see the trace.
133+ > ** NOTE:** If the value of ` TRACER_PORT ` is not
134+ provided, gofr uses port ` 9411 ` by default.
135+
136+ Open [ zipkin] ( http://localhost:2005/zipkin/ ) and search by TraceID (correlationID) to see the trace.
122137
123138{% figure src="/quick-start-trace.png" alt="Pretty Printed Logs" /%}
0 commit comments