2019-06-27 15:11:55 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PrometheusMetricEnums
|
|
|
|
def self.groups
|
|
|
|
{
|
|
|
|
# built-in groups
|
|
|
|
nginx_ingress_vts: -1,
|
|
|
|
ha_proxy: -2,
|
|
|
|
aws_elb: -3,
|
|
|
|
nginx: -4,
|
|
|
|
kubernetes: -5,
|
2019-08-07 12:17:35 -04:00
|
|
|
nginx_ingress: -6
|
|
|
|
}.merge(custom_groups).freeze
|
|
|
|
end
|
2019-06-27 15:11:55 -04:00
|
|
|
|
2019-08-07 12:17:35 -04:00
|
|
|
# custom/user groups
|
|
|
|
def self.custom_groups
|
|
|
|
{
|
2019-06-27 15:11:55 -04:00
|
|
|
business: 0,
|
|
|
|
response: 1,
|
|
|
|
system: 2
|
2019-08-07 12:17:35 -04:00
|
|
|
}.freeze
|
2019-06-27 15:11:55 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.group_details
|
|
|
|
{
|
|
|
|
# built-in groups
|
|
|
|
nginx_ingress_vts: {
|
|
|
|
group_title: _('Response metrics (NGINX Ingress VTS)'),
|
|
|
|
required_metrics: %w(nginx_upstream_responses_total nginx_upstream_response_msecs_avg),
|
|
|
|
priority: 10
|
|
|
|
}.freeze,
|
|
|
|
nginx_ingress: {
|
|
|
|
group_title: _('Response metrics (NGINX Ingress)'),
|
|
|
|
required_metrics: %w(nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum),
|
|
|
|
priority: 10
|
|
|
|
}.freeze,
|
|
|
|
ha_proxy: {
|
|
|
|
group_title: _('Response metrics (HA Proxy)'),
|
|
|
|
required_metrics: %w(haproxy_frontend_http_requests_total haproxy_frontend_http_responses_total),
|
|
|
|
priority: 10
|
|
|
|
}.freeze,
|
|
|
|
aws_elb: {
|
|
|
|
group_title: _('Response metrics (AWS ELB)'),
|
|
|
|
required_metrics: %w(aws_elb_request_count_sum aws_elb_latency_average aws_elb_httpcode_backend_5_xx_sum),
|
|
|
|
priority: 10
|
|
|
|
}.freeze,
|
|
|
|
nginx: {
|
|
|
|
group_title: _('Response metrics (NGINX)'),
|
|
|
|
required_metrics: %w(nginx_server_requests nginx_server_requestMsec),
|
|
|
|
priority: 10
|
|
|
|
}.freeze,
|
|
|
|
kubernetes: {
|
|
|
|
group_title: _('System metrics (Kubernetes)'),
|
|
|
|
required_metrics: %w(container_memory_usage_bytes container_cpu_usage_seconds_total),
|
|
|
|
priority: 5
|
2019-08-07 12:17:35 -04:00
|
|
|
}.freeze
|
|
|
|
}.merge(custom_group_details).freeze
|
|
|
|
end
|
2019-06-27 15:11:55 -04:00
|
|
|
|
2019-08-07 12:17:35 -04:00
|
|
|
# custom/user groups
|
|
|
|
def self.custom_group_details
|
|
|
|
{
|
2019-06-27 15:11:55 -04:00
|
|
|
business: {
|
|
|
|
group_title: _('Business metrics (Custom)'),
|
|
|
|
priority: 0
|
|
|
|
}.freeze,
|
|
|
|
response: {
|
|
|
|
group_title: _('Response metrics (Custom)'),
|
2019-08-07 12:17:35 -04:00
|
|
|
priority: -5
|
2019-06-27 15:11:55 -04:00
|
|
|
}.freeze,
|
|
|
|
system: {
|
|
|
|
group_title: _('System metrics (Custom)'),
|
|
|
|
priority: -10
|
|
|
|
}.freeze
|
|
|
|
}.freeze
|
|
|
|
end
|
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
|
|
|
PrometheusMetricEnums.prepend_if_ee('EE::PrometheusMetricEnums')
|