-
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.
Module implemented as a lightweight module, it collects metrics from cochroachdb, from its Prometheus endpoint. All metrics are collected as they are and stored under `prometheus.metrics`. An overview dashboard is included.
- Loading branch information
Showing
29 changed files
with
20,025 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,58 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-module-cockroachdb]] | ||
== CockroachDB module | ||
|
||
beta[] | ||
|
||
This module periodically fetches metrics from CockroachDB. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The CockroachDB `status` metricset is compatible with any CockroachDB version | ||
exposing metrics in Prometheus format. | ||
|
||
|
||
[float] | ||
=== Dashboard | ||
|
||
The CockroachDB module includes a predefined dashboard with overview information | ||
of the monitored servers. | ||
|
||
image::./images/metricbeat-cockroachdb-overview.png[] | ||
|
||
|
||
[float] | ||
=== Example configuration | ||
|
||
The CockroachDB module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
- module: cockroachdb | ||
metricsets: ['status'] | ||
period: 10s | ||
hosts: ['localhost:8080'] | ||
# This module uses the Prometheus collector metricset, all | ||
# the options for this metricset are also available here. | ||
#metrics_path: /_status/vars | ||
---- | ||
|
||
This module supports TLS connections when using `ssl` config field, as described in <<configuration-ssl>>. | ||
It also supports the options described in <<module-http-config-options>>. | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-cockroachdb-status,status>> | ||
|
||
include::cockroachdb/status.asciidoc[] | ||
|
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,17 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-cockroachdb-status]] | ||
=== CockroachDB status metricset | ||
|
||
beta[] | ||
|
||
include::../../../../x-pack/metricbeat/module/cockroachdb/status/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-cockroachdb,exported fields>> section. | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,29 @@ | ||
For manual testing and development of this module, docker can be used. | ||
|
||
The following docker compose starts a two node cluster, dbprod-02 service | ||
can be copied and renamed many times to have more servers: | ||
``` | ||
services: | ||
dbprod-01: | ||
image: cockroachdb/cockroach:v19.1.1 | ||
command: start --insecure --advertise-addr dbprod-01 | ||
dbprod-02: | ||
image: cockroachdb/cockroach:v19.1.1 | ||
command: start --insecure --advertise-addr dbprod-02 --join dbprod-01 | ||
``` | ||
|
||
And this configuration can be used for metricbeat: | ||
``` | ||
metricbeat.autodiscover.providers: | ||
- type: docker | ||
templates: | ||
- condition: | ||
contains: | ||
docker.container.image: cockroachdb | ||
config: | ||
- module: cockroachdb | ||
hosts: ['${data.host}:8080'] | ||
``` | ||
|
||
To generate data and load, these examples are pretty handy: https://github.com/cockroachdb/examples-go |
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,7 @@ | ||
FROM cockroachdb/cockroach:v19.1.1 | ||
|
||
RUN apt-get update && apt-get install -y curl | ||
|
||
HEALTHCHECK --interval=1s --retries=90 CMD curl -q http://localhost:8080/_stats/vars | ||
|
||
CMD ["start", "--insecure"] |
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,8 @@ | ||
- module: cockroachdb | ||
metricsets: ['status'] | ||
period: 10s | ||
hosts: ['localhost:8080'] | ||
|
||
# This module uses the Prometheus collector metricset, all | ||
# the options for this metricset are also available here. | ||
#metrics_path: /_status/vars |
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,16 @@ | ||
This module periodically fetches metrics from CockroachDB. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The CockroachDB `status` metricset is compatible with any CockroachDB version | ||
exposing metrics in Prometheus format. | ||
|
||
|
||
[float] | ||
=== Dashboard | ||
|
||
The CockroachDB module includes a predefined dashboard with overview information | ||
of the monitored servers. | ||
|
||
image::./images/metricbeat-cockroachdb-overview.png[] |
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,2 @@ | ||
COCKROACHDB_HOST=cockroachdb | ||
COCKROACHDB_PORT=8080 |
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,10 @@ | ||
- key: cockroachdb | ||
title: 'CockroachDB' | ||
release: beta | ||
description: > | ||
CockroachDB module | ||
settings: ["ssl", "http"] | ||
fields: | ||
- name: cockroachdb | ||
type: group | ||
fields: |
Oops, something went wrong.