Skip to content
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

Add HTTP/TCP connections and Swap/Recovery metrics #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdrienChevrot1A
Copy link

Added the following metrics:

  • elasticsearch_indices_recovery_current_as_source
  • elasticsearch_indices_recovery_current_as_target
  • elasticsearch_indices_recovery_throttle_time_seconds_total
  • elasticsearch_os_swap_in_bytes_used
  • elasticsearch_os_swap_in_bytes_free
  • elasticsearch_os_swap_in_bytes_total
  • elasticsearch_transport_tcp_connections_opened_total
  • elasticsearch_http_connections_opened_current
  • elasticsearch_http_connections_opened_total

Comment on lines +290 to +325
{
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,
},

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 to mem_* metrics.

@@ -1510,6 +1558,30 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no
},
Labels: defaultNodeLabelValues,
},
{
Type: prometheus.CounterValue,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of current open connections should be a gauge.

Comment on lines +1563 to +1584
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,
},

Choose a reason for hiding this comment

The 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.

anti-social added a commit to anti-social/json-exporter that referenced this pull request Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants