|
Viam C++ SDK current
|
RAII child span. Parent is whichever span is active on the current thread, which inside a resource API method body is the SDK-managed gRPC handler span. More...
#include <span.hpp>
Public Member Functions | |
| TracingSpan (const char *name) noexcept | |
Open a child span named name under the currently-active span. | |
| TracingSpan (TracingSpan &&)=delete | |
| TracingSpan & | operator= (TracingSpan &&)=delete |
| template<typename T > | |
| void | set_attribute (const char *key, T value) noexcept |
Attach an attribute to the span. Supported value types: bool, std::int64_t, double, const char*, std::string. Other types fail to link. | |
| void | add_event (const char *name) noexcept |
| Record a timestamped event on the span. | |
| void | set_status_ok () noexcept |
| Mark the span as having completed successfully. | |
| void | set_status_error (const char *description="") noexcept |
Mark the span as having failed. description is optional context. | |
| void | record_exception (const std::exception &xcp) noexcept |
Record xcp as an "exception" event and set span status to Error. | |
| void | record_unknown_exception () noexcept |
| Record an unknown (non-stdexception) failure as an "exception" event and set span status to Error. | |
| void | end () noexcept |
| Mark the end of the span. | |
RAII child span. Parent is whichever span is active on the current thread, which inside a resource API method body is the SDK-managed gRPC handler span.
No-op when OpenTelemetry support is not compiled in, no tracer provider is installed, or no parent span is active on the current thread. Must be constructed and destroyed on the same thread, in LIFO order.
|
noexcept |
Record xcp as an "exception" event and set span status to Error.
|
noexcept |
Record an unknown (non-stdexception) failure as an "exception" event and set span status to Error.
|
noexcept |
Mark the span as having completed successfully.