The opentelemetry-cpp uses threads internally, for various components.
For example:
the batch processor uses a thread to process records from the span buffer.
the periodic metric reader uses a thread to trigger periodic collection, and a child thread to collect observable metrics.
the log processor uses a thread to process records from a log buffer.
every exporter based on CURL uses a thread internally, to process HTTP requests and responses.
Problem
An application that links with the opentelemetry-cpp library may have additional constraints, and may want to control at a very low level how the code executes within a thread.
For example:
the application may want to name threads, to be visible in the operating system under an application controlled name.
the application may need to initialize thread local storage, in particular when custom code is executed within a thread spawned by opentelemetry. Typically, callbacks for observable metrics may need TLS keys in place to execute properly.
the application may need to control thread priorities, or bind internal opentelemetry threads to some CPUs.
the application may need to control the current network namespace, when a thread opens a network connection.
Currently, there is no way to implement any of this from an application that uses opentelemetry-cpp.
Context
The opentelemetry-cpp uses threads internally, for various components.
For example:
Problem
An application that links with the opentelemetry-cpp library may have additional constraints, and may want to control at a very low level how the code executes within a thread.
For example:
Currently, there is no way to implement any of this from an application that uses opentelemetry-cpp.