| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | package template | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"github.com/coredns/coredns/plugin" | 
					
						
							| 
									
										
										
										
											2020-09-24 18:14:41 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | 	"github.com/prometheus/client_golang/prometheus" | 
					
						
							| 
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 |  |  | 	"github.com/prometheus/client_golang/prometheus/promauto" | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var ( | 
					
						
							| 
									
										
										
										
											2020-03-31 14:07:36 +08:00
										 |  |  | 	// templateMatchesCount is the counter of template regex matches. | 
					
						
							| 
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 |  |  | 	templateMatchesCount = promauto.NewCounterVec(prometheus.CounterOpts{ | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | 		Namespace: plugin.Namespace, | 
					
						
							|  |  |  | 		Subsystem: "template", | 
					
						
							|  |  |  | 		Name:      "matches_total", | 
					
						
							|  |  |  | 		Help:      "Counter of template regex matches.", | 
					
						
							| 
									
										
										
										
											2022-09-15 15:36:49 +02:00
										 |  |  | 	}, []string{"server", "zone", "view", "class", "type"}) | 
					
						
							| 
									
										
										
										
											2020-03-31 14:07:36 +08:00
										 |  |  | 	// templateFailureCount is the counter of go template failures. | 
					
						
							| 
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 |  |  | 	templateFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{ | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | 		Namespace: plugin.Namespace, | 
					
						
							|  |  |  | 		Subsystem: "template", | 
					
						
							|  |  |  | 		Name:      "template_failures_total", | 
					
						
							|  |  |  | 		Help:      "Counter of go template failures.", | 
					
						
							| 
									
										
										
										
											2022-09-15 15:36:49 +02:00
										 |  |  | 	}, []string{"server", "zone", "view", "class", "type", "section", "template"}) | 
					
						
							| 
									
										
										
										
											2020-03-31 14:07:36 +08:00
										 |  |  | 	// templateRRFailureCount is the counter of mis-templated RRs. | 
					
						
							| 
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 |  |  | 	templateRRFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{ | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | 		Namespace: plugin.Namespace, | 
					
						
							|  |  |  | 		Subsystem: "template", | 
					
						
							|  |  |  | 		Name:      "rr_failures_total", | 
					
						
							|  |  |  | 		Help:      "Counter of mis-templated RRs.", | 
					
						
							| 
									
										
										
										
											2022-09-15 15:36:49 +02:00
										 |  |  | 	}, []string{"server", "zone", "view", "class", "type", "section", "template"}) | 
					
						
							| 
									
										
										
										
											2018-01-08 11:52:25 +01:00
										 |  |  | ) |