-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stats metricset to Kibana module (#6746)
This is based on the existing `status` module, which will be deprecated in Kibana once `stats` becomes established. The stats endpoint will be available in Kibana 6.4 and newer.
- Loading branch information
Showing
16 changed files
with
803 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-kibana-stats]] | ||
=== Kibana stats metricset | ||
|
||
beta[] | ||
|
||
include::../../../module/kibana/stats/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-kibana,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/kibana/stats/_meta/data.json[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package mtest | ||
|
||
import ( | ||
"net" | ||
"os" | ||
) | ||
|
||
// GetEnvHost returns host for Kibana | ||
func GetEnvHost() string { | ||
host := os.Getenv("KIBANA_HOST") | ||
|
||
if len(host) == 0 { | ||
host = "127.0.0.1" | ||
} | ||
return host | ||
} | ||
|
||
// GetEnvPort returns port for Kibana | ||
func GetEnvPort() string { | ||
port := os.Getenv("KIBANA_PORT") | ||
|
||
if len(port) == 0 { | ||
port = "5601" | ||
} | ||
return port | ||
} | ||
|
||
// GetConfig returns config for kibana module | ||
func GetConfig(metricset string) map[string]interface{} { | ||
return map[string]interface{}{ | ||
"module": "kibana", | ||
"metricsets": []string{metricset}, | ||
"hosts": []string{net.JoinHostPort(GetEnvHost(), GetEnvPort())}, | ||
} | ||
} |
Oops, something went wrong.