mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 00:01:35 +01:00 
			
		
		
		
	
							parent
							
								
									c8a6b16d86
								
							
						
					
					
						commit
						ed1841c36f
					
				| @ -13,7 +13,7 @@ The following metrics are exported: | |||||||
| * `coredns_build_info{version, revision, goversion}` - info about CoreDNS itself. | * `coredns_build_info{version, revision, goversion}` - info about CoreDNS itself. | ||||||
| * `coredns_panic_count_total{}` - total number of panics. | * `coredns_panic_count_total{}` - total number of panics. | ||||||
| * `coredns_dns_request_count_total{server, zone, proto, family}` - total query count. | * `coredns_dns_request_count_total{server, zone, proto, family}` - total query count. | ||||||
| * `coredns_dns_request_duration_seconds{server, zone}` - duration to process each query. | * `coredns_dns_request_duration_seconds{server, zone, type}` - duration to process each query. | ||||||
| * `coredns_dns_request_size_bytes{server, zone, proto}` - size of the request in bytes. | * `coredns_dns_request_size_bytes{server, zone, proto}` - size of the request in bytes. | ||||||
| * `coredns_dns_request_do_count_total{server, zone}` -  queries that have the DO bit set | * `coredns_dns_request_do_count_total{server, zone}` -  queries that have the DO bit set | ||||||
| * `coredns_dns_request_type_count_total{server, zone, type}` - counter of queries per zone and type. | * `coredns_dns_request_type_count_total{server, zone, type}` - counter of queries per zone and type. | ||||||
|  | |||||||
| @ -21,7 +21,6 @@ func Report(server string, req request.Request, zone, rcode string, size int, st | |||||||
| 
 | 
 | ||||||
| 	typ := req.QType() | 	typ := req.QType() | ||||||
| 	RequestCount.WithLabelValues(server, zone, net, fam).Inc() | 	RequestCount.WithLabelValues(server, zone, net, fam).Inc() | ||||||
| 	RequestDuration.WithLabelValues(server, zone).Observe(time.Since(start).Seconds()) |  | ||||||
| 
 | 
 | ||||||
| 	if req.Do() { | 	if req.Do() { | ||||||
| 		RequestDo.WithLabelValues(server, zone).Inc() | 		RequestDo.WithLabelValues(server, zone).Inc() | ||||||
| @ -29,8 +28,10 @@ func Report(server string, req request.Request, zone, rcode string, size int, st | |||||||
| 
 | 
 | ||||||
| 	if _, known := monitorType[typ]; known { | 	if _, known := monitorType[typ]; known { | ||||||
| 		RequestType.WithLabelValues(server, zone, dns.Type(typ).String()).Inc() | 		RequestType.WithLabelValues(server, zone, dns.Type(typ).String()).Inc() | ||||||
|  | 		RequestDuration.WithLabelValues(server, zone, dns.Type(typ).String()).Observe(time.Since(start).Seconds()) | ||||||
| 	} else { | 	} else { | ||||||
| 		RequestType.WithLabelValues(server, zone, other).Inc() | 		RequestType.WithLabelValues(server, zone, other).Inc() | ||||||
|  | 		RequestDuration.WithLabelValues(server, zone, other).Observe(time.Since(start).Seconds()) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	ResponseSize.WithLabelValues(server, zone, net).Observe(float64(size)) | 	ResponseSize.WithLabelValues(server, zone, net).Observe(float64(size)) | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ var ( | |||||||
| 		Name:      "request_duration_seconds", | 		Name:      "request_duration_seconds", | ||||||
| 		Buckets:   plugin.TimeBuckets, | 		Buckets:   plugin.TimeBuckets, | ||||||
| 		Help:      "Histogram of the time (in seconds) each request took.", | 		Help:      "Histogram of the time (in seconds) each request took.", | ||||||
| 	}, []string{"server", "zone"}) | 	}, []string{"server", "zone", "type"}) | ||||||
| 
 | 
 | ||||||
| 	RequestSize = prometheus.NewHistogramVec(prometheus.HistogramOpts{ | 	RequestSize = prometheus.NewHistogramVec(prometheus.HistogramOpts{ | ||||||
| 		Namespace: plugin.Namespace, | 		Namespace: plugin.Namespace, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user