Skip to content

Commit 715b76d

Browse files
committed
cleanup
1 parent fb3d60b commit 715b76d

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

CHANGELOG.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ New features:
2626
* [SDK] Better control of threads executed by opentelemetry-cpp
2727
[#3175](https://github.com/open-telemetry/opentelemetry-cpp/pull/3175)
2828

29-
* This feature provides a way for applications, when configuring the SDK and exporters,
30-
to participate in the execution path of internal opentelemetry-cpp threads.
29+
* This feature provides a way for applications,
30+
when configuring the SDK and exporters,
31+
to participate in the execution path
32+
of internal opentelemetry-cpp threads.
3133

3234
* The opentelemetry-cpp library provides the following:
3335

@@ -36,15 +38,18 @@ New features:
3638
* BatchSpanProcessorRuntimeOptions
3739
* PeriodicExportingMetricReaderRuntimeOptions
3840
* BatchLogRecordProcessorRuntimeOptions
39-
* new runtime options structures, to optionally configure the OTLP HTTP exporters:
41+
* new runtime options structures,
42+
to optionally configure the OTLP HTTP exporters:
4043
* OtlpHttpExporterRuntimeOptions
4144
* OtlpHttpMetricExporterRuntimeOptions
4245
* OtlpHttpLogRecordExporterRuntimeOptions
43-
* new ThreadInstrumentation parameters, to optionally configure the CURL HttpClient
46+
* new ThreadInstrumentation parameters,
47+
to optionally configure the CURL HttpClient
4448

4549
* Using the optional runtime options structures,
4650
an application can subclass the ThreadInstrumentation interface,
47-
and be notified of specific events of interest during the execution of an internal opentelemetry-cpp thread.
51+
and be notified of specific events of interest during the execution
52+
of an internal opentelemetry-cpp thread.
4853

4954
* This allows an application to call, for example:
5055

@@ -55,7 +60,8 @@ New features:
5560

5661
* See the documentation for ThreadInstrumentation for details.
5762

58-
* A new example program, example_otlp_instrumented_http, shows how to use the feature,
63+
* A new example program, example_otlp_instrumented_http,
64+
shows how to use the feature,
5965
and add application logic in the thread execution code path.
6066

6167
## [1.18 2024-11-25]

examples/otlp/http_instrumented_main.cc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ namespace
5858

5959
std::mutex serialize;
6060

61+
/**
62+
The purpose of MyThreadInstrumentation is to demonstrate
63+
how notifications are delivered to the application.
64+
65+
Printing to std::cout is useful for debugging,
66+
to understand the overall thread execution in the library.
67+
68+
In production, a real application would instead:
69+
- set thread priorities / CPU affinity
70+
- set thread local storage keys
71+
- set a thread name to the operating system
72+
- set network namespaces
73+
in the OnXXX() code here.
74+
*/
6175
class MyThreadInstrumentation : public opentelemetry::sdk::common::ThreadInstrumentation
6276
{
6377
public:
@@ -272,8 +286,8 @@ void CleanupLogger()
272286

273287
/*
274288
Usage:
275-
- example_otlp_http
276-
- example_otlp_http <TRACE_URL> <METRIC_URL> <LOG_URL>
289+
- example_otlp_instrumented_http
290+
- example_otlp_instrumented_http <TRACE_URL> <METRIC_URL> <LOG_URL>
277291
*/
278292
int main(int argc, char *argv[])
279293
{

0 commit comments

Comments
 (0)