]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/examples/etw_threads/README.md
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / examples / etw_threads / README.md
1 # ETW Exporter multithreaded context propagation example
2
3 ## Preface
4
5 This example shows how to pass context from main dispatcher thread to worker threads.
6 While this example is convenient to run in Visual Studio with ETW exporter, the same
7 logic should apply to any other exporter. Only the initial portion that obtains ETW
8 Tracer is unique to ETW, the rest can be reused.
9
10 ## How to debug events in Visual Studio 2019 or newer
11
12 Specify your component instrumentation name, which should match the destination ETW
13 Provider Name or GUID. Example uses "OpenTelemetry-ETW-TLD" for the instrument /
14 instrumentation name.
15
16 In Visual Studio IDE:
17
18 - navigate to `View -> Other Windows -> Diagnostic Events...`
19 - click `Configure...` gear on top.
20 - specify `OpenTelemetry-ETW-TLD` in the list of providers to monitor.
21 - run example.
22 - `Diagnostic Events` view shows you the event flow in realtime.
23
24 ## Explanation of the code flow
25
26 `main` function acts as a dispatcher to manage thread pool called `pool`. `beep_bop`
27 span is started in the `main`. Then in a loop up to `kMaxThreads` get started
28 concurrently. Each thread executing `beep` function with a parent scope of `main`.
29 `beep` subsequently calls into `bop` function, with a parent scope of `beep` span.
30 Entire execution of all threads is grouped under the main span called `beep_bop`.
31 At the end of execution, the `main` function joins all pending threads and ends
32 the main span.