Skip to content

Commit

Permalink
Update distributed-tracing.mdx (#9160)
Browse files Browse the repository at this point in the history
Fix formatting
  • Loading branch information
vivianyentran authored Feb 16, 2024
1 parent 37b224a commit e8216b0
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ Let's say, in this simplified example, that when a user loads the app in their b
- _Browser_
- 1 request each for HTML, CSS, and JavaScript
- 1 rendering task, which sets off 2 requests for JSON data
^
- _Backend_
- 3 requests to serve static files (the HTML, CSS, and JS)
- 2 requests for JSON data - 1 requiring a call to the database - 1 requiring a call to an external API and work to process the results before returning them to the frontend
^
- _Database Server_
- 1 request which requires 2 queries
- 1 query to check authentication
Expand Down Expand Up @@ -97,16 +95,13 @@ Now, for the sake of completeness, back to our spans:

- _Backend HTML/CSS/JS Request Transactions_: 1 span each
- 1 root span representing the entire request (child of a browser span)
^
- _Backend Request with DB Call Transaction_: 2 spans
- 1 root span representing the entire request (child of a browser span)
- 1 span for querying the database (parent of the database server transaction)
^
- _Backend Request with API Call Transaction_: 3 spans
- 1 root span representing the entire request (child of a browser span)
- 1 span for the API request (unlike with the DB call, _not_ a parent span, since the API is external)
- 1 span for processing the API data
^
- _Database Server Request Transaction_: 3 spans
- 1 root span representing the entire request (child of the backend span above)
- 1 span for the authentication query
Expand All @@ -125,21 +120,18 @@ If your application involves e-commerce, you likely want to measure the time bet
- The browser's full process (_T_ and root span _S_)
- XHR request to backend\* (_S_)
- Rendering confirmation screen (_S_)
^
- Your backend's processing of that request (_T_ and root span _S_)
- Function call to compute total (_S_)
- DB call to store order\* (_S_)
- API call to payment processor (_S_)
- Queuing of email confirmation\* (_S_)
^
- Your database's work updating the customer's order history (_T_ and root span _S_)
- Individual SQL queries (_S_)
^
- The queued task of sending the email (_T_ and root span _S_)
- Function call to populate email template (_S_)
- API call to email-sending service (_S_)

_Note:_ Starred spans represent spans that are the parent of a later transaction (and its root span).
\* Starred spans represent spans that are the parent of a later transaction (and its root span).

#### Monitoring a Background Process

Expand All @@ -150,15 +142,13 @@ If your backend periodically polls for data from an external service, processes
- Processing function (_S_)
- Call to caching service\* (_S_)
- API call to internal service\* (_S_)
^
- The work done in your caching service (_T_ and root span _S_)
- Checking cache for existing data (_S_)
- Storing new data in cache (_S_)
^
- Your internal service's processing of the request (_T_ and root span _S_)
- Anything that service might do to handle the request (_S_)

_Note:_ Starred spans represent spans that are the parent of a later transaction (and its root span).
\* Starred spans represent spans that are the parent of a later transaction (and its root span).

### The Tracing Data Model

Expand Down

0 comments on commit e8216b0

Please sign in to comment.