-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(core): move logger, metrics and tracing samples to telemetry
- Loading branch information
Showing
8 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
core/samples/logging/page.md → core/samples/tel/logging/page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Logging {#examples-core-logging} | ||
# Logging {#examples-core-tel-logging} | ||
|
||
@brief Using the logging system. | ||
|
||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
core/samples/metrics/page.md → core/samples/tel/metrics/page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Metrics {#examples-core-metrics} | ||
# Metrics {#examples-core-tel-metrics} | ||
|
||
@brief Using the metrics system. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Telemetry {#examples-core-tel} | ||
|
||
@brief Using the @ref core-tel module. | ||
|
||
- @subpage examples-core-tel-logging - @copybrief examples-core-tel-logging | ||
- @subpage examples-core-tel-metrics - @copybrief examples-core-tel-metrics | ||
- @subpage examples-core-tel-tracing - @copybrief examples-core-tel-tracing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/// [Logging and tracing include] | ||
#include <cubos/core/tel/logging.hpp> | ||
#include <cubos/core/tel/tracing.hpp> | ||
|
||
using cubos::core::tel::SpanManager; | ||
/// [Logging and tracing include] | ||
|
||
int main() | ||
{ | ||
cubos::core::tel::Logger::level(cubos::core::tel::Logger::Level::Trace); | ||
|
||
/// [Using macros] | ||
CUBOS_SPAN_INFO("main_span"); | ||
// With this macro, a new RAII guard is created. When dropped, exits the span. | ||
// This indicates that we are in the span for the current lexical scope. | ||
// Logs and metrics from here will be associated with 'main' span. | ||
CUBOS_INFO("hello!"); | ||
|
||
CUBOS_SPAN_TRACE("other_scope"); | ||
CUBOS_INFO("hello again!"); | ||
// ... | ||
/// [Using macros] | ||
|
||
/// [Manually] | ||
SpanManager::Span span("manual_span", CUBOS_SPAN_LEVEL_DEBUG, __FILE__, __LINE__); | ||
SpanManager::enter(&span); | ||
CUBOS_INFO("entered a manual span"); | ||
|
||
SpanManager::exit(); | ||
CUBOS_INFO("after exit manual span"); | ||
/// [Manually] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters