Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RequestCount is the total number of DNS requests processed by the coresmd plugin RequestCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "requests_total", Help: "Counter of DNS requests made to the coresmd plugin.", }, []string{"server", "zone", "type"}) // RequestDuration is the time taken to process DNS requests RequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "request_duration_seconds", Buckets: plugin.TimeBuckets, Help: "Histogram of the time (in seconds) each request took.", }, []string{"server", "zone"}) // CacheHits is the number of successful cache lookups CacheHits = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "cache_hits_total", Help: "Counter of successful cache lookups in the coresmd plugin.", }, []string{"server", "zone", "record_type"}) // CacheMisses is the number of failed cache lookups CacheMisses = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "cache_misses_total", Help: "Counter of failed cache lookups in the coresmd plugin.", }, []string{"server", "zone", "record_type"}) // SMDCacheAge is the age of the SMD cache in seconds SMDCacheAge = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "smd_cache_age_seconds", Help: "Age of the SMD cache in seconds.", }, []string{"server"}) // SMDCacheSize is the number of entries in the SMD cache SMDCacheSize = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: plugin.Namespace, Subsystem: "coresmd", Name: "smd_cache_size", Help: "Number of entries in the SMD cache.", }, []string{"server", "type"}) )
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
Plugin represents the coresmd plugin
func (Plugin) OnShutdown ¶
func (Plugin) OnStartupComplete ¶
func (Plugin) Ready ¶
Ready checks if the plugin's cache is initialized, has been updated at least once (i.e., LastUpdated is non-zero), and is not older than 5 minutes. It implements the ready.Readiness interface (Ready() bool) for https://coredns.io/plugins/ready/. Returns true if the cache is ready, otherwise false.
type Zone ¶
type Zone struct {
Name string // Zone name (e.g., "cluster.local")
NodePattern string // Pattern for node records (e.g., "nid{04d}.cluster.local")
}
Zone represents a DNS zone configuration
type ZoneManager ¶
type ZoneManager struct {
// contains filtered or unexported fields
}
ZoneManager handles zone operations and record lookups
func NewZoneManager ¶
func NewZoneManager(zones []Zone) *ZoneManager
NewZoneManager creates a new zone manager
func (*ZoneManager) FindZone ¶
func (zm *ZoneManager) FindZone(domain string) *Zone
FindZone finds the appropriate zone for a given domain name
Click to show internal directories.
Click to hide internal directories.