Skip to content

Commit

Permalink
Fix data structures
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mark <[email protected]>
  • Loading branch information
ChrsMark committed Mar 19, 2019
1 parent 2b5d62d commit cc34863
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
14 changes: 7 additions & 7 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2609,7 +2609,7 @@ Total query count
--
*`coredns.stats.dns.request.duration.sec.bucket.*`*::
*`coredns.stats.dns.request.duration.ns.bucket.*`*::
+
--
type: object
Expand All @@ -2619,7 +2619,7 @@ Request duration histogram buckets in nanoseconds
--
*`coredns.stats.dns.request.duration.sec.sum`*::
*`coredns.stats.dns.request.duration.ns.sum`*::
+
--
type: long
Expand All @@ -2631,7 +2631,7 @@ Requests duration, sum of durations in nanoseconds
--
*`coredns.stats.dns.request.duration.sec.count`*::
*`coredns.stats.dns.request.duration.ns.count`*::
+
--
type: long
Expand All @@ -2654,7 +2654,7 @@ Request Size histogram buckets
*`coredns.stats.dns.request.size.bytes.sum`*::
+
--
type: double
type: long
Request Size histogram sum
Expand All @@ -2664,7 +2664,7 @@ Request Size histogram sum
*`coredns.stats.dns.request.size.bytes.count`*::
+
--
type: double
type: long
Request Size histogram count
Expand Down Expand Up @@ -2744,7 +2744,7 @@ Response Size histogram buckets
*`coredns.stats.dns.response.size.bytes.sum`*::
+
--
type: double
type: long
Response Size histogram sum
Expand All @@ -2754,7 +2754,7 @@ Response Size histogram sum
*`coredns.stats.dns.response.size.bytes.count`*::
+
--
type: double
type: long
Response Size histogram count
Expand Down
1 change: 1 addition & 0 deletions metricbeat/helper/prometheus/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (m *commonMetric) GetValue(metric *dto.Metric) interface{} {
key := strconv.FormatFloat(bucket.GetUpperBound(), 'f', -1, 64)
bucketMap[key] = bucket.GetCumulativeCount()
}

if len(bucketMap) != 0 {
value["bucket"] = bucketMap
}
Expand Down
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.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dns": {
"request": {
"duration": {
"sec": {
"ns": {
"bucket": {
"+Inf": 430,
"1000000": 0,
Expand Down Expand Up @@ -51,4 +51,4 @@
"address": "127.0.0.1:9153",
"type": "coredns"
}
}
}
20 changes: 10 additions & 10 deletions metricbeat/module/coredns/stats/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
type: long
description: >
Total query count
- name: dns.request.duration.sec.bucket.*
- name: dns.request.duration.ns.bucket.*
type: object
object_type: double
object_type: long
description: >
Request duration histogram buckets in nanoseconds
- name: dns.request.duration.sec.sum
- name: dns.request.duration.ns.sum
type: long
format: duration
description: >
Requests duration, sum of durations in nanoseconds
- name: dns.request.duration.sec.count
- name: dns.request.duration.ns.count
type: long
description: >
Requests duration, number of requests
- name: dns.request.size.bytes.bucket.*
type: object
object_type: double
object_type: long
description: >
Request Size histogram buckets
- name: dns.request.size.bytes.sum
type: double
type: long
description: >
Request Size histogram sum
- name: dns.request.size.bytes.count
type: double
type: long
description: >
Request Size histogram count
- name: dns.request.do.count.total
Expand Down Expand Up @@ -65,15 +65,15 @@
The address family of the transport (1 = IP (IP version 4), 2 = IP6 (IP version 6))
- name: dns.response.size.bytes.bucket.*
type: object
object_type: double
object_type: long
description: >
Response Size histogram buckets
- name: dns.response.size.bytes.sum
type: double
type: long
description: >
Response Size histogram sum
- name: dns.response.size.bytes.count
type: double
type: long
description: >
Response Size histogram count
- name: server
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/module/coredns/stats/_meta/test/metrics.expected
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
},
"duration": {
"sec": {
"ns": {
"bucket": {
"+Inf": 440,
"1000000": 0,
Expand Down Expand Up @@ -214,4 +214,4 @@
"Service": "",
"Took": 0
}
]
]
2 changes: 1 addition & 1 deletion metricbeat/module/coredns/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var mapping = &prometheus.MetricsMapping{
"coredns_panic_count_total": prometheus.Metric("panic.count.total"),
"coredns_dns_request_count_total": prometheus.Metric("dns.request.count.total"),
"coredns_dns_request_duration_seconds": prometheus.Metric(
"dns.request.duration.sec",
"dns.request.duration.ns",
prometheus.OpMultiplyBuckets(1000000000)),
"coredns_dns_request_size_bytes": prometheus.Metric("dns.request.size.bytes"),
"coredns_dns_request_do_count_total": prometheus.Metric("dns.request.do.count.total"),
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/coredns/stats/stats_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestData(t *testing.T) {
{"coredns.stats.panic.count.total", "./_meta/data_panic_event.json"},
{"coredns.stats.dns.request.count.total", "./_meta/data_request_count_event.json"},
{"coredns.stats.dns.request.size.bytes", "./_meta/data_size_bytes_event.json"},
{"coredns.stats.dns.request.duration.sec", "./_meta/data_request_duration_sec_event.json"},
{"coredns.stats.dns.request.duration.ns", "./_meta/data_request_duration_ns_event.json"},
{"coredns.stats.dns.response.rcode", "./_meta/data_response_rcode_event.json"},
{"coredns.stats.dns.request.type", "./_meta/data_request_type_event.json"},
}
Expand Down

0 comments on commit cc34863

Please sign in to comment.