File: README.md

package info (click to toggle)
dd-opentracing-cpp 1.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,336 kB
  • sloc: cpp: 44,895; sh: 697; ansic: 27; makefile: 20
file content (122 lines) | stat: -rw-r--r-- 3,746 bytes parent folder | download | duplicates (2)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Datadog OpenTracing C++ Client

[![CircleCI](https://circleci.com/gh/DataDog/dd-opentracing-cpp/tree/master.svg?style=svg)](https://app.circleci.com/pipelines/github/DataDog/dd-opentracing-cpp?branch=master)

## Usage

Usage docs are on the main Datadog website:

* [NGINX](https://docs.datadoghq.com/tracing/setup/nginx/)
* [Envoy](https://docs.datadoghq.com/tracing/setup/envoy/)
* [Istio](https://docs.datadoghq.com/tracing/setup/istio/)
* [C++ code](https://docs.datadoghq.com/tracing/setup/cpp/)

For some quick-start examples, see the [examples](examples/) folder.

For detailed information about this library's configuration, see [configuration.md][2].

## Contributing

Before considering contributions to the project, please take a moment to read our brief [contribution guidelines](CONTRIBUTING.md).

## Build and Test (Linux and macOS)

### Dependencies

Building this project requires the following tools installed:

- Build tools (e.g. `build-essential`, xcode)
- `cmake` >= 3.1

Additional libraries are installed via a script.

### Build Steps

- Clone the repository
    ```sh
    git clone https://github.com/DataDog/dd-opentracing-cpp
    ```
- Install additional library dependencies (requires `sudo`)
    ```sh
    cd dd-opentracing-cpp
    sudo scripts/install_dependencies.sh
    ```
- Generate build files using `cmake`
    ```sh
    mkdir .build
    cd .build
    cmake ..
    ```
- Run the build
    ```sh
    make
    ```
- (Optional) Run the tests
    ```sh
    cmake -DBUILD_TESTING=ON ..
    make
    ctest --output-on-failure
    ```
- (Optional) Install to `/usr/local`
    ```sh
    make install
    ```

If you want [sanitizers](https://github.com/google/sanitizers) to be enabled, then add either the `-DSANITIZE_THREAD=ON -DSANITIZE_UNDEFINED=ON` or `-DSANITIZE_ADDRESS=ON` flags to cmake, running the tests will now also check with the sanitizers.

You can enable code coverage instrumentation in the builds of the library and its unit tests by adding the `-DBUILD_COVERAGE=ON` flag to cmake. See [scripts/run_coverage.sh](scripts/run_coverage.sh).

### Build (Windows)

**NOTE**: This is currently Early Access, and issues should be reported only via GitHub Issues. Installation steps are likely to change based on user feedback and becoming available via Vcpkg.

### Dependencies

Building this project requires the following tools installed:

- Visual Studio 2019 with "Desktop development for C++" installed
- Vcpkg
- Git

### Build Steps

The commands below should be executed in an `x64 Native Tools Command Prompt` shell.

- Clone the repository
    ```sh
    cd %HOMEPATH%
    git clone https://github.com/DataDog/dd-opentracing-cpp
    ```
- Generate build files using `cmake`
    ```bat
    cd dd-opentracing-cpp
    mkdir .build
    cd .build
    cmake -DCMAKE_TOOLCHAIN_FILE=%HOMEPATH%\vcpkg\scripts\buildsystems\vcpkg.cmake ..
    ```
- Run the build
    ```bat
    cmake --build . -- -p:Configuration=RelWithDebInfo
    ```

Take care to update the `Configuration` value (e.g. to `Debug`) if you change
the build mode in your IDE.  See this [related issue][1].

### Integration tests

Integration tests require additional tools installed:

- [msgpack-cli](https://github.com/jakm/msgpack-cli)
- [wiremock](https://github.com/tomakehurst/wiremock)
- `jq`

Installation details can be extracted from the [Dockerfile](https://github.com/DataDog/docker-library/blob/master/dd-opentracing-cpp/test/0.3.1/Dockerfile#L7-L14) for the container that is usually used when running integration tests.

Run this command to run the integration tests directly.

```sh
test/integration/run_integration_tests_local.sh
```

[1]: https://github.com/DataDog/dd-opentracing-cpp/issues/170
[2]: doc/configuration.md