Skip to content

Commit

Permalink
Create (X-Pack Monitoring) stats metricset for Kibana module (elastic…
Browse files Browse the repository at this point in the history
…#7525)

This PR takes the `stats` metricset of the `kibana` Metricbeat module and makes it ship documents to `.monitoring-kibana-6-mb-%{YYYY.MM.DD}` indices, while preserving the current format/mapping expected by docs in these indices. This will ensure that current consumers of the data in these indices, viz. the X-Pack Monitoring UI and the Telemetry shipping module in Kibana, will continue to work as-is.
  • Loading branch information
ycombinator authored and ruflin committed Jul 19, 2018
1 parent 182bddd commit e5791d2
Show file tree
Hide file tree
Showing 22 changed files with 753 additions and 344 deletions.
157 changes: 57 additions & 100 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6681,259 +6681,216 @@ Kibana stats and run-time metrics.
*`kibana.stats.cluster_uuid`*::
*`kibana.stats.uuid`*::
+
--
type: keyword
UUID of the Elasticsearch cluster to which Kibana connects.
Kibana instance UUID
--
*`kibana.stats.name`*::
+
--
type: keyword
type: text
Kibana instance name.
Kibana instance name
--
*`kibana.stats.uuid`*::
*`kibana.stats.index`*::
+
--
type: keyword
Kibana instance uuid.
Name of Kibana's internal index
--
*`kibana.stats.version.number`*::
*`kibana.stats.host.name`*::
+
--
type: keyword
Kibana version number.
Kibana instance hostname
--
*`kibana.stats.status.overall.state`*::
*`kibana.stats.transport_address`*::
+
--
type: keyword
Kibana overall state.
Kibana server's hostname and port
--
[float]
== process fields
Kibana process metrics.
[float]
== mem fields
Memory usage metrics of the Kibana instance.
*`kibana.stats.process.mem.heap.max.bytes`*::
*`kibana.stats.version`*::
+
--
type: long
format: bytes
type: keyword
Total amount of heap memory used by V8.
Kibana version
--
*`kibana.stats.process.mem.heap.used.bytes`*::
*`kibana.stats.snapshot`*::
+
--
type: long
format: bytes
type: boolean
Amount of memory in use by V8.
Whether the Kibana build is a snapshot build
--
*`kibana.stats.process.mem.resident_set_size.bytes`*::
*`kibana.stats.status`*::
+
--
type: long
format: bytes
type: keyword
The amount of space occupied in main memory for the process. Includes heap, code segment, and stack.
Kibana instance's health status
--
*`kibana.stats.process.mem.external.bytes`*::
*`kibana.stats.concurrent_connections`*::
+
--
type: long
format: bytes
Memory usage of C++ objects bound to JavaScript objects managed by V8.
Number of client connections made to the server. Note that browsers can send multiple simultaneous connections to request mulitple server assets at once, and they can re-use established connections.
--
*`kibana.stats.process.pid`*::
+
--
type: long
[float]
== process fields
Process ID of the Kibana instance.
Process metrics
--
*`kibana.stats.process.uptime.ms`*::
*`kibana.stats.process.event_loop_delay.ms`*::
+
--
type: long
type: scaled_float
Amount of time that the Kibana process has been running in milliseconds.
Event loop delay in milliseconds
--
[float]
== response_times fields
== memory.heap fields
HTTP Server response time metrics
Process heap metrics
*`kibana.stats.response_times.avg.ms`*::
*`kibana.stats.process.memory.heap.total.bytes`*::
+
--
type: long
Accumulated averages for response times, for all responses in a 5-second time window.
format: bytes
Total heap allocated to process in bytes
--
*`kibana.stats.response_times.max.ms`*::
*`kibana.stats.process.memory.heap.used.bytes`*::
+
--
type: long
Accumulated maximums for response times, for all responses in a 5-second time window.
--
[float]
== requests fields
HTTP Server request metrics
*`kibana.stats.requests.status_codes`*::
+
--
type: object
format: bytes
Key-value pairs for each status code sent by the server, and the number of times it sent that code.
Heap used by process in bytes
--
*`kibana.stats.requests.total`*::
*`kibana.stats.process.memory.heap.size_limit.bytes`*::
+
--
type: long
Total number of requests sent by the server.
--
*`kibana.stats.requests.disconnects`*::
+
--
type: long
format: bytes
Total number of client disconnects encountered by the server.
Max. old space size allocated to Node.js process, in bytes
--
*`kibana.stats.concurrent_connections`*::
*`kibana.stats.process.memory.heap.uptime.ms`*::
+
--
type: long
Number of client connections made to the server. Note that browsers can send multiple simultaneous connections to request multiple server assets at once, and they can re-use established connections.
Uptime of process in milliseconds
--
[float]
== sockets fields
== request fields
HTTP Web Sockets metrics
Request count metrics
[float]
== http fields
*`kibana.stats.request.disconnects`*::
+
--
type: long
Web Sockets over plaintext HTTP
Number of requests that were disconnected
--
*`kibana.stats.sockets.http.total`*::
*`kibana.stats.request.total`*::
+
--
type: long
Number of HTTP web socket connections established
Total number of requests
--
[float]
== https fields
== response_time fields
Web Sockets over encrypted HTTPS
Response times metrics
*`kibana.stats.sockets.https.total`*::
*`kibana.stats.response_time.avg.ms`*::
+
--
type: long
Number of HTTPS web socket connections established
Average response time in milliseconds
--
*`kibana.stats.event_loop_delay`*::
*`kibana.stats.response_time.max.ms`*::
+
--
type: long
Node event loop delay calculated with internal benchmarking.
Maximum response time in milliseconds
--
Expand Down
1 change: 1 addition & 0 deletions metricbeat/docs/modules/kibana.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ metricbeat.modules:
metricsets: ["status"]
period: 10s
hosts: ["localhost:5601"]
basepath: ""
enabled: true
----

Expand Down
4 changes: 1 addition & 3 deletions metricbeat/helper/xpack/xpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package xpack

import (
"fmt"
"time"
)

// Product supported by X-Pack Monitoring
Expand Down Expand Up @@ -57,8 +56,7 @@ func (p Product) String() string {
// MakeMonitoringIndexName method returns the name of the monitoring index for
// a given product { elasticsearch, kibana, logstash, beats }
func MakeMonitoringIndexName(product Product) string {
today := time.Now().UTC().Format("2006.01.02")
const version = "6"

return fmt.Sprintf(".monitoring-%v-%v-mb-%v", product, version, today)
return fmt.Sprintf(".monitoring-%v-%v-mb", product, version)
}
11 changes: 4 additions & 7 deletions metricbeat/helper/xpack/xpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ package xpack
import (
"fmt"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestMakeMonitoringIndexName(t *testing.T) {
today := time.Now().UTC().Format("2006.01.02")

tests := []struct {
Name string
Product Product
Expand All @@ -36,22 +33,22 @@ func TestMakeMonitoringIndexName(t *testing.T) {
{
"Elasticsearch monitoring index",
Elasticsearch,
fmt.Sprintf(".monitoring-es-6-mb-%v", today),
".monitoring-es-6-mb",
},
{
"Kibana monitoring index",
Kibana,
fmt.Sprintf(".monitoring-kibana-6-mb-%v", today),
".monitoring-kibana-6-mb",
},
{
"Logstash monitoring index",
Logstash,
fmt.Sprintf(".monitoring-logstash-6-mb-%v", today),
".monitoring-logstash-6-mb",
},
{
"Beats monitoring index",
Beats,
fmt.Sprintf(".monitoring-beats-6-mb-%v", today),
".monitoring-beats-6-mb",
},
}

Expand Down
Loading

0 comments on commit e5791d2

Please sign in to comment.