Commit 7eb5a2e
authored
feat: Add tracing hook. (#496)
Adds support for an OTEL tracing hook.
Unlike other packages we will not be providing a build of this package.
A customer wanting to use this package will need to build the SDK
themselves in the correct configuration. This allows for the hook to use
the version of OpenTelemetry that they are using with their application.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces a new server-side OpenTelemetry integration
(`libs/server-sdk-otel`) with a tracing hook, example app, build flags,
CI workflow, and release config.
>
> - **Server OTEL Integration**:
> - New package `libs/server-sdk-otel` implementing `TracingHook` with
options (`TracingHookOptions`, builder), headers, implementation, unit
tests, `CMakeLists.txt`, `CHANGELOG.md`, and `README.md`.
> - Exposes target alias `launchdarkly::server_otel`.
> - **Example**:
> - Adds `examples/hello-cpp-server-otel` (CMake, README, main)
demonstrating OTLP HTTP tracing and hook usage.
> - **Build/Config**:
> - Top-level: new options `LD_BUILD_OTEL_SUPPORT`,
`LD_BUILD_OTEL_FETCH_DEPS`, `LD_OTEL_CPP_VERSION`; conditionally
`add_subdirectory(libs/server-sdk-otel)` and example; docs updated in
`README.md`.
> - `libs/server-sdk-otel/CMakeLists.txt`: optional FetchContent of
OpenTelemetry (when `LD_BUILD_OTEL_FETCH_DEPS=ON`), link to
`opentelemetry-cpp::api`.
> - `scripts/build.sh`: auto-enables OTEL flags for
`launchdarkly-cpp-server-otel` and test targets.
> - `cmake/json.cmake`: rename FetchContent target to `nlohmann_json`.
> - **CI/Release**:
> - New workflow `.github/workflows/server-otel.yml`
(Ubuntu/macOS/Windows) building `launchdarkly-cpp-server-otel` with CURL
dev libs.
> - Composite action `.github/actions/ci`: adds `install_curl` input and
broadens CURL install condition; passes `CMAKE_PREFIX_PATH`.
> - `release-please` config/manifests updated to include
`libs/server-sdk-otel` (initial version `0.1.0`).
> - Manual docs workflow: adds `libs/server-sdk-otel` option.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0771956. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c9a6b17 commit 7eb5a2e
23 files changed
Lines changed: 1706 additions & 5 deletions
File tree
- .github
- actions/ci
- workflows
- cmake
- examples
- hello-cpp-server-otel
- libs/server-sdk-otel
- include/launchdarkly/server_side/integrations/otel
- src
- tests
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | | - | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| 147 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments