blob: e6f3b8cc2fa017d535f53f504de4cf7925b49514 [file] [log] [blame]
#ifndef THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRICS_H_
#define THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRICS_H_
#include "absl/base/no_destructor.h"
#include "absl/strings/string_view.h"
#include "monitoring.h"
namespace milotic {
struct CommonMetrics {
metrics::Latency<absl::string_view, absl::string_view>
passthrough_request_latency{
"redfish_passthrough/request_latency",
{"verb", "uri"},
{.description =
"Request latency to underlying service. This measures "
"performance of the underlying HTTP server and the "
"connection to that server."}};
metrics::EventCounter<absl::string_view> sse_event_counter{
"redfish_passthrough/sse_event_counter",
{"uri"},
{.description =
"SSE events count. Number of events on each SSE endpoint."}};
metrics::EventCounter<absl::string_view, int> passthrough_response_code{
"redfish_passthrough/response_code",
{"uri", "code"},
{.description = "Response code count of the underlying HTTP server."}};
metrics::State<> session_state{"redfish_session_auth/state",
{},
{.description = "Redfish session state"}};
milotic::metrics::EventCounter<absl::string_view> mapping_counter{
"authorization/mapping",
{"name"},
{.description = "Mapping match count per mapping"}};
milotic::metrics::EventCounter<absl::string_view, bool> rule_counter{
"authorization/rule",
{"name", "granted"},
{.description = "Number of authorization checks by rule"}};
milotic::metrics::EventCounter<> query_parameters_removed{
"query_parameters_removed",
{},
{.description =
"Number of requests from which query parameters were removed"}};
milotic::metrics::State<> events_manager_state{
"events_manager/state", {}, {.description = "Events manager state"}};
milotic::metrics::State<> events_manager_health{
"events_manager/machine_health",
{},
{.description = "Machine health from Events Manager"}};
milotic::metrics::EventCounter<> events_manager_reset_timeout{
"events_manager/reset_timeout",
{},
{.description = "Events manager reset timeout"}};
static CommonMetrics& Get() {
static absl::NoDestructor<CommonMetrics> common_metrics;
return *common_metrics;
}
};
} // namespace milotic
#endif // THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRICS_H_