Language: English | νκ΅μ΄
Modern C++20 observability platform with comprehensive monitoring, distributed tracing, and reliability capabilities for high-performance applications. Built with a modular, interface-based architecture for seamless ecosystem integration.
Key Value Proposition:
- Performance Excellence: 10M+ metric operations/sec, <50ns context propagation
- Reliable Design: Thread-safe design, comprehensive error handling, circuit breakers
- Developer Productivity: Intuitive API, rich telemetry, modular components
- Enterprise-Ready: Distributed tracing, health monitoring, reliability patterns
Latest Status: β All CI/CD pipelines green, 37/37 tests passing (100% pass rate)
| Dependency | Version | Required | Description |
|---|---|---|---|
| C++20 Compiler | GCC 11+ / Clang 14+ / MSVC 2022+ / Apple Clang 14+ | Yes | C++20 features required |
| CMake | 3.20+ | Yes | Build system |
| common_system | latest | Yes | Common interfaces (IMonitor, Result) |
| thread_system | latest | Yes | Thread pool and async operations |
| logger_system | latest | Optional | Logging capabilities |
monitoring_system
βββ common_system (required)
βββ thread_system (required)
β βββ common_system
βββ logger_system (optional)
βββ common_system
# Clone all dependencies
git clone https://github.com/kcenon/common_system.git
git clone https://github.com/kcenon/thread_system.git
git clone https://github.com/kcenon/logger_system.git
git clone https://github.com/kcenon/monitoring_system.git
# Build monitoring_system
cd monitoring_system
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildπ Quick Start Guide β | λΉ λ₯Έ μμ κ°μ΄λ β
Part of a modular C++ ecosystem with clean interface boundaries:
Dependencies:
- common_system: Core interfaces (IMonitor, ILogger, Result)
- thread_system: Threading primitives (required)
- logger_system: Logging capabilities (optional)
Integration Pattern:
common_system (interfaces) β monitoring_system implements IMonitor
β optional: inject ILogger at runtime
Benefits: Interface-only dependencies, independent compilation, runtime DI, clean separation
π Complete Ecosystem Integration Guide β
# Clone the repository
git clone https://github.com/kcenon/monitoring_system.git
cd monitoring_system
# Configure and build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
# Run tests
./build/tests/monitoring_system_tests
# Run examples
./build/examples/basic_monitoring_example#include <kcenon/monitoring/core/performance_monitor.h>
#include <kcenon/monitoring/tracing/distributed_tracer.h>
#include <kcenon/monitoring/health/health_monitor.h>
using namespace monitoring_system;
int main() {
// 1. Create monitoring components
performance_monitor monitor("my_service");
auto& tracer = global_tracer();
health_monitor health;
// 2. Enable metrics collection
monitor.enable_collection(true);
// 3. Start distributed trace
auto span_result = tracer.start_span("main_operation", "service");
if (!span_result) {
std::cerr << "Failed to start trace: " << span_result.error().message << "\n";
return -1;
}
auto span = span_result.value();
span->set_tag("operation.type", "batch_processing");
// 4. Monitor operations
auto timer = monitor.start_timer("processing");
for (int i = 0; i < 1000; ++i) {
monitor.increment_counter("items_processed");
// ... your processing logic ...
}
// 5. Collect metrics
auto snapshot = monitor.collect();
if (snapshot) {
std::cout << "CPU: " << snapshot.value().get_metric("cpu_usage") << "%\n";
std::cout << "Processed: " << snapshot.value().get_metric("items_processed") << "\n";
}
// 6. Finish trace
tracer.finish_span(span);
tracer.export_traces();
return 0;
}- Performance Monitoring: Real-time metrics (counters, gauges, histograms) - 10M+ ops/sec
- Distributed Tracing: Request flow tracking across services - 2.5M spans/sec
- Health Monitoring: Service health checks and dependency validation - 500K checks/sec
- Error Handling: Robust Result pattern for type-safe error management
- Dependency Injection: Complete DI container with lifecycle management
- Circuit Breakers: Automatic failure detection and recovery
- Storage Backends: Memory, file, and time-series storage options
- Thread-Safe: Concurrent operations with atomic counters and locks
Benchmarked on Apple M1 (8-core) @ 3.2GHz, 16GB RAM, macOS Sonoma
| Operation | Throughput | Latency (P95) | Memory |
|---|---|---|---|
| Counter Operations | 10.5M ops/sec | 120 ns | <1MB |
| Span Creation | 2.5M spans/sec | 580 ns | 384 bytes/span |
| Health Checks | 520K checks/sec | 2.85 ΞΌs | <3MB |
| Context Propagation | 15M ops/sec | <50 ns | Thread-local |
Platform: Apple M1 @ 3.2GHz
| Solution | Counter Ops/sec | Memory | Features |
|---|---|---|---|
| Monitoring System | 10.5M | <5MB | Full observability |
| Prometheus Client | 2.5M | 15MB | Metrics only |
| OpenTelemetry | 1.8M | 25MB | Complex API |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Monitoring System β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Core Components β
βββββββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββββββ€
β Performance Monitor β Distributed Tracer β Health Monitor β
β β’ Metrics Collectionβ β’ Span Management β β’ Service Checks β
β β’ Profiling Data β β’ Context Propagationβ β’ Dependency Trackingβ
β β’ Aggregation β β’ Trace Export β β’ Recovery Policies β
βββββββββββββββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββββββββββββ
Key Characteristics:
- Interface-Driven Design: Clean separation via abstract interfaces
- Modular Components: Pluggable storage, tracers, and health checkers
- Zero Circular Dependencies: Interface-only dependencies via common_system
- Production Grade: 100% test pass rate, <10% overhead
ποΈ Architecture Guide β
- π User Guide - Comprehensive usage guide
- π Quick Start Examples - Working code examples
- π§ Integration Guide - Ecosystem integration
- π API Reference - Complete API documentation
- π Features - Detailed feature descriptions
- β‘ Benchmarks - Performance metrics and comparisons
- ποΈ Architecture - System design and patterns
- π¦ Project Structure - File organization
- β Best Practices - Usage recommendations
- π Troubleshooting - Common issues and solutions
- π FAQ - Frequently asked questions
- π Migration Guide - Version migration
- π€ Contributing - Contribution guidelines
- π Production Quality - CI/CD and quality metrics
- π Performance Baselines - Regression thresholds
# Add monitoring system
add_subdirectory(monitoring_system)
target_link_libraries(your_target PRIVATE monitoring_system)
# Optional: Add ecosystem integration
add_subdirectory(thread_system)
add_subdirectory(logger_system)
target_link_libraries(your_target PRIVATE
monitoring_system
thread_system::interfaces
logger_system
)include(FetchContent)
FetchContent_Declare(
monitoring_system
GIT_REPOSITORY https://github.com/kcenon/monitoring_system.git
GIT_TAG main
)
FetchContent_MakeAvailable(monitoring_system)
target_link_libraries(your_target PRIVATE monitoring_system)# Build with tests and examples
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_BENCHMARKS=OFF
# Enable ecosystem integration
cmake -B build \
-DBUILD_WITH_COMMON_SYSTEM=ON \
-DTHREAD_SYSTEM_INTEGRATION=ON \
-DLOGGER_SYSTEM_INTEGRATION=ON// Configure monitoring
monitoring_config config;
config.enable_performance_monitoring = true;
config.enable_distributed_tracing = true;
config.sampling_rate = 0.1; // 10% sampling
config.max_trace_duration = std::chrono::seconds(30);
// Configure storage
auto storage = std::make_unique<memory_storage>(memory_storage_config{
.max_entries = 10000,
.retention_period = std::chrono::hours(1)
});
// Create monitor with config
auto monitor = create_monitor(config, std::move(storage));# Run all tests
cmake --build build --target monitoring_system_tests
./build/tests/monitoring_system_tests
# Run specific test suites
./build/tests/monitoring_system_tests --gtest_filter="*DI*"
./build/tests/monitoring_system_tests --gtest_filter="*Performance*"
# Generate coverage report
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
cmake --build build
./build/tests/monitoring_system_tests
make coverageTest Status: β 37/37 tests passing (100% pass rate)
Test Coverage:
- Line Coverage: 87.3%
- Function Coverage: 92.1%
- Branch Coverage: 78.5%
| Aspect | Grade | Status |
|---|---|---|
| Thread Safety | A- | β TSan clean, 0 data races |
| Resource Management | A | β ASan clean, 0 leaks |
| Error Handling | A- | β Result pattern, 95% complete |
| Test Coverage | A | β 37/37 tests, 100% pass rate |
| CI/CD | A | β Multi-platform, all green |
Platforms Tested:
- Linux (Ubuntu 22.04): GCC 11+, Clang 14+
- macOS (macOS 12+): Apple Clang 14+
- Windows (Server 2022): MSVC 2022+
Sanitizers:
- β AddressSanitizer: 0 leaks, 0 errors
- β ThreadSanitizer: 0 data races
- β UndefinedBehaviorSanitizer: 0 issues
Static Analysis:
- β clang-tidy: 0 warnings
- β cppcheck: 0 warnings
- β cpplint: 0 issues
π Production Quality Metrics β
Ideal Applications:
- Microservices: Distributed tracing and service health monitoring
- High-Frequency Trading: Ultra-low latency performance monitoring
- Real-Time Systems: Continuous health checks and circuit breaker protection
- Web Applications: Request tracing and bottleneck identification
- IoT Platforms: Resource usage monitoring and reliability patterns
This monitoring system integrates seamlessly with other KCENON systems:
// With thread_system integration
#include <thread_system/thread_pool.h>
auto collector = create_threaded_collector(thread_pool);
// With logger_system integration
#include <logger_system/logger.h>
monitoring_system::set_logger(logger_system::get_logger());π Ecosystem Integration Guide β
- π¬ GitHub Discussions - Ask questions
- π Issue Tracker - Report bugs
- π§ Email: kcenon@naver.com
We welcome contributions! See our Contributing Guide for details.
Quick Start:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
- Inspired by modern observability platforms and best practices
- Built with C++20 features (GCC 11+, Clang 14+, MSVC 2022+) for maximum performance and safety
- Maintained by kcenon@naver.com
Made with β€οΈ by πβππ₯ π