Telemetry in Common Vision Blox (CVB) enables the collection, logging, and tracing of runtime information to support diagnostics, performance monitoring, and product improvement. CVB uses OpenTelemetry standards for its telemetry infrastructure, ensuring compatibility with modern monitoring tools.
Telemetry covers:
Telemetry in CVB has two main use cases:
The created log files can be viewed using the LogGUI, which is found under %CVB%Applications
(Windows) and /opt/cvb/bin
(Linux, available in PATH by default).
CVB telemetry can be configured using the TelemetryCLI tool, which is located under %CVB%Applications
(Windows) and /opt/cvb/bin
(Linux, available in PATH by default). Using this tool you can enable/disable logging and tracing for individual modules, and define how logs and traces should be collected using the Open Telemetry Collector (cvotelcol.exe). The cvotelcol.exe needs to be running for logs/traces to be collected. It is located in the same directory as the TelemetryCLI and can also be started using the TelemetryCLI.
Enabling logging or tracing in CVB modules introduces only a minimal performance overhead. When telemetry is turned off, the related code paths are effectively no-ops, with only an additional if-check performed in some cases. This ensures that disabled telemetry does not impact application performance.
Modules are DLLs or executables that can produce logs or traces. This includes CVB modules but also user modules.
List built-in modules e.g. GenICam.vin, CVFactory etc:
Print configuration in json format (loaded on startup):
Add MyApp
to the modules configuration:
Remove MyApp
from the modules configuration:
Logging options for MyApp
in the modules configuration:
Set the log level for MyApp
(case insensitive):
Tracing options for MyApp
in the modules configuration:
Global logging options in the modules configuration:
Global log level in the modules configuration (case insensitive):
Global tracing options in the modules configuration:
Components are Open Telemetry Collector components that can either be receivers or exporters. They may either be on or off. Some can have an additional configuration.
List all available components:
Print configuration in yaml format (loaded on startup if available):
Options for otlpjsonfile/logs
in the components configuration:
Options for otlpjsonfile/traces
in the components configuration:
Enable writing logs and traces to file:
Run cvotelcol.exe with the current modules and component configuration (run
is the default argument). This will start the collection of logs / traces using the configured components:
The cvotelcol.exe is used for the actual collection (and processing) of traces and logs that applications emit. It can be started, as mentioned in the configuration section, by calling TelemetryCLI run
. The cvotelcol.exe is able to export in otlpjson format, which is based on the OTLP Format and can be used together with other applications that support this format. An example for such an application would be Jaeger, which is used for analyzing and visualizing Open Telemetry traces.
For C++ you will need to include CVB++. For .NET you will need to reference CVB.NET (Stemmer.Cvb.dll and Stemmer.Cvb.Telemetry.dll).
Below are a few examples, for more information have a look at the Telemetry API documentation for CVB++ or CVB.NET.
First, a Telemetry module has to be defined in the application. After a module has been created, its configuration is immutable, as it is only read on module creation.
After you have created your module, you can use it to create logs or traces.
Logs have a LogLevel
, a Message
and an arbitrary amount of Attributes
. Attributes are a list of key-value-pairs, where the values can be long
, double
, string
or bool
values.
Traces allow you to record the execution flow of specific operations in your application. Each trace represents a span, which can include attributes, success/failure status, and return values.