-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathREADME.adoc.in
90 lines (63 loc) · 2.03 KB
/
README.adoc.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
= opentracing-c
image:https://travis-ci.org/opentracing/opentracing-c.svg?branch=master["Build Status", link="https://travis-ci.org/opentracing/opentracing-c"]
image:https://codecov.io/gh/opentracing/opentracing-c/branch/master/graph/badge.svg["Coverage", link="https://codecov.io/gh/opentracing/opentracing-c"]
ANSI C implementation of the OpenTracing API http://opentracing.io.
== Required Reading
In order to understand the C platform API, one must first be familiar with the
http://opentracing.io[OpenTracing project] and
http://opentracing.io/documentation/pages/spec[terminology] more generally.
== Doxygen
API docs generated using Doxygen are hosted
https://opentracing.github.io/opentracing-c[here] on GitHub pages.
== Compile and install
[source,sh]
----
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
----
To test:
[source,sh]
----
$ make test
----
== API overview for those adding instrumentation
Everyday consumers of this `opentracing-c` package really only need to worry
about a couple of key abstractions: the `opentracing_tracer` `start_span`
function, the `opentracing_span` interface, and binding an `opentracing_tracer`
at `main()`-time. Here are code snippets demonstrating some important use cases.
=== Singleton initialization
The simplest starting point is `opentracing-c/tracer.h`. As early as possible,
call
:sourcedir: examples
[source,c]
----
@main_snippet@
----
=== Non-singleton initialization
If you prefer direct control to singletons, manage ownership of the
`opentracing_tracer` implementation explicitly.
=== Starting an empty trace by creating a "root span"
It's always possible to create a "root" `opentracing_span` with no parent or
other causal reference.
[source,c]
----
@new_span_snippet@
----
==== Creating a (child) span given an existing (parent) span
[source,c]
----
@existing_span_snippet@
----
==== Inject span context into an opentracing_text_map_writer
[source,c]
----
@inject_snippet@
----
==== Extract span context from an opentracing_text_map_reader
[source,c]
----
@extract_snippet@
----