2acd2dd48fd3cb5f4cfdbe301223220b07775cd9
[ric-plt/tracelibcpp.git] / README.md
1 # RIC tracing helper library
2
3 The library includes a function for creating a tracer instance.
4
5 ToDo: tracer configuration options
6
7 ## Usage
8
9 Create a global tracer
10
11 ```c
12     #include <opentracing/tracer.h>
13     #include <tracelibcpp/tracelibcpp.hpp>
14
15     opentracing::Tracer::InitGlobal(tracelibcpp::createTracer("my-service-name"));
16 ```
17 Span context propagation between different software components in RIC is using a
18 TextMap carrier and JSON format serialization.
19 The [opentracing C++](https://github.com/opentracing/opentracing-cpp) Readme gives examples
20 how span context **inject** and **extract** with textmap can be done.
21 Serialization to JSON can be done with any JSON library.
22
23 ## Requires
24
25 cmake
26 gcc/c++
27
28 ## Build
29 mkdir build
30 cd build
31 cmake ..
32 make
33
34 ## Unit testing
35 To run unit tests the project needs to be configured with testing option
36 cmake -DWITH_TESTING=ON ..
37 make check
38 Or with output
39 CTEST_OUTPUT_ON_FAILURE=1 make check
40
41 ## Coverage
42 Unit testing generates also coverage data. To get that in html format run commands, assuming
43 you are building in `build` dir under the tracelibcpp
44 ```shell
45 lcov -c --no-external --base-directory $(dirname $PWD)  --directory . --output-file cov.info
46 genhtml cov.info
47 ```
48
49 ## License
50
51 See [LICENSES.txt](LICENSES.txt) file.