diff --git a/collector/indices.go b/collector/indices.go index a0c4d96e..40349dba 100644 --- a/collector/indices.go +++ b/collector/indices.go @@ -803,6 +803,30 @@ func NewIndices(logger log.Logger, client *http.Client, url *url.URL, shards boo }, Labels: indexLabels, }, + { + Type: prometheus.CounterValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "index_stats", "refresh_external_time_seconds_total"), + "Total external refresh time in seconds", + indexLabels.keys(), nil, + ), + Value: func(indexStats IndexStatsIndexResponse) float64 { + return float64(indexStats.Total.Refresh.ExternalTotalTimeInMillis) / 1000 + }, + Labels: indexLabels, + }, + { + Type: prometheus.CounterValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "index_stats", "refresh_external_total"), + "Total external refresh count", + indexLabels.keys(), nil, + ), + Value: func(indexStats IndexStatsIndexResponse) float64 { + return float64(indexStats.Total.Refresh.ExternalTotal) + }, + Labels: indexLabels, + }, { Type: prometheus.CounterValue, Desc: prometheus.NewDesc( diff --git a/collector/indices_response.go b/collector/indices_response.go index 6638d339..b048960c 100644 --- a/collector/indices_response.go +++ b/collector/indices_response.go @@ -145,9 +145,11 @@ type IndexStatsIndexMergesResponse struct { // IndexStatsIndexRefreshResponse defines index stats index refresh information structure type IndexStatsIndexRefreshResponse struct { - Total int64 `json:"total"` - TotalTimeInMillis int64 `json:"total_time_in_millis"` - Listeners int64 `json:"listeners"` + Total int64 `json:"total"` + TotalTimeInMillis int64 `json:"total_time_in_millis"` + ExternalTotal int64 `json:"external_total"` + ExternalTotalTimeInMillis int64 `json:"external_total_time_in_millis"` + Listeners int64 `json:"listeners"` } // IndexStatsIndexFlushResponse defines index stats index flush information structure diff --git a/collector/nodes.go b/collector/nodes.go index e99e8d5c..3bd3c236 100644 --- a/collector/nodes.go +++ b/collector/nodes.go @@ -630,6 +630,30 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no }, Labels: defaultNodeLabelValues, }, + { + Type: prometheus.CounterValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "indices_refresh", "external_total"), + "Total external refreshes", + defaultNodeLabels, nil, + ), + Value: func(node NodeStatsNodeResponse) float64 { + return float64(node.Indices.Refresh.ExternalTotal) + }, + Labels: defaultNodeLabelValues, + }, + { + Type: prometheus.CounterValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "indices_refresh", "external_time_seconds_total"), + "Total time spent external refreshing in seconds", + defaultNodeLabels, nil, + ), + Value: func(node NodeStatsNodeResponse) float64 { + return float64(node.Indices.Refresh.ExternalTotalTimeInMillis) / 1000 + }, + Labels: defaultNodeLabelValues, + }, { Type: prometheus.CounterValue, Desc: prometheus.NewDesc( diff --git a/collector/nodes_response.go b/collector/nodes_response.go index 5b756011..6ba2ad7b 100644 --- a/collector/nodes_response.go +++ b/collector/nodes_response.go @@ -172,8 +172,10 @@ type NodeStatsIndicesDocsResponse struct { // NodeStatsIndicesRefreshResponse defines node stats refresh information structure for indices type NodeStatsIndicesRefreshResponse struct { - Total int64 `json:"total"` - TotalTime int64 `json:"total_time_in_millis"` + Total int64 `json:"total"` + TotalTime int64 `json:"total_time_in_millis"` + ExternalTotal int64 `json:"external_total"` + ExternalTotalTimeInMillis int64 `json:"external_total_time_in_millis"` } // NodeStatsIndicesTranslogResponse defines node stats translog information structure for indices