Overview
API Introduction
The Trace module provides C++ APIs for Trace data monitoring.
For details about the functions and usage examples of the Trace APIs, see msServiceProfiler Trace Data Monitoring.
Header file: ${INSTALL_DIR}/include/msServiceProfiler/Tracer.h
Library file: ${INSTALL_DIR}/lib64/libms_service_profiler.so
Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.
APIs
The APIs are as follows.
API |
Description |
|---|---|
Manages thread-level Trace information as the Trace context management class. |
|
Obtains the Trace context instance of the current thread. |
|
Adds global resource attributes. |
|
Parses HTTP Trace information and adds it to the current context. |
|
Adds Trace information to the current context. |
|
Cancels the Trace context of a specified index. |
|
Obtains the current Trace context. |
|
Represents a specific operation or request. |
|
Creates a Span. |
|
Activates a Span and starts timing. |
|
Sets the Span attributes. |
|
Sets the Span status. |
|
Ends a Span. |
|
Provides APIs for creating Spans. |
|
Creates and activates a Span. |
|
Checks whether the Trace function is enabled. |