Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coredns metricbeat module #10585

Merged
merged 24 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add AWS SQS metricset. {pull}10684[10684] {issue}10053[10053]
- Add AWS s3_request metricset. {pull}10949[10949] {issue}10055[10055]
- Add s3_daily_storage metricset. {pull}10940[10940] {issue}10055[10055]
- Add `coredns` metricbeat module. {pull}10585{10585]

*Packetbeat*

Expand Down
4 changes: 4 additions & 0 deletions metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- ./module/apache/_meta/env
- ./module/ceph/_meta/env
- ./module/consul/_meta/env
- ./module/coredns/_meta/env
- ./module/couchbase/_meta/env
- ./module/couchdb/_meta/env
- ./module/dropwizard/_meta/env
Expand Down Expand Up @@ -63,6 +64,9 @@ services:
consul:
build: ./module/consul/_meta

coredns:
build: ./module/coredns/_meta

couchbase:
build: ./module/couchbase/_meta

Expand Down
224 changes: 224 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ grouped in the following categories:
* <<exported-fields-cloud>>
* <<exported-fields-common>>
* <<exported-fields-consul>>
* <<exported-fields-coredns>>
* <<exported-fields-couchbase>>
* <<exported-fields-couchdb>>
* <<exported-fields-docker-processor>>
Expand Down Expand Up @@ -2565,6 +2566,229 @@ type: long

Nanoseconds consumed by stop-the-world garbage collection pauses since Consul started.

--

[[exported-fields-coredns]]
== coredns fields

coredns Module



[float]
== coredns fields

`coredns` contains statistics that were read from coreDNS



[float]
== stats fields

Contains statistics related to the coreDNS service



*`coredns.stats.panic.count.total`*::
+
--
type: long

Total number of panics


--

*`coredns.stats.dns.request.count.total`*::
+
--
type: long

Total query count


--

*`coredns.stats.dns.request.duration.ns.bucket.*`*::
+
--
type: object

Request duration histogram buckets in nanoseconds


--

*`coredns.stats.dns.request.duration.ns.sum`*::
+
--
type: long

format: duration

Requests duration, sum of durations in nanoseconds


--

*`coredns.stats.dns.request.duration.ns.count`*::
+
--
type: long

Requests duration, number of requests


--

*`coredns.stats.dns.request.size.bytes.bucket.*`*::
+
--
type: object

Request Size histogram buckets


--

*`coredns.stats.dns.request.size.bytes.sum`*::
+
--
type: long

Request Size histogram sum


--

*`coredns.stats.dns.request.size.bytes.count`*::
+
--
type: long

Request Size histogram count


--

*`coredns.stats.dns.request.do.count.total`*::
+
--
type: long

Number of queries that have the DO bit set


--

*`coredns.stats.dns.request.type.count.total`*::
+
--
type: long

Counter of queries per zone and type


--

*`coredns.stats.type`*::
+
--
type: keyword

Holds the query type of the request


--

*`coredns.stats.dns.response.rcode.count.total`*::
+
--
type: long

Counter of responses per zone and rcode


--

*`coredns.stats.rcode`*::
+
--
type: keyword

Holds the rcode of the response


--

*`coredns.stats.family`*::
+
--
type: keyword

The address family of the transport (1 = IP (IP version 4), 2 = IP6 (IP version 6))


--

*`coredns.stats.dns.response.size.bytes.bucket.*`*::
+
--
type: object

Response Size histogram buckets


--

*`coredns.stats.dns.response.size.bytes.sum`*::
+
--
type: long

Response Size histogram sum


--

*`coredns.stats.dns.response.size.bytes.count`*::
+
--
type: long

Response Size histogram count


--

*`coredns.stats.server`*::
+
--
type: keyword

The server responsible for the request


--

*`coredns.stats.zone`*::
+
--
type: keyword

The zonename used for the request/response


--

*`coredns.stats.proto`*::
+
--
type: keyword

The transport of the response ("udp" or "tcp")


--

[[exported-fields-couchbase]]
Expand Down
37 changes: 37 additions & 0 deletions metricbeat/docs/modules/coredns.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-module-coredns]]
== coredns module

beta[]

This is the coredns module.



[float]
=== Example configuration

The coredns module supports the standard configuration options that are described
in <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
- module: coredns
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9153"]
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-coredns-stats,stats>>

include::coredns/stats.asciidoc[]

17 changes: 17 additions & 0 deletions metricbeat/docs/modules/coredns/stats.asciidoc
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-coredns-stats]]
=== coredns stats metricset

beta[]

include::../../../module/coredns/stats/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-coredns,exported fields>> section.

3 changes: 3 additions & 0 deletions metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This file is generated! See scripts/docs_collector.py
|<<metricbeat-metricset-ceph-pool_disk,pool_disk>>
|<<metricbeat-module-consul,consul>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-consul-agent,agent>> beta[]
|<<metricbeat-module-coredns,coredns>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-coredns-stats,stats>> beta[]
|<<metricbeat-module-couchbase,Couchbase>> |image:./images/icon-no.png[No prebuilt dashboards] |
.3+| .3+| |<<metricbeat-metricset-couchbase-bucket,bucket>>
|<<metricbeat-metricset-couchbase-cluster,cluster>>
Expand Down Expand Up @@ -177,6 +179,7 @@ include::modules/apache.asciidoc[]
include::modules/aws.asciidoc[]
include::modules/ceph.asciidoc[]
include::modules/consul.asciidoc[]
include::modules/coredns.asciidoc[]
include::modules/couchbase.asciidoc[]
include::modules/couchdb.asciidoc[]
include::modules/docker.asciidoc[]
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ metricbeat.modules:
hosts: ["localhost:8500"]


#------------------------------- coredns Module ------------------------------
- module: coredns
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9153"]

#------------------------------ Couchbase Module -----------------------------
- module: couchbase
metricsets: ["bucket", "cluster", "node"]
Expand Down
25 changes: 25 additions & 0 deletions metricbeat/module/coredns/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Start from coredns base Docker image
FROM coredns/coredns:latest

# create an enhanced container with nc command available since coredns is based
# on scratch image making healthcheck impossible
FROM alpine:latest
COPY --from=0 /coredns /coredns
# Expose client, management, and cluster ports
# For DNS
EXPOSE 53 53/udp

# For Prometheus metrics
EXPOSE 9153 9153/tcp

# Copy coredns configuration in container
ADD config /etc/coredns

RUN apk add --update --no-cache bind-tools

# Check if the Coredns container is healthy
HEALTHCHECK --interval=5s --retries=10 CMD dig @0.0.0.0 my.domain.org +dnssec >/dev/null

# Start coredns with custom configuration file
ENTRYPOINT ["/coredns"]
CMD ["-conf", "/etc/coredns/Corefile"]
4 changes: 4 additions & 0 deletions metricbeat/module/coredns/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- module: coredns
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9153"]
4 changes: 4 additions & 0 deletions metricbeat/module/coredns/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- module: coredns
metricsets: ["stats"]
period: 10s
hosts: ["localhost:9153"]
Loading