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

Add CoreDNS metrics for cache plugin and runtime #11738

Merged
Merged
30 changes: 25 additions & 5 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,7 @@ Contains statistics related to the coreDNS service



*`coredns.stats.panic.count.total`*::
*`coredns.stats.panic.count`*::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't mention this change, I understand it's intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so true,

I'm following this convention here:
https://www.elastic.co/guide/en/beats/devguide/current/event-conventions.html#abbreviations

If you think this is ok, I'll go on and add it to the PR description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First worried about the change as it's breaking but realised the CoreDNS module is not release yet. So all good.

+
--
type: long
Expand All @@ -2600,7 +2600,7 @@ Total number of panics

--

*`coredns.stats.dns.request.count.total`*::
*`coredns.stats.dns.request.count`*::
+
--
type: long
Expand Down Expand Up @@ -2672,7 +2672,7 @@ Request Size histogram count

--

*`coredns.stats.dns.request.do.count.total`*::
*`coredns.stats.dns.request.do.count`*::
+
--
type: long
Expand All @@ -2682,7 +2682,7 @@ Number of queries that have the DO bit set

--

*`coredns.stats.dns.request.type.count.total`*::
*`coredns.stats.dns.request.type.count`*::
+
--
type: long
Expand All @@ -2702,7 +2702,7 @@ Holds the query type of the request

--

*`coredns.stats.dns.response.rcode.count.total`*::
*`coredns.stats.dns.response.rcode.count`*::
+
--
type: long
Expand Down Expand Up @@ -2790,6 +2790,26 @@ type: keyword
The transport of the response ("udp" or "tcp")


--

*`coredns.stats.dns.cache.hits.count`*::
+
--
type: long

Cache hits count for the cache plugin


--

*`coredns.stats.dns.cache.misses.count`*::
+
--
type: long

Cache misses count for the cache plugin


--

[[exported-fields-couchbase]]
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/coredns/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start from coredns base Docker image
FROM coredns/coredns:latest
FROM coredns/coredns:1.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++


# create an enhanced container with nc command available since coredns is based
# on scratch image making healthcheck impossible
Expand Down
6 changes: 5 additions & 1 deletion metricbeat/module/coredns/_meta/config/Corefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ my.domain.elastic {
errors
auto
reload 10s
cache 4

# Use the prometheus plugin to export metrics at '/metrics' endpoint
prometheus :9153

# If you wish to use a standard Hosts File format, uncomment the following
# line and customize the specified file
hosts /etc/coredns/mydomain.hosts my.domain.elastic
hosts my.domain.elastic {
127.0.0.1 my.domain.elastic
fallthrough
}
}

# Zone2
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/module/coredns/_meta/config/mydomain.hosts

This file was deleted.

2 changes: 1 addition & 1 deletion metricbeat/module/coredns/fields.go

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

20 changes: 15 additions & 5 deletions metricbeat/module/coredns/stats/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Contains statistics related to the coreDNS service
release: beta
fields:
- name: panic.count.total
- name: panic.count
type: long
description: >
Total number of panics
- name: dns.request.count.total
- name: dns.request.count
type: long
description: >
Total query count
Expand Down Expand Up @@ -39,19 +39,19 @@
type: long
description: >
Request Size histogram count
- name: dns.request.do.count.total
- name: dns.request.do.count
type: long
description: >
Number of queries that have the DO bit set
- name: dns.request.type.count.total
- name: dns.request.type.count
type: long
description: >
Counter of queries per zone and type
- name: type
type: keyword
description: >
Holds the query type of the request
- name: dns.response.rcode.count.total
- name: dns.response.rcode.count
type: long
description: >
Counter of responses per zone and rcode
Expand Down Expand Up @@ -88,3 +88,13 @@
type: keyword
description: >
The transport of the response ("udp" or "tcp")


- name: dns.cache.hits.count
type: long
description: >
Cache hits count for the cache plugin
- name: dns.cache.misses.count
type: long
description: >
Cache misses count for the cache plugin
Loading