Eunomia
0.1.0
A lightweight eBPF-based CloudNative Monitor tool for Container Security and Observability
|
Go to the documentation of this file.
17 #include "spdlog/spdlog.h"
37 spdlog::debug(
"tracker_base::~tracker_base()");
45 if (thread.joinable())
58 template<
typename ENV,
typename EVENT>
114 template<
typename TRACKER>
118 typename TRACKER::event;
120 typename TRACKER::config_data;
122 typename TRACKER::tracker_event_handler;
124 typename TRACKER::prometheus_event_handler;
126 typename TRACKER::json_event_printer;
128 typename TRACKER::plain_text_event_printer;
130 typename TRACKER::csv_event_printer;
139 template<tracker_concept TRACKER,
typename EVENT>
140 static int handle_tracker_event(
void *ctx,
void *data,
size_t data_sz)
144 std::cout <<
"warn: no data or no ctx" << std::endl;
147 const EVENT &e = *(
const EVENT *)data;
148 TRACKER &pt = *(TRACKER *)ctx;
150 if (pt.current_config.handler)
152 pt.current_config.handler->do_handle_event(event);
156 std::cout <<
"warn: no handler for tracker event" << std::endl;
virtual void start_tracker(void)=0
start the tracker thread
virtual ~tracker_base()
constructor
Definition: tracker.h:34
print to plain text
Definition: tracker.h:80
the event handler for single type
Definition: event_handler.h:52
void handle(tracker_event< EVENT > &e)
implement this function to handle the event
Definition: tracker.h:82
print to csv
Definition: tracker.h:94
tracker template with env and data
Definition: tracker.h:59
prometheus_event_handler(prometheus_server &server)
Definition: tracker.h:72
void handle(tracker_event< EVENT > &e)
implement this function to handle the event
Definition: tracker.h:89
void handle(tracker_event< EVENT > &e)
implement this function to handle the event
Definition: tracker.h:96
volatile bool exiting
is the tracker exiting
Definition: tracker.h:32
tracker manager for owning and managing tracker instances
Definition: tracker_manager.h:21
concept tracker_concept
concept for a single thread tracker
Definition: tracker.h:115
default event handlers for prometheus
Definition: tracker.h:70
tracker_with_config(tracker_config< ENV, EVENT > config)
Definition: tracker.h:102
the basic event type
Definition: event_handler.h:31
the base type of a tracker
Definition: tracker.h:22
void stop_tracker(void)
stop the tracker thread
Definition: tracker.h:42
used for json exporter, inherits from json_event_handler
Definition: tracker.h:87
virtual ~tracker_with_config()
Definition: tracker.h:106
Definition: prometheus_server.h:22
std::shared_ptr< event_handler< ipc_event > > tracker_event_handler
type alias for event handler
Definition: tracker.h:67
seccomp_config config
Definition: seccomp_test.cpp:13
tracker_config< ENV, EVENT > current_config
config data
Definition: tracker.h:101
void handle(tracker_event< EVENT > &e)
implement this function to handle the event
Definition: tracker.h:75