Skip to content

Commit efb14c9

Browse files
committed
0.1.1: Add a handful of new counters for indexing and merging
* Added `indices_indexing_index_total` * Added `indices_indexing_index_time_in_millis` * Added `indices_merges_total` * Added `indices_merges_total_docs` * Added `indices_merges_total_size_in_bytes` * Added `indices_merges_total_time_in_millis`
1 parent 47cc3b9 commit efb14c9

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
VERSION := 0.1.0
14+
VERSION := 0.1.1
1515
TARGET := elasticsearch_exporter
1616

1717
include Makefile.COMMON

elasticsearch_exporter.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ type NodeStatsIndicesResponse struct {
114114
Docs NodeStatsIndicesDocsResponse
115115
Store NodeStatsIndicesStoreResponse
116116
Indexing NodeStatsIndicesIndexingResponse
117+
Merges NodeStatsIndicesMergesResponse
117118
Get NodeStatsIndicesGetResponse
118119
Search NodeStatsIndicesSearchResponse
119120
FieldData NodeStatsIndicesFieldDataResponse
@@ -146,6 +147,16 @@ type NodeStatsIndicesIndexingResponse struct {
146147
DeleteCurrent int64 `json:"delete_current"`
147148
}
148149

150+
type NodeStatsIndicesMergesResponse struct {
151+
Current int64 `json:"current"`
152+
CurrentDocs int64 `json:"current_docs"`
153+
CurrentSize int64 `json:"current_size_in_bytes"`
154+
Total int64 `json:"total"`
155+
TotalDocs int64 `json:"total_docs"`
156+
TotalSize int64 `json:"total_size_in_bytes"`
157+
TotalTime int64 `json:"total_time_in_millis"`
158+
}
159+
149160
type NodeStatsIndicesGetResponse struct {
150161
Total int64 `json:"total"`
151162
Time int64 `json:"time_in_millis"`
@@ -278,6 +289,12 @@ var (
278289
"transport_tx_count": "Count of packets sent",
279290
"transport_tx_size_in_bytes": "Bytes sent",
280291
"indices_store_throttle_time_in_millis": "Throttle time for index store",
292+
"indices_indexing_index_total": "Total index calls",
293+
"indices_indexing_index_time_in_millis": "Cumulative index time",
294+
"indices_merges_total": "Total merges",
295+
"indices_merges_total_docs": "Cumulative docs merged",
296+
"indices_merges_total_size_in_bytes": "Total merge size in bytes",
297+
"indices_merges_total_time_in_millis": "Total time spent merging",
281298
}
282299
counterVecMetrics = map[string]*VecInfo{
283300
"jvm_gc_collection_count": &VecInfo{
@@ -481,6 +498,13 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
481498
e.counters["indices_flush_total"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Flush.Total))
482499
e.counters["indices_flush_time_in_millis"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Flush.Time))
483500

501+
e.counters["indices_indexing_index_time_in_millis"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Indexing.IndexTime))
502+
e.counters["indices_indexing_index_total"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Indexing.IndexTotal))
503+
504+
e.counters["indices_merges_total_time_in_millis"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Merges.TotalTime))
505+
e.counters["indices_merges_total_size_in_bytes"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Merges.TotalSize))
506+
e.counters["indices_merges_total"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Indices.Merges.Total))
507+
484508
// Transport Stats
485509
e.counters["transport_rx_count"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Transport.RxCount))
486510
e.counters["transport_rx_size_in_bytes"].WithLabelValues(all_stats.ClusterName, stats.Name).Set(float64(stats.Transport.RxSize))
@@ -520,7 +544,7 @@ func main() {
520544
w.Write([]byte(`<html>
521545
<head><title>Elasticsearch Exporter</title></head>
522546
<body>
523-
<h1>Consul Exporter</h1>
547+
<h1>Elasticsearch Exporter</h1>
524548
<p><a href='` + *metricsPath + `'>Metrics</a></p>
525549
</body>
526550
</html>`))

0 commit comments

Comments
 (0)