-
Notifications
You must be signed in to change notification settings - Fork 799
Add HTTP/TCP connections and Swap/Recovery metrics #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ func getRoles(node NodeStatsNodeResponse) map[string]bool { | |
} | ||
} | ||
} | ||
if len(node.HTTP) == 0 { | ||
if node.HTTP == nil { | ||
roles["client"] = false | ||
} | ||
return roles | ||
|
@@ -287,6 +287,42 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no | |
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.GaugeValue, | ||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "os", "swap_in_bytes_used"), | ||
"Amount of used swap space in bytes", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.OS.Swap.Used) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.GaugeValue, | ||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "os", "swap_in_bytes_free"), | ||
"Amount of free swap space in bytes", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.OS.Swap.Free) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.GaugeValue, | ||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "os", "swap_in_bytes_total"), | ||
"Total amount of swap space in bytes", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.OS.Swap.Total) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.GaugeValue, | ||
Desc: prometheus.NewDesc( | ||
|
@@ -1462,6 +1498,18 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no | |
return append(defaultNodeLabelValues(cluster, node), "user") | ||
}, | ||
}, | ||
{ | ||
Type: prometheus.CounterValue, | ||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "transport", "tcp_connections_opened_total"), | ||
"Number of connections opened for cluster communication", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.Transport.ServerOpen) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.CounterValue, | ||
Desc: prometheus.NewDesc( | ||
|
@@ -1510,6 +1558,30 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no | |
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.CounterValue, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Number of current open connections should be a gauge. |
||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "http", "connections_opened_current"), | ||
"Current number of opened connections", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.HTTP.CurrentOpen) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
{ | ||
Type: prometheus.CounterValue, | ||
Desc: prometheus.NewDesc( | ||
prometheus.BuildFQName(namespace, "http", "connections_opened_total"), | ||
"Total number of opened connections", | ||
defaultNodeLabels, nil, | ||
), | ||
Value: func(node NodeStatsNodeResponse) float64 { | ||
return float64(node.HTTP.TotalOpen) | ||
}, | ||
Labels: defaultNodeLabelValues, | ||
}, | ||
Comment on lines
+1563
to
+1584
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you think it's worth to rename Elasticsearch's metrics? This makes harder matching exporter's metric to the origin. |
||
}, | ||
gcCollectionMetrics: []*gcCollectionMetric{ | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think these metrics should be named
swap_used_bytes
,swap_free_bytes
&swap_total_bytes
simalarly tomem_*
metrics.