doc(falco_metrics): add basic documentation

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
Samuel Gaist 2024-04-10 14:27:36 +02:00 committed by poiana
parent de7a70ea54
commit 9cc44c0eb7

View File

@ -21,6 +21,15 @@ limitations under the License.
#include <libsinsp/sinsp.h> #include <libsinsp/sinsp.h>
/*!
\class falco_metrics
\brief This class is used to convert the metrics provided by the application
and falco libs into a string to be return by the metrics endpoint.
*/
/*!
\brief Constructor that takes a \c state object to build its internal state
*/
falco_metrics::falco_metrics(falco::app::state& state) falco_metrics::falco_metrics(falco::app::state& state)
{ {
falco_configuration::webserver_config webserver_config = state.config->m_webserver_config; falco_configuration::webserver_config webserver_config = state.config->m_webserver_config;
@ -37,6 +46,11 @@ falco_metrics::falco_metrics(falco::app::state& state)
} }
} }
/*!
\brief This method returns a textual representation of the metrics configured.
The current implementation returns a Prometheus exposition formatted string.
*/
std::string falco_metrics::to_text() const std::string falco_metrics::to_text() const
{ {
if (!m_metrics_enabled) if (!m_metrics_enabled)