| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .\" Generated by Mmark Markdown Processer - mmark.nl | 
					
						
							|  |  |  | .TH "COREDNS-HEALTH" "7" "April 2019" "CoreDNS" "CoreDNS Plugins" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .SH NAME | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | \fIhealth\fP - enables a health check endpoint. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .SH DESCRIPTION | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | Enabled process wide health endpoint. When CoreDNS is up and running this returns a 200 OK http | 
					
						
							|  |  |  | status code. The health is exported, by default, on port 8080/health . | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .SH SYNTAX | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | health [ADDRESS] | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | Optionally takes an address; the default is \fB\fC:8080\fR. The health path is fixed to \fB\fC/health\fR. The | 
					
						
							|  |  |  | health endpoint returns a 200 response code and the word "OK" when this server is healthy. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-03-30 13:56:52 +00:00
										 |  |  | An extra option can be set with this extended syntax: | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  | health [ADDRESS] { | 
					
						
							|  |  |  |     lameduck DURATION | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .IP \(bu 4 | 
					
						
							|  |  |  | Where \fB\fClameduck\fR will make the process unhealthy then \fIwait\fP for \fBDURATION\fP before the process | 
					
						
							|  |  |  | shuts down. | 
					
						
							| 
									
										
										
										
											2018-03-05 19:58:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | If you have multiple Server Blocks, \fIhealth\fP should only be enabled in one of them (as it is process | 
					
						
							|  |  |  | wide). If you really need multiple endpoints, you must run health endpoints on different ports: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							| 
									
										
										
										
											2018-03-05 19:58:28 +00:00
										 |  |  | com { | 
					
						
							|  |  |  |     whoami | 
					
						
							|  |  |  |     health :8080 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | net { | 
					
						
							|  |  |  |     erratic | 
					
						
							|  |  |  |     health :8081 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-05 19:58:28 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .SH METRICS | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | If monitoring is enabled (via the \fIprometheus\fP directive) then the following metric is exported: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .IP \(bu 4 | 
					
						
							|  |  |  | \fB\fCcoredns_health_request_duration_seconds{}\fR - duration to process a /health query. As this should | 
					
						
							|  |  |  | be a local operation it should be fast. A (large) increases in this duration indicates the | 
					
						
							|  |  |  | CoreDNS process is having trouble keeping up with its query load. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | Note that this metric \fIdoes not\fP have a \fB\fCserver\fR label, because being overloaded is a symptom of | 
					
						
							|  |  |  | the running process, \fInot\fP a specific server. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .SH EXAMPLES | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | Run another health endpoint on http://localhost:8091 | 
					
						
							|  |  |  | \[la]http://localhost:8091\[ra]. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							|  |  |  | \&. { | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  |     health localhost:8091 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  | Set a lameduck duration of 1 second: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							|  |  |  | \&. { | 
					
						
							| 
									
										
										
										
											2018-03-05 19:58:28 +00:00
										 |  |  |     health localhost:8092 { | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  |         lameduck 1s | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-25 21:59:08 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .SH BUGS | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | When reloading, the health 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 health handler stays down. Health will not reply HTTP request until a successful reload | 
					
						
							|  |  |  | or a complete restart of CoreDNS. | 
					
						
							|  |  |  | 
 |