mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			117 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
| .\" Generated by Mmark Markdown Processer - mmark.miek.nl
 | |
| .TH "COREDNS-METRICS" 7 "October 2020" "CoreDNS" "CoreDNS Plugins"
 | |
| 
 | |
| .SH "NAME"
 | |
| .PP
 | |
| \fIprometheus\fP - enables Prometheus
 | |
| \[la]https://prometheus.io/\[ra] metrics.
 | |
| 
 | |
| .SH "DESCRIPTION"
 | |
| .PP
 | |
| With \fIprometheus\fP you export metrics from CoreDNS and any plugin that has them.
 | |
| The default location for the metrics is \fB\fClocalhost:9153\fR. The metrics path is fixed to \fB\fC/metrics\fR.
 | |
| The following metrics are exported:
 | |
| 
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_build_info{version, revision, goversion}\fR - info about CoreDNS itself.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_panics_total{}\fR - total number of panics.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_requests_total{server, zone, proto, family, type}\fR - total query count.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_request_duration_seconds{server, zone, type}\fR - duration to process each query.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_request_size_bytes{server, zone, proto}\fR - size of the request in bytes.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_do_requests_total{server, zone}\fR -  queries that have the DO bit set
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_response_size_bytes{server, zone, proto}\fR - response size in bytes.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_dns_responses_total{server, zone, rcode}\fR - response per zone and rcode.
 | |
| .IP \(bu 4
 | |
| \fB\fCcoredns_plugin_enabled{server, zone, name}\fR - indicates whether a plugin is enabled on per server and zone basis.
 | |
| 
 | |
| 
 | |
| .PP
 | |
| Each counter has a label \fB\fCzone\fR which is the zonename used for the request/response.
 | |
| 
 | |
| .PP
 | |
| Extra labels used are:
 | |
| 
 | |
| .IP \(bu 4
 | |
| \fB\fCserver\fR is identifying the server responsible for the request. This is a string formatted
 | |
| as the server's listening address: \fB\fC<scheme>://[<bind>]:<port>\fR. I.e. for a "normal" DNS server
 | |
| this is \fB\fCdns://:53\fR. If you are using the \fIbind\fP plugin an IP address is included, e.g.: \fB\fCdns://127.0.0.53:53\fR.
 | |
| .IP \(bu 4
 | |
| \fB\fCproto\fR which holds the transport of the response ("udp" or "tcp")
 | |
| .IP \(bu 4
 | |
| The address family (\fB\fCfamily\fR) of the transport (1 = IP (IP version 4), 2 = IP6 (IP version 6)).
 | |
| .IP \(bu 4
 | |
| \fB\fCtype\fR which holds the query type. It holds most common types (A, AAAA, MX, SOA, CNAME, PTR, TXT,
 | |
| NS, SRV, DS, DNSKEY, RRSIG, NSEC, NSEC3, IXFR, AXFR and ANY) and "other" which lumps together all
 | |
| other types.
 | |
| 
 | |
| 
 | |
| .PP
 | |
| If monitoring is enabled, queries that do not enter the plugin chain are exported under the fake
 | |
| name "dropped" (without a closing dot - this is never a valid domain name).
 | |
| 
 | |
| .PP
 | |
| This plugin can only be used once per Server Block.
 | |
| 
 | |
| .SH "SYNTAX"
 | |
| .PP
 | |
| .RS
 | |
| 
 | |
| .nf
 | |
| prometheus [ADDRESS]
 | |
| 
 | |
| .fi
 | |
| .RE
 | |
| 
 | |
| .PP
 | |
| For each zone that you want to see metrics for.
 | |
| 
 | |
| .PP
 | |
| It optionally takes a bind address to which the metrics are exported; the default
 | |
| listens on \fB\fClocalhost:9153\fR. The metrics path is fixed to \fB\fC/metrics\fR.
 | |
| 
 | |
| .SH "EXAMPLES"
 | |
| .PP
 | |
| Use an alternative listening address:
 | |
| 
 | |
| .PP
 | |
| .RS
 | |
| 
 | |
| .nf
 | |
| \&. {
 | |
|     prometheus localhost:9253
 | |
| }
 | |
| 
 | |
| .fi
 | |
| .RE
 | |
| 
 | |
| .PP
 | |
| Or via an environment variable (this is supported throughout the Corefile): \fB\fCexport PORT=9253\fR, and
 | |
| then:
 | |
| 
 | |
| .PP
 | |
| .RS
 | |
| 
 | |
| .nf
 | |
| \&. {
 | |
|     prometheus localhost:{$PORT}
 | |
| }
 | |
| 
 | |
| .fi
 | |
| .RE
 | |
| 
 | |
| .SH "BUGS"
 | |
| .PP
 | |
| When reloading, the Prometheus handler is stopped before the new server instance is started.
 | |
| If that new server fails to start, then the initial server instance is still available and DNS queries still served,
 | |
| but Prometheus handler stays down.
 | |
| Prometheus will not reply HTTP request until a successful reload or a complete restart of CoreDNS.
 | |
| Only the plugins that register as Handler are visible in \fB\fCcoredns_plugin_enabled{server, zone, name}\fR. As of today the plugins reload and bind will not be reported.
 | |
| 
 |