2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								package acl
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/coredns/coredns/plugin"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/prometheus/client_golang/prometheus"
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"github.com/prometheus/client_golang/prometheus/promauto"
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								var (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// RequestBlockCount is the number of DNS requests being blocked.
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									RequestBlockCount = promauto.NewCounterVec(prometheus.CounterOpts{
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Namespace: plugin.Namespace,
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-31 20:03:18 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										Subsystem: pluginName,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Name:      "blocked_requests_total",
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Help:      "Counter of DNS requests being blocked.",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}, []string{"server", "zone"})
							 | 
						
					
						
							
								
									
										
										
										
											2021-02-01 09:52:23 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// RequestFilterCount is the number of DNS requests being filtered.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									RequestFilterCount = promauto.NewCounterVec(prometheus.CounterOpts{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Namespace: plugin.Namespace,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Subsystem: pluginName,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Name:      "filtered_requests_total",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Help:      "Counter of DNS requests being filtered.",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}, []string{"server", "zone"})
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// RequestAllowCount is the number of DNS requests being Allowed.
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-25 23:06:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									RequestAllowCount = promauto.NewCounterVec(prometheus.CounterOpts{
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Namespace: plugin.Namespace,
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-31 20:03:18 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										Subsystem: pluginName,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Name:      "allowed_requests_total",
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-04 23:43:45 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Help:      "Counter of DNS requests being allowed.",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}, []string{"server"})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								)
							 |