Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
SDKs: Distributed Tracing (#1074)
Browse files Browse the repository at this point in the history
* Initial version of distributed tracing documentation.
  • Loading branch information
antonpirker authored Nov 6, 2023
1 parent fc5ba8d commit 4eabd8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default () => {
<SidebarLink to="/sdk/store/">Store Endpoint</SidebarLink>
<SidebarLink to="/sdk/envelopes/">Envelopes</SidebarLink>
<SidebarLink to="/sdk/rate-limiting/">Rate Limiting</SidebarLink>
<SidebarLink to="/sdk/distributed-tracing/">Distributed Tracing</SidebarLink>
<SidebarLink to="/sdk/performance/" title="Performance">
<SidebarLink to="/sdk/performance/span-operations/">
Span Operations
Expand Down
21 changes: 21 additions & 0 deletions src/docs/sdk/distributed-tracing/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Distributed Tracing"
---

This document describes how a SDK should propagate information between different services to connect all telemetry (errors, profiles, replays, transaction) from those services into one trace.

For an overview see [Distributed Tracing](https://docs.sentry.io/product/performance/distributed-tracing/) in the product docs.

Sentry uses two containers to hold trace information [`sentry-trace`](/sdk/performance/#header-sentry-trace) and [`baggage`](/sdk/performance/dynamic-sampling-context/#baggage).

With these containers you can propagate a trace to a down-stream service. By either
- adding `sentry-trace` and `baggage` HTTP headers (when doing outgoing HTTP requests),
- adding `sentry-trace` and `baggage` as meta data (when putting tasks into a queue, details are specific to the queue you want to support), or
- setting environment variables (when calling another process). In this case the env variables should be called `SENTRY_TRACE` and `SENTRY_BAGGAGE`.

The SDK running in the receiving service needs to make sure to pick up incoming trace information by
- reading `sentry-trace` and `baggage` headers for each incoming HTTP request,
- reading `sentry-trace` and `baggage` meta data when retrieving an item from a queue, or
- reading the environment variables `SENTRY_TRACE` and `SENTRY_BAGGAGE` on start up.

This trace information should be stored in the "propagation context" of the current scope. This makes sure that all telemetry that is emmited from the receiving service to Sentry will include the correct trace information.

1 comment on commit 4eabd8c

@vercel
Copy link

@vercel vercel bot commented on 4eabd8c Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

develop – ./

develop-git-master.sentry.dev
develop.sentry.dev

Please sign in to comment.