feat: Tolerate collector failures (#1769)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-11-25 21:27:31 +01:00
committed by GitHub
parent fd76be38e0
commit 1a4c6c5ce7
121 changed files with 1726 additions and 1221 deletions

View File

@@ -41,6 +41,7 @@ type Config struct {
AppExclude *regexp.Regexp `yaml:"app_exclude"`
}
//nolint:gochecknoglobals
var ConfigDefaults = Config{
SiteInclude: types.RegExpAny,
SiteExclude: types.RegExpEmpty,
@@ -150,8 +151,8 @@ func (c *Collector) GetName() string {
func (c *Collector) Close() error {
c.perfDataCollectorWebService.Close()
c.perfDataCollectorAppPoolWAS.Close()
c.perfDataCollectorW3SVCW3WP.Close()
c.perfDataCollectorWebServiceCache.Close()
c.w3SVCW3WPPerfDataCollector.Close()
c.serviceCachePerfDataCollector.Close()
return nil
}
@@ -168,23 +169,25 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
prometheus.Labels{"version": fmt.Sprintf("%d.%d", c.iisVersion.major, c.iisVersion.minor)},
)
errs := make([]error, 0, 4)
if err := c.buildWebService(); err != nil {
return fmt.Errorf("failed to build Web Service collector: %w", err)
errs = append(errs, fmt.Errorf("failed to build Web Service collector: %w", err))
}
if err := c.buildAppPoolWAS(); err != nil {
return fmt.Errorf("failed to build APP_POOL_WAS collector: %w", err)
errs = append(errs, fmt.Errorf("failed to build APP_POOL_WAS collector: %w", err))
}
if err := c.buildW3SVCW3WP(); err != nil {
return fmt.Errorf("failed to build W3SVC_W3WP collector: %w", err)
errs = append(errs, fmt.Errorf("failed to build W3SVC_W3WP collector: %w", err))
}
if err := c.buildWebServiceCache(); err != nil {
return fmt.Errorf("failed to build Web Service Cache collector: %w", err)
errs = append(errs, fmt.Errorf("failed to build Web Service Cache collector: %w", err))
}
return nil
return errors.Join(errs...)
}
type simpleVersion struct {
@@ -195,7 +198,7 @@ type simpleVersion struct {
func (c *Collector) getIISVersion(logger *slog.Logger) simpleVersion {
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\InetStp\`, registry.QUERY_VALUE)
if err != nil {
logger.Warn("Couldn't open registry to determine IIS version",
logger.Warn("couldn't open registry to determine IIS version",
slog.Any("err", err),
)
@@ -273,7 +276,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
// discarded, and "Site_B#2" would be kept and presented as "Site_B" in the
// Collector metrics.
// [ "Site_A", "Site_B", "Site_C", "Site_B#2" ].
func deduplicateIISNames(counterValues map[string]map[string]perfdata.CounterValues) {
func deduplicateIISNames(counterValues map[string]map[string]perfdata.CounterValue) {
services := slices.Collect(maps.Keys(counterValues))
// Ensure IIS entry with the highest suffix occurs last

View File

@@ -57,6 +57,7 @@ const (
TotalWorkerProcessStartupFailures = "Total Worker Process Startup Failures"
)
//nolint:gochecknoglobals
var applicationStates = map[uint32]string{
1: "Uninitialized",
2: "Initialized",

View File

@@ -26,399 +26,385 @@ import (
)
type collectorW3SVCW3WP struct {
perfDataCollectorW3SVCW3WP *perfdata.Collector
w3SVCW3WPPerfDataCollector *perfdata.Collector
// W3SVC_W3WP
threads *prometheus.Desc
maximumThreads *prometheus.Desc
w3SVCW3WPThreads *prometheus.Desc
w3SVCW3WPMaximumThreads *prometheus.Desc
requestsTotal *prometheus.Desc
requestsActive *prometheus.Desc
w3SVCW3WPRequestsTotal *prometheus.Desc
w3SVCW3WPRequestsActive *prometheus.Desc
activeFlushedEntries *prometheus.Desc
w3SVCW3WPActiveFlushedEntries *prometheus.Desc
currentFileCacheMemoryUsage *prometheus.Desc
maximumFileCacheMemoryUsage *prometheus.Desc
fileCacheFlushesTotal *prometheus.Desc
fileCacheQueriesTotal *prometheus.Desc
fileCacheHitsTotal *prometheus.Desc
filesCached *prometheus.Desc
filesCachedTotal *prometheus.Desc
filesFlushedTotal *prometheus.Desc
w3SVCW3WPCurrentFileCacheMemoryUsage *prometheus.Desc
w3SVCW3WPMaximumFileCacheMemoryUsage *prometheus.Desc
w3SVCW3WPFileCacheFlushesTotal *prometheus.Desc
w3SVCW3WPFileCacheQueriesTotal *prometheus.Desc
w3SVCW3WPFileCacheHitsTotal *prometheus.Desc
w3SVCW3WPFilesCached *prometheus.Desc
w3SVCW3WPFilesCachedTotal *prometheus.Desc
w3SVCW3WPFilesFlushedTotal *prometheus.Desc
uriCacheFlushesTotal *prometheus.Desc
uriCacheQueriesTotal *prometheus.Desc
uriCacheHitsTotal *prometheus.Desc
urisCached *prometheus.Desc
urisCachedTotal *prometheus.Desc
urisFlushedTotal *prometheus.Desc
w3SVCW3WPURICacheFlushesTotal *prometheus.Desc
w3SVCW3WPURICacheQueriesTotal *prometheus.Desc
w3SVCW3WPURICacheHitsTotal *prometheus.Desc
w3SVCW3WPURIsCached *prometheus.Desc
w3SVCW3WPURIsCachedTotal *prometheus.Desc
w3SVCW3WPURIsFlushedTotal *prometheus.Desc
metadataCached *prometheus.Desc
metadataCacheFlushes *prometheus.Desc
metadataCacheQueriesTotal *prometheus.Desc
metadataCacheHitsTotal *prometheus.Desc
metadataCachedTotal *prometheus.Desc
metadataFlushedTotal *prometheus.Desc
w3SVCW3WPMetadataCached *prometheus.Desc
w3SVCW3WPMetadataCacheFlushes *prometheus.Desc
w3SVCW3WPMetadataCacheQueriesTotal *prometheus.Desc
w3SVCW3WPMetadataCacheHitsTotal *prometheus.Desc
w3SVCW3WPMetadataCachedTotal *prometheus.Desc
w3SVCW3WPMetadataFlushedTotal *prometheus.Desc
outputCacheActiveFlushedItems *prometheus.Desc
outputCacheItems *prometheus.Desc
outputCacheMemoryUsage *prometheus.Desc
outputCacheQueriesTotal *prometheus.Desc
outputCacheHitsTotal *prometheus.Desc
outputCacheFlushedItemsTotal *prometheus.Desc
outputCacheFlushesTotal *prometheus.Desc
w3SVCW3WPOutputCacheActiveFlushedItems *prometheus.Desc
w3SVCW3WPOutputCacheItems *prometheus.Desc
w3SVCW3WPOutputCacheMemoryUsage *prometheus.Desc
w3SVCW3WPOutputCacheQueriesTotal *prometheus.Desc
w3SVCW3WPOutputCacheHitsTotal *prometheus.Desc
w3SVCW3WPOutputCacheFlushedItemsTotal *prometheus.Desc
w3SVCW3WPOutputCacheFlushesTotal *prometheus.Desc
// IIS 8+ Only
requestErrorsTotal *prometheus.Desc
webSocketRequestsActive *prometheus.Desc
webSocketConnectionAttempts *prometheus.Desc
webSocketConnectionsAccepted *prometheus.Desc
webSocketConnectionsRejected *prometheus.Desc
w3SVCW3WPRequestErrorsTotal *prometheus.Desc
w3SVCW3WPWebSocketRequestsActive *prometheus.Desc
w3SVCW3WPWebSocketConnectionAttempts *prometheus.Desc
w3SVCW3WPWebSocketConnectionsAccepted *prometheus.Desc
w3SVCW3WPWebSocketConnectionsRejected *prometheus.Desc
}
var workerProcessNameExtractor = regexp.MustCompile(`^(\d+)_(.+)$`)
const (
Threads = "Active Threads Count"
MaximumThreads = "Maximum Threads Count"
w3SVCW3WPThreads = "Active Threads Count"
w3SVCW3WPMaximumThreads = "Maximum Threads Count"
RequestsTotal = "Total HTTP Requests Served"
RequestsActive = "Active Requests"
w3SVCW3WPRequestsTotal = "Total HTTP Requests Served"
w3SVCW3WPRequestsActive = "Active Requests"
ActiveFlushedEntries = "Active Flushed Entries"
w3SVCW3WPActiveFlushedEntries = "Active Flushed Entries"
CurrentFileCacheMemoryUsage = "Current File Cache Memory Usage"
MaximumFileCacheMemoryUsage = "Maximum File Cache Memory Usage"
FileCacheFlushesTotal = "File Cache Flushes"
FileCacheHitsTotal = "File Cache Hits"
FileCacheMissesTotal = "File Cache Misses"
FilesCached = "Current Files Cached"
FilesCachedTotal = "Total Files Cached"
FilesFlushedTotal = "Total Flushed Files"
w3SVCW3WPCurrentFileCacheMemoryUsage = "Current File Cache Memory Usage"
w3SVCW3WPMaximumFileCacheMemoryUsage = "Maximum File Cache Memory Usage"
w3SVCW3WPFileCacheFlushesTotal = "File Cache Flushes"
w3SVCW3WPFileCacheHitsTotal = "File Cache Hits"
w3SVCW3WPFileCacheMissesTotal = "File Cache Misses"
w3SVCW3WPFilesCached = "Current Files Cached"
w3SVCW3WPFilesCachedTotal = "Total Files Cached"
w3SVCW3WPFilesFlushedTotal = "Total Flushed Files"
URICacheFlushesTotal = "Total Flushed URIs"
URICacheFlushesTotalKernel = "Total Flushed URIs"
URIsFlushedTotalKernel = "Kernel: Total Flushed URIs"
URICacheHitsTotal = "URI Cache Hits"
URICacheHitsTotalKernel = "Kernel: URI Cache Hits"
URICacheMissesTotal = "URI Cache Misses"
URICacheMissesTotalKernel = "Kernel: URI Cache Misses"
URIsCached = "Current URIs Cached"
URIsCachedKernel = "Kernel: Current URIs Cached"
URIsCachedTotal = "Total URIs Cached"
URIsCachedTotalKernel = "Total URIs Cached"
URIsFlushedTotal = "Total Flushed URIs"
w3SVCW3WPURICacheFlushesTotal = "Total Flushed URIs"
w3SVCW3WPURICacheHitsTotal = "URI Cache Hits"
w3SVCW3WPURICacheMissesTotal = "URI Cache Misses"
w3SVCW3WPURIsCached = "Current URIs Cached"
w3SVCW3WPURIsCachedTotal = "Total URIs Cached"
w3SVCW3WPURIsFlushedTotal = "Total Flushed URIs"
MetaDataCacheHits = "Metadata Cache Hits"
MetaDataCacheMisses = "Metadata Cache Misses"
MetadataCached = "Current Metadata Cached"
MetadataCacheFlushes = "Metadata Cache Flushes"
MetadataCachedTotal = "Total Metadata Cached"
MetadataFlushedTotal = "Total Flushed Metadata"
w3SVCW3WPMetaDataCacheHits = "Metadata Cache Hits"
w3SVCW3WPMetaDataCacheMisses = "Metadata Cache Misses"
w3SVCW3WPMetadataCached = "Current Metadata Cached"
w3SVCW3WPMetadataCacheFlushes = "Metadata Cache Flushes"
w3SVCW3WPMetadataCachedTotal = "Total Metadata Cached"
w3SVCW3WPMetadataFlushedTotal = "Total Flushed Metadata"
OutputCacheActiveFlushedItems = "Output Cache Current Flushed Items"
OutputCacheItems = "Output Cache Current Items"
OutputCacheMemoryUsage = "Output Cache Current Memory Usage"
OutputCacheHitsTotal = "Output Cache Total Hits"
OutputCacheMissesTotal = "Output Cache Total Misses"
OutputCacheFlushedItemsTotal = "Output Cache Total Flushed Items"
OutputCacheFlushesTotal = "Output Cache Total Flushes"
w3SVCW3WPOutputCacheActiveFlushedItems = "Output Cache Current Flushed Items"
w3SVCW3WPOutputCacheItems = "Output Cache Current Items"
w3SVCW3WPOutputCacheMemoryUsage = "Output Cache Current Memory Usage"
w3SVCW3WPOutputCacheHitsTotal = "Output Cache Total Hits"
w3SVCW3WPOutputCacheMissesTotal = "Output Cache Total Misses"
w3SVCW3WPOutputCacheFlushedItemsTotal = "Output Cache Total Flushed Items"
w3SVCW3WPOutputCacheFlushesTotal = "Output Cache Total Flushes"
// IIS8
RequestErrors500 = "% 500 HTTP Response Sent"
RequestErrors503 = "% 503 HTTP Response Sent"
RequestErrors404 = "% 404 HTTP Response Sent"
RequestErrors403 = "% 403 HTTP Response Sent"
RequestErrors401 = "% 401 HTTP Response Sent"
w3SVCW3WPRequestErrors500 = "% 500 HTTP Response Sent"
w3SVCW3WPRequestErrors404 = "% 404 HTTP Response Sent"
w3SVCW3WPRequestErrors403 = "% 403 HTTP Response Sent"
w3SVCW3WPRequestErrors401 = "% 401 HTTP Response Sent"
WebSocketRequestsActive = "WebSocket Active Requests"
WebSocketConnectionAttempts = "WebSocket Connection Attempts / Sec"
WebSocketConnectionsAccepted = "WebSocket Connections Accepted / Sec"
WebSocketConnectionsRejected = "WebSocket Connections Rejected / Sec"
w3SVCW3WPWebSocketRequestsActive = "WebSocket Active Requests"
w3SVCW3WPWebSocketConnectionAttempts = "WebSocket Connection Attempts / Sec"
w3SVCW3WPWebSocketConnectionsAccepted = "WebSocket Connections Accepted / Sec"
w3SVCW3WPWebSocketConnectionsRejected = "WebSocket Connections Rejected / Sec"
)
func (c *Collector) buildW3SVCW3WP() error {
counters := []string{
Threads,
MaximumThreads,
RequestsTotal,
RequestsActive,
ActiveFlushedEntries,
CurrentFileCacheMemoryUsage,
MaximumFileCacheMemoryUsage,
FileCacheFlushesTotal,
FileCacheHitsTotal,
FileCacheMissesTotal,
FilesCached,
FilesCachedTotal,
FilesFlushedTotal,
URICacheFlushesTotal,
URICacheFlushesTotalKernel,
URIsFlushedTotalKernel,
URICacheHitsTotal,
URICacheHitsTotalKernel,
URICacheMissesTotal,
URICacheMissesTotalKernel,
URIsCached,
URIsCachedKernel,
URIsCachedTotal,
URIsCachedTotalKernel,
URIsFlushedTotal,
MetaDataCacheHits,
MetaDataCacheMisses,
MetadataCached,
MetadataCacheFlushes,
MetadataCachedTotal,
MetadataFlushedTotal,
OutputCacheActiveFlushedItems,
OutputCacheItems,
OutputCacheMemoryUsage,
OutputCacheHitsTotal,
OutputCacheMissesTotal,
OutputCacheFlushedItemsTotal,
OutputCacheFlushesTotal,
w3SVCW3WPThreads,
w3SVCW3WPMaximumThreads,
w3SVCW3WPRequestsTotal,
w3SVCW3WPRequestsActive,
w3SVCW3WPActiveFlushedEntries,
w3SVCW3WPCurrentFileCacheMemoryUsage,
w3SVCW3WPMaximumFileCacheMemoryUsage,
w3SVCW3WPFileCacheFlushesTotal,
w3SVCW3WPFileCacheHitsTotal,
w3SVCW3WPFileCacheMissesTotal,
w3SVCW3WPFilesCached,
w3SVCW3WPFilesCachedTotal,
w3SVCW3WPFilesFlushedTotal,
w3SVCW3WPURICacheFlushesTotal,
w3SVCW3WPURICacheHitsTotal,
w3SVCW3WPURICacheMissesTotal,
w3SVCW3WPURIsCached,
w3SVCW3WPURIsCachedTotal,
w3SVCW3WPURIsFlushedTotal,
w3SVCW3WPMetaDataCacheHits,
w3SVCW3WPMetaDataCacheMisses,
w3SVCW3WPMetadataCached,
w3SVCW3WPMetadataCacheFlushes,
w3SVCW3WPMetadataCachedTotal,
w3SVCW3WPMetadataFlushedTotal,
w3SVCW3WPOutputCacheActiveFlushedItems,
w3SVCW3WPOutputCacheItems,
w3SVCW3WPOutputCacheMemoryUsage,
w3SVCW3WPOutputCacheHitsTotal,
w3SVCW3WPOutputCacheMissesTotal,
w3SVCW3WPOutputCacheFlushedItemsTotal,
w3SVCW3WPOutputCacheFlushesTotal,
}
if c.iisVersion.major >= 8 {
counters = append(counters, []string{
RequestErrors500,
RequestErrors503,
RequestErrors404,
RequestErrors403,
RequestErrors401,
WebSocketRequestsActive,
WebSocketConnectionAttempts,
WebSocketConnectionsAccepted,
WebSocketConnectionsRejected,
w3SVCW3WPRequestErrors500,
w3SVCW3WPRequestErrors404,
w3SVCW3WPRequestErrors403,
w3SVCW3WPRequestErrors401,
w3SVCW3WPWebSocketRequestsActive,
w3SVCW3WPWebSocketConnectionAttempts,
w3SVCW3WPWebSocketConnectionsAccepted,
w3SVCW3WPWebSocketConnectionsRejected,
}...)
}
var err error
c.perfDataCollectorW3SVCW3WP, err = perfdata.NewCollector("W3SVC_W3WP", perfdata.InstancesAll, counters)
c.w3SVCW3WPPerfDataCollector, err = perfdata.NewCollector("W3SVC_W3WP", perfdata.InstancesAll, counters)
if err != nil {
return fmt.Errorf("failed to create W3SVC_W3WP collector: %w", err)
}
// W3SVC_W3WP
c.threads = prometheus.NewDesc(
c.w3SVCW3WPThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_threads"),
"Number of threads actively processing requests in the worker process",
[]string{"app", "pid", "state"},
nil,
)
c.maximumThreads = prometheus.NewDesc(
c.w3SVCW3WPMaximumThreads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_max_threads"),
"Maximum number of threads to which the thread pool can grow as needed",
[]string{"app", "pid"},
nil,
)
c.requestsTotal = prometheus.NewDesc(
c.w3SVCW3WPRequestsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_requests_total"),
"Total number of HTTP requests served by the worker process",
[]string{"app", "pid"},
nil,
)
c.requestsActive = prometheus.NewDesc(
c.w3SVCW3WPRequestsActive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_current_requests"),
"Current number of requests being processed by the worker process",
[]string{"app", "pid"},
nil,
)
c.activeFlushedEntries = prometheus.NewDesc(
c.w3SVCW3WPActiveFlushedEntries = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_cache_active_flushed_entries"),
"Number of file handles cached in user-mode that will be closed when all current transfers complete.",
[]string{"app", "pid"},
nil,
)
c.currentFileCacheMemoryUsage = prometheus.NewDesc(
c.w3SVCW3WPCurrentFileCacheMemoryUsage = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_memory_bytes"),
"Current number of bytes used by user-mode file cache",
[]string{"app", "pid"},
nil,
)
c.maximumFileCacheMemoryUsage = prometheus.NewDesc(
c.w3SVCW3WPMaximumFileCacheMemoryUsage = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_max_memory_bytes"),
"Maximum number of bytes used by user-mode file cache",
[]string{"app", "pid"},
nil,
)
c.fileCacheFlushesTotal = prometheus.NewDesc(
c.w3SVCW3WPFileCacheFlushesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_flushes_total"),
"Total number of files removed from the user-mode cache",
[]string{"app", "pid"},
nil,
)
c.fileCacheQueriesTotal = prometheus.NewDesc(
c.w3SVCW3WPFileCacheQueriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_queries_total"),
"Total file cache queries (hits + misses)",
[]string{"app", "pid"},
nil,
)
c.fileCacheHitsTotal = prometheus.NewDesc(
c.w3SVCW3WPFileCacheHitsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_hits_total"),
"Total number of successful lookups in the user-mode file cache",
[]string{"app", "pid"},
nil,
)
c.filesCached = prometheus.NewDesc(
c.w3SVCW3WPFilesCached = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_items"),
"Current number of files whose contents are present in user-mode cache",
[]string{"app", "pid"},
nil,
)
c.filesCachedTotal = prometheus.NewDesc(
c.w3SVCW3WPFilesCachedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_items_total"),
"Total number of files whose contents were ever added to the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.filesFlushedTotal = prometheus.NewDesc(
c.w3SVCW3WPFilesFlushedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_file_cache_items_flushed_total"),
"Total number of file handles that have been removed from the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.uriCacheFlushesTotal = prometheus.NewDesc(
c.w3SVCW3WPURICacheFlushesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_flushes_total"),
"Total number of URI cache flushes (since service startup)",
[]string{"app", "pid"},
nil,
)
c.uriCacheQueriesTotal = prometheus.NewDesc(
c.w3SVCW3WPURICacheQueriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_queries_total"),
"Total number of uri cache queries (hits + misses)",
[]string{"app", "pid"},
nil,
)
c.uriCacheHitsTotal = prometheus.NewDesc(
c.w3SVCW3WPURICacheHitsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_hits_total"),
"Total number of successful lookups in the user-mode URI cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.urisCached = prometheus.NewDesc(
c.w3SVCW3WPURIsCached = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_items"),
"Number of URI information blocks currently in the user-mode cache",
[]string{"app", "pid"},
nil,
)
c.urisCachedTotal = prometheus.NewDesc(
c.w3SVCW3WPURIsCachedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_items_total"),
"Total number of URI information blocks added to the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.urisFlushedTotal = prometheus.NewDesc(
c.w3SVCW3WPURIsFlushedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_uri_cache_items_flushed_total"),
"The number of URI information blocks that have been removed from the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.metadataCached = prometheus.NewDesc(
c.w3SVCW3WPMetadataCached = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_items"),
"Number of metadata information blocks currently present in user-mode cache",
[]string{"app", "pid"},
nil,
)
c.metadataCacheFlushes = prometheus.NewDesc(
c.w3SVCW3WPMetadataCacheFlushes = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_flushes_total"),
"Total number of user-mode metadata cache flushes (since service startup)",
[]string{"app", "pid"},
nil,
)
c.metadataCacheQueriesTotal = prometheus.NewDesc(
c.w3SVCW3WPMetadataCacheQueriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_queries_total"),
"Total metadata cache queries (hits + misses)",
[]string{"app", "pid"},
nil,
)
c.metadataCacheHitsTotal = prometheus.NewDesc(
c.w3SVCW3WPMetadataCacheHitsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_hits_total"),
"Total number of successful lookups in the user-mode metadata cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.metadataCachedTotal = prometheus.NewDesc(
c.w3SVCW3WPMetadataCachedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_items_cached_total"),
"Total number of metadata information blocks added to the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.metadataFlushedTotal = prometheus.NewDesc(
c.w3SVCW3WPMetadataFlushedTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_metadata_cache_items_flushed_total"),
"Total number of metadata information blocks removed from the user-mode cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.outputCacheActiveFlushedItems = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheActiveFlushedItems = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_active_flushed_items"),
"",
[]string{"app", "pid"},
nil,
)
c.outputCacheItems = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheItems = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_items"),
"Number of items current present in output cache",
[]string{"app", "pid"},
nil,
)
c.outputCacheMemoryUsage = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheMemoryUsage = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_memory_bytes"),
"Current number of bytes used by output cache",
[]string{"app", "pid"},
nil,
)
c.outputCacheQueriesTotal = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheQueriesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_queries_total"),
"Total number of output cache queries (hits + misses)",
[]string{"app", "pid"},
nil,
)
c.outputCacheHitsTotal = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheHitsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_hits_total"),
"Total number of successful lookups in output cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.outputCacheFlushedItemsTotal = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheFlushedItemsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_items_flushed_total"),
"Total number of items flushed from output cache (since service startup)",
[]string{"app", "pid"},
nil,
)
c.outputCacheFlushesTotal = prometheus.NewDesc(
c.w3SVCW3WPOutputCacheFlushesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_output_cache_flushes_total"),
"Total number of flushes of output cache (since service startup)",
[]string{"app", "pid"},
nil,
)
// W3SVC_W3WP_IIS8
c.requestErrorsTotal = prometheus.NewDesc(
c.w3SVCW3WPRequestErrorsTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_request_errors_total"),
"Total number of requests that returned an error",
[]string{"app", "pid", "status_code"},
nil,
)
c.webSocketRequestsActive = prometheus.NewDesc(
c.w3SVCW3WPWebSocketRequestsActive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_current_websocket_requests"),
"",
[]string{"app", "pid"},
nil,
)
c.webSocketConnectionAttempts = prometheus.NewDesc(
c.w3SVCW3WPWebSocketConnectionAttempts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_attempts_total"),
"",
[]string{"app", "pid"},
nil,
)
c.webSocketConnectionsAccepted = prometheus.NewDesc(
c.w3SVCW3WPWebSocketConnectionsAccepted = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_accepted_total"),
"",
[]string{"app", "pid"},
nil,
)
c.webSocketConnectionsRejected = prometheus.NewDesc(
c.w3SVCW3WPWebSocketConnectionsRejected = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_rejected_total"),
"",
[]string{"app", "pid"},
@@ -429,7 +415,7 @@ func (c *Collector) buildW3SVCW3WP() error {
}
func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
perfData, err := c.perfDataCollectorW3SVCW3WP.Collect()
perfData, err := c.w3SVCW3WPPerfDataCollector.Collect()
if err != nil {
return fmt.Errorf("failed to collect APP_POOL_WAS metrics: %w", err)
}
@@ -456,297 +442,289 @@ func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.threads,
c.w3SVCW3WPThreads,
prometheus.GaugeValue,
app[Threads].FirstValue,
app[w3SVCW3WPThreads].FirstValue,
name,
pid,
"busy",
)
ch <- prometheus.MustNewConstMetric(
c.maximumThreads,
c.w3SVCW3WPMaximumThreads,
prometheus.CounterValue,
app[MaximumThreads].FirstValue,
app[w3SVCW3WPMaximumThreads].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.requestsTotal,
c.w3SVCW3WPRequestsTotal,
prometheus.CounterValue,
app[RequestsTotal].FirstValue,
app[w3SVCW3WPRequestsTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.requestsActive,
c.w3SVCW3WPRequestsActive,
prometheus.CounterValue,
app[RequestsActive].FirstValue,
app[w3SVCW3WPRequestsActive].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.activeFlushedEntries,
c.w3SVCW3WPActiveFlushedEntries,
prometheus.GaugeValue,
app[ActiveFlushedEntries].FirstValue,
app[w3SVCW3WPActiveFlushedEntries].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.currentFileCacheMemoryUsage,
c.w3SVCW3WPCurrentFileCacheMemoryUsage,
prometheus.GaugeValue,
app[CurrentFileCacheMemoryUsage].FirstValue,
app[w3SVCW3WPCurrentFileCacheMemoryUsage].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.maximumFileCacheMemoryUsage,
c.w3SVCW3WPMaximumFileCacheMemoryUsage,
prometheus.CounterValue,
app[MaximumFileCacheMemoryUsage].FirstValue,
app[w3SVCW3WPMaximumFileCacheMemoryUsage].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.fileCacheFlushesTotal,
c.w3SVCW3WPFileCacheFlushesTotal,
prometheus.CounterValue,
app[FileCacheFlushesTotal].FirstValue,
app[w3SVCW3WPFileCacheFlushesTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.fileCacheQueriesTotal,
c.w3SVCW3WPFileCacheQueriesTotal,
prometheus.CounterValue,
app[FileCacheHitsTotal].FirstValue+app[FileCacheMissesTotal].FirstValue,
app[w3SVCW3WPFileCacheHitsTotal].FirstValue+app[w3SVCW3WPFileCacheMissesTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.fileCacheHitsTotal,
c.w3SVCW3WPFileCacheHitsTotal,
prometheus.CounterValue,
app[FileCacheHitsTotal].FirstValue,
app[w3SVCW3WPFileCacheHitsTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.filesCached,
c.w3SVCW3WPFilesCached,
prometheus.GaugeValue,
app[FilesCached].FirstValue,
app[w3SVCW3WPFilesCached].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.filesCachedTotal,
c.w3SVCW3WPFilesCachedTotal,
prometheus.CounterValue,
app[FilesCachedTotal].FirstValue,
app[w3SVCW3WPFilesCachedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.filesFlushedTotal,
c.w3SVCW3WPFilesFlushedTotal,
prometheus.CounterValue,
app[FilesFlushedTotal].FirstValue,
app[w3SVCW3WPFilesFlushedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.uriCacheFlushesTotal,
c.w3SVCW3WPURICacheFlushesTotal,
prometheus.CounterValue,
app[URICacheFlushesTotal].FirstValue,
app[w3SVCW3WPURICacheFlushesTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.uriCacheQueriesTotal,
c.w3SVCW3WPURICacheQueriesTotal,
prometheus.CounterValue,
app[URICacheHitsTotal].FirstValue+app[URICacheMissesTotal].FirstValue,
app[w3SVCW3WPURICacheHitsTotal].FirstValue+app[w3SVCW3WPURICacheMissesTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.uriCacheHitsTotal,
c.w3SVCW3WPURICacheHitsTotal,
prometheus.CounterValue,
app[URICacheHitsTotal].FirstValue,
app[w3SVCW3WPURICacheHitsTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.urisCached,
c.w3SVCW3WPURIsCached,
prometheus.GaugeValue,
app[URIsCached].FirstValue,
app[w3SVCW3WPURIsCached].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.urisCachedTotal,
c.w3SVCW3WPURIsCachedTotal,
prometheus.CounterValue,
app[URIsCachedTotal].FirstValue,
app[w3SVCW3WPURIsCachedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.urisFlushedTotal,
c.w3SVCW3WPURIsFlushedTotal,
prometheus.CounterValue,
app[URIsFlushedTotal].FirstValue,
app[w3SVCW3WPURIsFlushedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataCached,
c.w3SVCW3WPMetadataCached,
prometheus.GaugeValue,
app[MetadataCached].FirstValue,
app[w3SVCW3WPMetadataCached].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataCacheFlushes,
c.w3SVCW3WPMetadataCacheFlushes,
prometheus.CounterValue,
app[MetadataCacheFlushes].FirstValue,
app[w3SVCW3WPMetadataCacheFlushes].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataCacheQueriesTotal,
c.w3SVCW3WPMetadataCacheQueriesTotal,
prometheus.CounterValue,
app[MetaDataCacheHits].FirstValue+app[MetaDataCacheMisses].FirstValue,
app[w3SVCW3WPMetaDataCacheHits].FirstValue+app[w3SVCW3WPMetaDataCacheMisses].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataCacheHitsTotal,
c.w3SVCW3WPMetadataCacheHitsTotal,
prometheus.CounterValue,
app[MetaDataCacheHits].FirstValue,
app[w3SVCW3WPMetaDataCacheHits].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataCachedTotal,
c.w3SVCW3WPMetadataCachedTotal,
prometheus.CounterValue,
app[MetadataCachedTotal].FirstValue,
app[w3SVCW3WPMetadataCachedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.metadataFlushedTotal,
c.w3SVCW3WPMetadataFlushedTotal,
prometheus.CounterValue,
app[MetadataFlushedTotal].FirstValue,
app[w3SVCW3WPMetadataFlushedTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheActiveFlushedItems,
c.w3SVCW3WPOutputCacheActiveFlushedItems,
prometheus.CounterValue,
app[OutputCacheActiveFlushedItems].FirstValue,
app[w3SVCW3WPOutputCacheActiveFlushedItems].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheItems,
c.w3SVCW3WPOutputCacheItems,
prometheus.CounterValue,
app[OutputCacheItems].FirstValue,
app[w3SVCW3WPOutputCacheItems].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheMemoryUsage,
c.w3SVCW3WPOutputCacheMemoryUsage,
prometheus.CounterValue,
app[OutputCacheMemoryUsage].FirstValue,
app[w3SVCW3WPOutputCacheMemoryUsage].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheQueriesTotal,
c.w3SVCW3WPOutputCacheQueriesTotal,
prometheus.CounterValue,
app[OutputCacheHitsTotal].FirstValue+app[OutputCacheMissesTotal].FirstValue,
app[w3SVCW3WPOutputCacheHitsTotal].FirstValue+app[w3SVCW3WPOutputCacheMissesTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheHitsTotal,
c.w3SVCW3WPOutputCacheHitsTotal,
prometheus.CounterValue,
app[OutputCacheHitsTotal].FirstValue,
app[w3SVCW3WPOutputCacheHitsTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheFlushedItemsTotal,
c.w3SVCW3WPOutputCacheFlushedItemsTotal,
prometheus.CounterValue,
app[OutputCacheFlushedItemsTotal].FirstValue,
app[w3SVCW3WPOutputCacheFlushedItemsTotal].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.outputCacheFlushesTotal,
c.w3SVCW3WPOutputCacheFlushesTotal,
prometheus.CounterValue,
app[OutputCacheFlushesTotal].FirstValue,
app[w3SVCW3WPOutputCacheFlushesTotal].FirstValue,
name,
pid,
)
if c.iisVersion.major >= 8 {
ch <- prometheus.MustNewConstMetric(
c.requestErrorsTotal,
c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue,
app[RequestErrors401].FirstValue,
app[w3SVCW3WPRequestErrors401].FirstValue,
name,
pid,
"401",
)
ch <- prometheus.MustNewConstMetric(
c.requestErrorsTotal,
c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue,
app[RequestErrors403].FirstValue,
app[w3SVCW3WPRequestErrors403].FirstValue,
name,
pid,
"403",
)
ch <- prometheus.MustNewConstMetric(
c.requestErrorsTotal,
c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue,
app[RequestErrors404].FirstValue,
app[w3SVCW3WPRequestErrors404].FirstValue,
name,
pid,
"404",
)
ch <- prometheus.MustNewConstMetric(
c.requestErrorsTotal,
c.w3SVCW3WPRequestErrorsTotal,
prometheus.CounterValue,
app[RequestErrors500].FirstValue,
app[w3SVCW3WPRequestErrors500].FirstValue,
name,
pid,
"500",
)
ch <- prometheus.MustNewConstMetric(
c.requestErrorsTotal,
c.w3SVCW3WPWebSocketRequestsActive,
prometheus.CounterValue,
app[RequestErrors503].FirstValue,
name,
pid,
"503",
)
ch <- prometheus.MustNewConstMetric(
c.webSocketRequestsActive,
prometheus.CounterValue,
app[WebSocketRequestsActive].FirstValue,
app[w3SVCW3WPWebSocketRequestsActive].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.webSocketConnectionAttempts,
c.w3SVCW3WPWebSocketConnectionAttempts,
prometheus.CounterValue,
app[WebSocketConnectionAttempts].FirstValue,
app[w3SVCW3WPWebSocketConnectionAttempts].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.webSocketConnectionsAccepted,
c.w3SVCW3WPWebSocketConnectionsAccepted,
prometheus.CounterValue,
app[WebSocketConnectionsAccepted].FirstValue,
app[w3SVCW3WPWebSocketConnectionsAccepted].FirstValue,
name,
pid,
)
ch <- prometheus.MustNewConstMetric(
c.webSocketConnectionsRejected,
c.w3SVCW3WPWebSocketConnectionsRejected,
prometheus.CounterValue,
app[WebSocketConnectionsRejected].FirstValue,
app[w3SVCW3WPWebSocketConnectionsRejected].FirstValue,
name,
pid,
)

View File

@@ -26,243 +26,243 @@ import (
type collectorWebService struct {
perfDataCollectorWebService *perfdata.Collector
currentAnonymousUsers *prometheus.Desc
currentBlockedAsyncIORequests *prometheus.Desc
currentCGIRequests *prometheus.Desc
currentConnections *prometheus.Desc
currentISAPIExtensionRequests *prometheus.Desc
currentNonAnonymousUsers *prometheus.Desc
serviceUptime *prometheus.Desc
totalBytesReceived *prometheus.Desc
totalBytesSent *prometheus.Desc
totalAnonymousUsers *prometheus.Desc
totalBlockedAsyncIORequests *prometheus.Desc
totalCGIRequests *prometheus.Desc
totalConnectionAttemptsAllInstances *prometheus.Desc
totalRequests *prometheus.Desc
totalFilesReceived *prometheus.Desc
totalFilesSent *prometheus.Desc
totalISAPIExtensionRequests *prometheus.Desc
totalLockedErrors *prometheus.Desc
totalLogonAttempts *prometheus.Desc
totalNonAnonymousUsers *prometheus.Desc
totalNotFoundErrors *prometheus.Desc
totalRejectedAsyncIORequests *prometheus.Desc
webServiceCurrentAnonymousUsers *prometheus.Desc
webServiceCurrentBlockedAsyncIORequests *prometheus.Desc
webServiceCurrentCGIRequests *prometheus.Desc
webServiceCurrentConnections *prometheus.Desc
webServiceCurrentISAPIExtensionRequests *prometheus.Desc
webServiceCurrentNonAnonymousUsers *prometheus.Desc
webServiceServiceUptime *prometheus.Desc
webServiceTotalBytesReceived *prometheus.Desc
webServiceTotalBytesSent *prometheus.Desc
webServiceTotalAnonymousUsers *prometheus.Desc
webServiceTotalBlockedAsyncIORequests *prometheus.Desc
webServiceTotalCGIRequests *prometheus.Desc
webServiceTotalConnectionAttemptsAllInstances *prometheus.Desc
webServiceTotalRequests *prometheus.Desc
webServiceTotalFilesReceived *prometheus.Desc
webServiceTotalFilesSent *prometheus.Desc
webServiceTotalISAPIExtensionRequests *prometheus.Desc
webServiceTotalLockedErrors *prometheus.Desc
webServiceTotalLogonAttempts *prometheus.Desc
webServiceTotalNonAnonymousUsers *prometheus.Desc
webServiceTotalNotFoundErrors *prometheus.Desc
webServiceTotalRejectedAsyncIORequests *prometheus.Desc
}
const (
CurrentAnonymousUsers = "Current Anonymous Users"
CurrentBlockedAsyncIORequests = "Current Blocked Async I/O Requests"
CurrentCGIRequests = "Current CGI Requests"
CurrentConnections = "Current Connections"
CurrentISAPIExtensionRequests = "Current ISAPI Extension Requests"
CurrentNonAnonymousUsers = "Current NonAnonymous Users"
ServiceUptime = "Service Uptime"
TotalBytesReceived = "Total Bytes Received"
TotalBytesSent = "Total Bytes Sent"
TotalAnonymousUsers = "Total Anonymous Users"
TotalBlockedAsyncIORequests = "Total Blocked Async I/O Requests"
TotalCGIRequests = "Total CGI Requests"
TotalConnectionAttemptsAllInstances = "Total Connection Attempts (all instances)"
TotalFilesReceived = "Total Files Received"
TotalFilesSent = "Total Files Sent"
TotalISAPIExtensionRequests = "Total ISAPI Extension Requests"
TotalLockedErrors = "Total Locked Errors"
TotalLogonAttempts = "Total Logon Attempts"
TotalNonAnonymousUsers = "Total NonAnonymous Users"
TotalNotFoundErrors = "Total Not Found Errors"
TotalRejectedAsyncIORequests = "Total Rejected Async I/O Requests"
TotalCopyRequests = "Total Copy Requests"
TotalDeleteRequests = "Total Delete Requests"
TotalGetRequests = "Total Get Requests"
TotalHeadRequests = "Total Head Requests"
TotalLockRequests = "Total Lock Requests"
TotalMkcolRequests = "Total Mkcol Requests"
TotalMoveRequests = "Total Move Requests"
TotalOptionsRequests = "Total Options Requests"
TotalOtherRequests = "Total Other Request Methods"
TotalPostRequests = "Total Post Requests"
TotalPropfindRequests = "Total Propfind Requests"
TotalProppatchRequests = "Total Proppatch Requests"
TotalPutRequests = "Total Put Requests"
TotalSearchRequests = "Total Search Requests"
TotalTraceRequests = "Total Trace Requests"
TotalUnlockRequests = "Total Unlock Requests"
webServiceCurrentAnonymousUsers = "Current Anonymous Users"
webServiceCurrentBlockedAsyncIORequests = "Current Blocked Async I/O Requests"
webServiceCurrentCGIRequests = "Current CGI Requests"
webServiceCurrentConnections = "Current Connections"
webServiceCurrentISAPIExtensionRequests = "Current ISAPI Extension Requests"
webServiceCurrentNonAnonymousUsers = "Current NonAnonymous Users"
webServiceServiceUptime = "Service Uptime"
webServiceTotalBytesReceived = "Total Bytes Received"
webServiceTotalBytesSent = "Total Bytes Sent"
webServiceTotalAnonymousUsers = "Total Anonymous Users"
webServiceTotalBlockedAsyncIORequests = "Total Blocked Async I/O Requests"
webServiceTotalCGIRequests = "Total CGI Requests"
webServiceTotalConnectionAttemptsAllInstances = "Total Connection Attempts (all instances)"
webServiceTotalFilesReceived = "Total Files Received"
webServiceTotalFilesSent = "Total Files Sent"
webServiceTotalISAPIExtensionRequests = "Total ISAPI Extension Requests"
webServiceTotalLockedErrors = "Total Locked Errors"
webServiceTotalLogonAttempts = "Total Logon Attempts"
webServiceTotalNonAnonymousUsers = "Total NonAnonymous Users"
webServiceTotalNotFoundErrors = "Total Not Found Errors"
webServiceTotalRejectedAsyncIORequests = "Total Rejected Async I/O Requests"
webServiceTotalCopyRequests = "Total Copy Requests"
webServiceTotalDeleteRequests = "Total Delete Requests"
webServiceTotalGetRequests = "Total Get Requests"
webServiceTotalHeadRequests = "Total Head Requests"
webServiceTotalLockRequests = "Total Lock Requests"
webServiceTotalMkcolRequests = "Total Mkcol Requests"
webServiceTotalMoveRequests = "Total Move Requests"
webServiceTotalOptionsRequests = "Total Options Requests"
webServiceTotalOtherRequests = "Total Other Request Methods"
webServiceTotalPostRequests = "Total Post Requests"
webServiceTotalPropfindRequests = "Total Propfind Requests"
webServiceTotalProppatchRequests = "Total Proppatch Requests"
webServiceTotalPutRequests = "Total Put Requests"
webServiceTotalSearchRequests = "Total Search Requests"
webServiceTotalTraceRequests = "Total Trace Requests"
webServiceTotalUnlockRequests = "Total Unlock Requests"
)
func (c *Collector) buildWebService() error {
var err error
c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service", perfdata.InstancesAll, []string{
CurrentAnonymousUsers,
CurrentBlockedAsyncIORequests,
CurrentCGIRequests,
CurrentConnections,
CurrentISAPIExtensionRequests,
CurrentNonAnonymousUsers,
ServiceUptime,
TotalBytesReceived,
TotalBytesSent,
TotalAnonymousUsers,
TotalBlockedAsyncIORequests,
TotalCGIRequests,
TotalConnectionAttemptsAllInstances,
TotalFilesReceived,
TotalFilesSent,
TotalISAPIExtensionRequests,
TotalLockedErrors,
TotalLogonAttempts,
TotalNonAnonymousUsers,
TotalNotFoundErrors,
TotalRejectedAsyncIORequests,
TotalCopyRequests,
TotalDeleteRequests,
TotalGetRequests,
TotalHeadRequests,
TotalLockRequests,
TotalMkcolRequests,
TotalMoveRequests,
TotalOptionsRequests,
TotalOtherRequests,
TotalPostRequests,
TotalPropfindRequests,
TotalProppatchRequests,
TotalPutRequests,
TotalSearchRequests,
TotalTraceRequests,
TotalUnlockRequests,
webServiceCurrentAnonymousUsers,
webServiceCurrentBlockedAsyncIORequests,
webServiceCurrentCGIRequests,
webServiceCurrentConnections,
webServiceCurrentISAPIExtensionRequests,
webServiceCurrentNonAnonymousUsers,
webServiceServiceUptime,
webServiceTotalBytesReceived,
webServiceTotalBytesSent,
webServiceTotalAnonymousUsers,
webServiceTotalBlockedAsyncIORequests,
webServiceTotalCGIRequests,
webServiceTotalConnectionAttemptsAllInstances,
webServiceTotalFilesReceived,
webServiceTotalFilesSent,
webServiceTotalISAPIExtensionRequests,
webServiceTotalLockedErrors,
webServiceTotalLogonAttempts,
webServiceTotalNonAnonymousUsers,
webServiceTotalNotFoundErrors,
webServiceTotalRejectedAsyncIORequests,
webServiceTotalCopyRequests,
webServiceTotalDeleteRequests,
webServiceTotalGetRequests,
webServiceTotalHeadRequests,
webServiceTotalLockRequests,
webServiceTotalMkcolRequests,
webServiceTotalMoveRequests,
webServiceTotalOptionsRequests,
webServiceTotalOtherRequests,
webServiceTotalPostRequests,
webServiceTotalPropfindRequests,
webServiceTotalProppatchRequests,
webServiceTotalPutRequests,
webServiceTotalSearchRequests,
webServiceTotalTraceRequests,
webServiceTotalUnlockRequests,
})
if err != nil {
return fmt.Errorf("failed to create Web Service collector: %w", err)
}
c.currentAnonymousUsers = prometheus.NewDesc(
c.webServiceCurrentAnonymousUsers = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_anonymous_users"),
"Number of users who currently have an anonymous connection using the Web service (WebService.CurrentAnonymousUsers)",
[]string{"site"},
nil,
)
c.currentBlockedAsyncIORequests = prometheus.NewDesc(
c.webServiceCurrentBlockedAsyncIORequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_blocked_async_io_requests"),
"Current requests temporarily blocked due to bandwidth throttling settings (WebService.CurrentBlockedAsyncIORequests)",
[]string{"site"},
nil,
)
c.currentCGIRequests = prometheus.NewDesc(
c.webServiceCurrentCGIRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_cgi_requests"),
"Current number of CGI requests being simultaneously processed by the Web service (WebService.CurrentCGIRequests)",
[]string{"site"},
nil,
)
c.currentConnections = prometheus.NewDesc(
c.webServiceCurrentConnections = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_connections"),
"Current number of connections established with the Web service (WebService.CurrentConnections)",
[]string{"site"},
nil,
)
c.currentISAPIExtensionRequests = prometheus.NewDesc(
c.webServiceCurrentISAPIExtensionRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_isapi_extension_requests"),
"Current number of ISAPI requests being simultaneously processed by the Web service (WebService.CurrentISAPIExtensionRequests)",
[]string{"site"},
nil,
)
c.currentNonAnonymousUsers = prometheus.NewDesc(
c.webServiceCurrentNonAnonymousUsers = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "current_non_anonymous_users"),
"Number of users who currently have a non-anonymous connection using the Web service (WebService.CurrentNonAnonymousUsers)",
[]string{"site"},
nil,
)
c.serviceUptime = prometheus.NewDesc(
c.webServiceServiceUptime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "service_uptime"),
"Number of seconds the WebService is up (WebService.ServiceUptime)",
[]string{"site"},
nil,
)
c.totalBytesReceived = prometheus.NewDesc(
c.webServiceTotalBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "received_bytes_total"),
"Number of data bytes that have been received by the Web service (WebService.TotalBytesReceived)",
[]string{"site"},
nil,
)
c.totalBytesSent = prometheus.NewDesc(
c.webServiceTotalBytesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "sent_bytes_total"),
"Number of data bytes that have been sent by the Web service (WebService.TotalBytesSent)",
[]string{"site"},
nil,
)
c.totalAnonymousUsers = prometheus.NewDesc(
c.webServiceTotalAnonymousUsers = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "anonymous_users_total"),
"Total number of users who established an anonymous connection with the Web service (WebService.TotalAnonymousUsers)",
[]string{"site"},
nil,
)
c.totalBlockedAsyncIORequests = prometheus.NewDesc(
c.webServiceTotalBlockedAsyncIORequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "blocked_async_io_requests_total"),
"Total requests temporarily blocked due to bandwidth throttling settings (WebService.TotalBlockedAsyncIORequests)",
[]string{"site"},
nil,
)
c.totalCGIRequests = prometheus.NewDesc(
c.webServiceTotalCGIRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cgi_requests_total"),
"Total CGI requests is the total number of CGI requests (WebService.TotalCGIRequests)",
[]string{"site"},
nil,
)
c.totalConnectionAttemptsAllInstances = prometheus.NewDesc(
c.webServiceTotalConnectionAttemptsAllInstances = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "connection_attempts_all_instances_total"),
"Number of connections that have been attempted using the Web service (WebService.TotalConnectionAttemptsAllInstances)",
[]string{"site"},
nil,
)
c.totalRequests = prometheus.NewDesc(
c.webServiceTotalRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "requests_total"),
"Number of HTTP requests (WebService.TotalRequests)",
[]string{"site", "method"},
nil,
)
c.totalFilesReceived = prometheus.NewDesc(
c.webServiceTotalFilesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "files_received_total"),
"Number of files received by the Web service (WebService.TotalFilesReceived)",
[]string{"site"},
nil,
)
c.totalFilesSent = prometheus.NewDesc(
c.webServiceTotalFilesSent = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "files_sent_total"),
"Number of files sent by the Web service (WebService.TotalFilesSent)",
[]string{"site"},
nil,
)
c.totalISAPIExtensionRequests = prometheus.NewDesc(
c.webServiceTotalISAPIExtensionRequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "ipapi_extension_requests_total"),
"ISAPI Extension Requests received (WebService.TotalISAPIExtensionRequests)",
[]string{"site"},
nil,
)
c.totalLockedErrors = prometheus.NewDesc(
c.webServiceTotalLockedErrors = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "locked_errors_total"),
"Number of requests that couldn't be satisfied by the server because the requested resource was locked (WebService.TotalLockedErrors)",
[]string{"site"},
nil,
)
c.totalLogonAttempts = prometheus.NewDesc(
c.webServiceTotalLogonAttempts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "logon_attempts_total"),
"Number of logons attempts to the Web Service (WebService.TotalLogonAttempts)",
[]string{"site"},
nil,
)
c.totalNonAnonymousUsers = prometheus.NewDesc(
c.webServiceTotalNonAnonymousUsers = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "non_anonymous_users_total"),
"Number of users who established a non-anonymous connection with the Web service (WebService.TotalNonAnonymousUsers)",
[]string{"site"},
nil,
)
c.totalNotFoundErrors = prometheus.NewDesc(
c.webServiceTotalNotFoundErrors = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "not_found_errors_total"),
"Number of requests that couldn't be satisfied by the server because the requested document could not be found (WebService.TotalNotFoundErrors)",
[]string{"site"},
nil,
)
c.totalRejectedAsyncIORequests = prometheus.NewDesc(
c.webServiceTotalRejectedAsyncIORequests = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "rejected_async_io_requests_total"),
"Requests rejected due to bandwidth throttling settings (WebService.TotalRejectedAsyncIORequests)",
[]string{"site"},
@@ -286,240 +286,240 @@ func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
}
ch <- prometheus.MustNewConstMetric(
c.currentAnonymousUsers,
c.webServiceCurrentAnonymousUsers,
prometheus.GaugeValue,
app[CurrentAnonymousUsers].FirstValue,
app[webServiceCurrentAnonymousUsers].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.currentBlockedAsyncIORequests,
c.webServiceCurrentBlockedAsyncIORequests,
prometheus.GaugeValue,
app[CurrentBlockedAsyncIORequests].FirstValue,
app[webServiceCurrentBlockedAsyncIORequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.currentCGIRequests,
c.webServiceCurrentCGIRequests,
prometheus.GaugeValue,
app[CurrentCGIRequests].FirstValue,
app[webServiceCurrentCGIRequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.currentConnections,
c.webServiceCurrentConnections,
prometheus.GaugeValue,
app[CurrentConnections].FirstValue,
app[webServiceCurrentConnections].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.currentISAPIExtensionRequests,
c.webServiceCurrentISAPIExtensionRequests,
prometheus.GaugeValue,
app[CurrentISAPIExtensionRequests].FirstValue,
app[webServiceCurrentISAPIExtensionRequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.currentNonAnonymousUsers,
c.webServiceCurrentNonAnonymousUsers,
prometheus.GaugeValue,
app[CurrentNonAnonymousUsers].FirstValue,
app[webServiceCurrentNonAnonymousUsers].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.serviceUptime,
c.webServiceServiceUptime,
prometheus.GaugeValue,
app[ServiceUptime].FirstValue,
app[webServiceServiceUptime].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalBytesReceived,
c.webServiceTotalBytesReceived,
prometheus.CounterValue,
app[TotalBytesReceived].FirstValue,
app[webServiceTotalBytesReceived].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalBytesSent,
c.webServiceTotalBytesSent,
prometheus.CounterValue,
app[TotalBytesSent].FirstValue,
app[webServiceTotalBytesSent].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalAnonymousUsers,
c.webServiceTotalAnonymousUsers,
prometheus.CounterValue,
app[TotalAnonymousUsers].FirstValue,
app[webServiceTotalAnonymousUsers].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalBlockedAsyncIORequests,
c.webServiceTotalBlockedAsyncIORequests,
prometheus.CounterValue,
app[TotalBlockedAsyncIORequests].FirstValue,
app[webServiceTotalBlockedAsyncIORequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalCGIRequests,
c.webServiceTotalCGIRequests,
prometheus.CounterValue,
app[TotalCGIRequests].FirstValue,
app[webServiceTotalCGIRequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalConnectionAttemptsAllInstances,
c.webServiceTotalConnectionAttemptsAllInstances,
prometheus.CounterValue,
app[TotalConnectionAttemptsAllInstances].FirstValue,
app[webServiceTotalConnectionAttemptsAllInstances].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalFilesReceived,
c.webServiceTotalFilesReceived,
prometheus.CounterValue,
app[TotalFilesReceived].FirstValue,
app[webServiceTotalFilesReceived].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalFilesSent,
c.webServiceTotalFilesSent,
prometheus.CounterValue,
app[TotalFilesSent].FirstValue,
app[webServiceTotalFilesSent].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalISAPIExtensionRequests,
c.webServiceTotalISAPIExtensionRequests,
prometheus.CounterValue,
app[TotalISAPIExtensionRequests].FirstValue,
app[webServiceTotalISAPIExtensionRequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalLockedErrors,
c.webServiceTotalLockedErrors,
prometheus.CounterValue,
app[TotalLockedErrors].FirstValue,
app[webServiceTotalLockedErrors].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalLogonAttempts,
c.webServiceTotalLogonAttempts,
prometheus.CounterValue,
app[TotalLogonAttempts].FirstValue,
app[webServiceTotalLogonAttempts].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalNonAnonymousUsers,
c.webServiceTotalNonAnonymousUsers,
prometheus.CounterValue,
app[TotalNonAnonymousUsers].FirstValue,
app[webServiceTotalNonAnonymousUsers].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalNotFoundErrors,
c.webServiceTotalNotFoundErrors,
prometheus.CounterValue,
app[TotalNotFoundErrors].FirstValue,
app[webServiceTotalNotFoundErrors].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalRejectedAsyncIORequests,
c.webServiceTotalRejectedAsyncIORequests,
prometheus.CounterValue,
app[TotalRejectedAsyncIORequests].FirstValue,
app[webServiceTotalRejectedAsyncIORequests].FirstValue,
name,
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalOtherRequests].FirstValue,
app[webServiceTotalOtherRequests].FirstValue,
name,
"other",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalCopyRequests].FirstValue,
app[webServiceTotalCopyRequests].FirstValue,
name,
"COPY",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalDeleteRequests].FirstValue,
app[webServiceTotalDeleteRequests].FirstValue,
name,
"DELETE",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalGetRequests].FirstValue,
app[webServiceTotalGetRequests].FirstValue,
name,
"GET",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalHeadRequests].FirstValue,
app[webServiceTotalHeadRequests].FirstValue,
name,
"HEAD",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalLockRequests].FirstValue,
app[webServiceTotalLockRequests].FirstValue,
name,
"LOCK",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalMkcolRequests].FirstValue,
app[webServiceTotalMkcolRequests].FirstValue,
name,
"MKCOL",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalMoveRequests].FirstValue,
app[webServiceTotalMoveRequests].FirstValue,
name,
"MOVE",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalOptionsRequests].FirstValue,
app[webServiceTotalOptionsRequests].FirstValue,
name,
"OPTIONS",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalPostRequests].FirstValue,
app[webServiceTotalPostRequests].FirstValue,
name,
"POST",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalPropfindRequests].FirstValue,
app[webServiceTotalPropfindRequests].FirstValue,
name,
"PROPFIND",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalProppatchRequests].FirstValue,
app[webServiceTotalProppatchRequests].FirstValue,
name,
"PROPPATCH",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalPutRequests].FirstValue,
app[webServiceTotalPutRequests].FirstValue,
name,
"PUT",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalSearchRequests].FirstValue,
app[webServiceTotalSearchRequests].FirstValue,
name,
"SEARCH",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalTraceRequests].FirstValue,
app[webServiceTotalTraceRequests].FirstValue,
name,
"TRACE",
)
ch <- prometheus.MustNewConstMetric(
c.totalRequests,
c.webServiceTotalRequests,
prometheus.CounterValue,
app[TotalUnlockRequests].FirstValue,
app[webServiceTotalUnlockRequests].FirstValue,
name,
"UNLOCK",
)

View File

@@ -24,7 +24,7 @@ import (
)
type collectorWebServiceCache struct {
perfDataCollectorWebServiceCache *perfdata.Collector
serviceCachePerfDataCollector *perfdata.Collector
serviceCacheActiveFlushedEntries *prometheus.Desc
@@ -61,80 +61,80 @@ type collectorWebServiceCache struct {
}
const (
ServiceCacheActiveFlushedEntries = "Active Flushed Entries"
ServiceCacheCurrentFileCacheMemoryUsage = "Current File Cache Memory Usage"
ServiceCacheMaximumFileCacheMemoryUsage = "Maximum File Cache Memory Usage"
ServiceCacheFileCacheFlushesTotal = "File Cache Flushes"
ServiceCacheFileCacheHitsTotal = "File Cache Hits"
ServiceCacheFileCacheMissesTotal = "File Cache Misses"
ServiceCacheFilesCached = "Current Files Cached"
ServiceCacheFilesCachedTotal = "Total Files Cached"
ServiceCacheFilesFlushedTotal = "Total Flushed Files"
ServiceCacheURICacheFlushesTotal = "Total Flushed URIs"
ServiceCacheURICacheFlushesTotalKernel = "Total Flushed URIs"
ServiceCacheURIsFlushedTotalKernel = "Kernel: Total Flushed URIs"
ServiceCacheURICacheHitsTotal = "URI Cache Hits"
ServiceCacheURICacheHitsTotalKernel = "Kernel: URI Cache Hits"
ServiceCacheURICacheMissesTotal = "URI Cache Misses"
ServiceCacheURICacheMissesTotalKernel = "Kernel: URI Cache Misses"
ServiceCacheURIsCached = "Current URIs Cached"
ServiceCacheURIsCachedKernel = "Kernel: Current URIs Cached"
ServiceCacheURIsCachedTotal = "Total URIs Cached"
ServiceCacheURIsCachedTotalKernel = "Total URIs Cached"
ServiceCacheURIsFlushedTotal = "Total Flushed URIs"
ServiceCacheMetaDataCacheHits = "Metadata Cache Hits"
ServiceCacheMetaDataCacheMisses = "Metadata Cache Misses"
ServiceCacheMetadataCached = "Current Metadata Cached"
ServiceCacheMetadataCacheFlushes = "Metadata Cache Flushes"
ServiceCacheMetadataCachedTotal = "Total Metadata Cached"
ServiceCacheMetadataFlushedTotal = "Total Flushed Metadata"
ServiceCacheOutputCacheActiveFlushedItems = "Output Cache Current Flushed Items"
ServiceCacheOutputCacheItems = "Output Cache Current Items"
ServiceCacheOutputCacheMemoryUsage = "Output Cache Current Memory Usage"
ServiceCacheOutputCacheHitsTotal = "Output Cache Total Hits"
ServiceCacheOutputCacheMissesTotal = "Output Cache Total Misses"
ServiceCacheOutputCacheFlushedItemsTotal = "Output Cache Total Flushed Items"
ServiceCacheOutputCacheFlushesTotal = "Output Cache Total Flushes"
serviceCacheActiveFlushedEntries = "Active Flushed Entries"
serviceCacheCurrentFileCacheMemoryUsage = "Current File Cache Memory Usage"
serviceCacheMaximumFileCacheMemoryUsage = "Maximum File Cache Memory Usage"
serviceCacheFileCacheFlushesTotal = "File Cache Flushes"
serviceCacheFileCacheHitsTotal = "File Cache Hits"
serviceCacheFileCacheMissesTotal = "File Cache Misses"
serviceCacheFilesCached = "Current Files Cached"
serviceCacheFilesCachedTotal = "Total Files Cached"
serviceCacheFilesFlushedTotal = "Total Flushed Files"
serviceCacheURICacheFlushesTotal = "Total Flushed URIs"
serviceCacheURICacheFlushesTotalKernel = "Total Flushed URIs"
serviceCacheURIsFlushedTotalKernel = "Kernel: Total Flushed URIs"
serviceCacheURICacheHitsTotal = "URI Cache Hits"
serviceCacheURICacheHitsTotalKernel = "Kernel: URI Cache Hits"
serviceCacheURICacheMissesTotal = "URI Cache Misses"
serviceCacheURICacheMissesTotalKernel = "Kernel: URI Cache Misses"
serviceCacheURIsCached = "Current URIs Cached"
serviceCacheURIsCachedKernel = "Kernel: Current URIs Cached"
serviceCacheURIsCachedTotal = "Total URIs Cached"
serviceCacheURIsCachedTotalKernel = "Total URIs Cached"
serviceCacheURIsFlushedTotal = "Total Flushed URIs"
serviceCacheMetaDataCacheHits = "Metadata Cache Hits"
serviceCacheMetaDataCacheMisses = "Metadata Cache Misses"
serviceCacheMetadataCached = "Current Metadata Cached"
serviceCacheMetadataCacheFlushes = "Metadata Cache Flushes"
serviceCacheMetadataCachedTotal = "Total Metadata Cached"
serviceCacheMetadataFlushedTotal = "Total Flushed Metadata"
serviceCacheOutputCacheActiveFlushedItems = "Output Cache Current Flushed Items"
serviceCacheOutputCacheItems = "Output Cache Current Items"
serviceCacheOutputCacheMemoryUsage = "Output Cache Current Memory Usage"
serviceCacheOutputCacheHitsTotal = "Output Cache Total Hits"
serviceCacheOutputCacheMissesTotal = "Output Cache Total Misses"
serviceCacheOutputCacheFlushedItemsTotal = "Output Cache Total Flushed Items"
serviceCacheOutputCacheFlushesTotal = "Output Cache Total Flushes"
)
func (c *Collector) buildWebServiceCache() error {
var err error
c.perfDataCollectorWebService, err = perfdata.NewCollector("Web Service Cache", perfdata.InstancesAll, []string{
ServiceCacheActiveFlushedEntries,
ServiceCacheCurrentFileCacheMemoryUsage,
ServiceCacheMaximumFileCacheMemoryUsage,
ServiceCacheFileCacheFlushesTotal,
ServiceCacheFileCacheHitsTotal,
ServiceCacheFileCacheMissesTotal,
ServiceCacheFilesCached,
ServiceCacheFilesCachedTotal,
ServiceCacheFilesFlushedTotal,
ServiceCacheURICacheFlushesTotal,
ServiceCacheURICacheFlushesTotalKernel,
ServiceCacheURIsFlushedTotalKernel,
ServiceCacheURICacheHitsTotal,
ServiceCacheURICacheHitsTotalKernel,
ServiceCacheURICacheMissesTotal,
ServiceCacheURICacheMissesTotalKernel,
ServiceCacheURIsCached,
ServiceCacheURIsCachedKernel,
ServiceCacheURIsCachedTotal,
ServiceCacheURIsCachedTotalKernel,
ServiceCacheURIsFlushedTotal,
ServiceCacheMetaDataCacheHits,
ServiceCacheMetaDataCacheMisses,
ServiceCacheMetadataCached,
ServiceCacheMetadataCacheFlushes,
ServiceCacheMetadataCachedTotal,
ServiceCacheMetadataFlushedTotal,
ServiceCacheOutputCacheActiveFlushedItems,
ServiceCacheOutputCacheItems,
ServiceCacheOutputCacheMemoryUsage,
ServiceCacheOutputCacheHitsTotal,
ServiceCacheOutputCacheMissesTotal,
ServiceCacheOutputCacheFlushedItemsTotal,
ServiceCacheOutputCacheFlushesTotal,
serviceCacheActiveFlushedEntries,
serviceCacheCurrentFileCacheMemoryUsage,
serviceCacheMaximumFileCacheMemoryUsage,
serviceCacheFileCacheFlushesTotal,
serviceCacheFileCacheHitsTotal,
serviceCacheFileCacheMissesTotal,
serviceCacheFilesCached,
serviceCacheFilesCachedTotal,
serviceCacheFilesFlushedTotal,
serviceCacheURICacheFlushesTotal,
serviceCacheURICacheFlushesTotalKernel,
serviceCacheURIsFlushedTotalKernel,
serviceCacheURICacheHitsTotal,
serviceCacheURICacheHitsTotalKernel,
serviceCacheURICacheMissesTotal,
serviceCacheURICacheMissesTotalKernel,
serviceCacheURIsCached,
serviceCacheURIsCachedKernel,
serviceCacheURIsCachedTotal,
serviceCacheURIsCachedTotalKernel,
serviceCacheURIsFlushedTotal,
serviceCacheMetaDataCacheHits,
serviceCacheMetaDataCacheMisses,
serviceCacheMetadataCached,
serviceCacheMetadataCacheFlushes,
serviceCacheMetadataCachedTotal,
serviceCacheMetadataFlushedTotal,
serviceCacheOutputCacheActiveFlushedItems,
serviceCacheOutputCacheItems,
serviceCacheOutputCacheMemoryUsage,
serviceCacheOutputCacheHitsTotal,
serviceCacheOutputCacheMissesTotal,
serviceCacheOutputCacheFlushedItemsTotal,
serviceCacheOutputCacheFlushesTotal,
})
if err != nil {
return fmt.Errorf("failed to create Web Service Cache collector: %w", err)
@@ -329,184 +329,184 @@ func (c *Collector) collectWebServiceCache(ch chan<- prometheus.Metric) error {
ch <- prometheus.MustNewConstMetric(
c.serviceCacheActiveFlushedEntries,
prometheus.GaugeValue,
app[ServiceCacheActiveFlushedEntries].FirstValue,
app[serviceCacheActiveFlushedEntries].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheCurrentFileCacheMemoryUsage,
prometheus.GaugeValue,
app[ServiceCacheCurrentFileCacheMemoryUsage].FirstValue,
app[serviceCacheCurrentFileCacheMemoryUsage].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMaximumFileCacheMemoryUsage,
prometheus.CounterValue,
app[ServiceCacheMaximumFileCacheMemoryUsage].FirstValue,
app[serviceCacheMaximumFileCacheMemoryUsage].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheFlushesTotal,
prometheus.CounterValue,
app[ServiceCacheFileCacheFlushesTotal].FirstValue,
app[serviceCacheFileCacheFlushesTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheQueriesTotal,
prometheus.CounterValue,
app[ServiceCacheFileCacheHitsTotal].FirstValue+app[ServiceCacheFileCacheMissesTotal].FirstValue,
app[serviceCacheFileCacheHitsTotal].FirstValue+app[serviceCacheFileCacheMissesTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFileCacheHitsTotal,
prometheus.CounterValue,
app[ServiceCacheFileCacheHitsTotal].FirstValue,
app[serviceCacheFileCacheHitsTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesCached,
prometheus.GaugeValue,
app[ServiceCacheFilesCached].FirstValue,
app[serviceCacheFilesCached].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesCachedTotal,
prometheus.CounterValue,
app[ServiceCacheFilesCachedTotal].FirstValue,
app[serviceCacheFilesCachedTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheFilesFlushedTotal,
prometheus.CounterValue,
app[ServiceCacheFilesFlushedTotal].FirstValue,
app[serviceCacheFilesFlushedTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheFlushesTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheFlushesTotal].FirstValue,
app[serviceCacheURICacheFlushesTotal].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheFlushesTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheFlushesTotalKernel].FirstValue,
app[serviceCacheURICacheFlushesTotalKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheQueriesTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheHitsTotal].FirstValue+app[ServiceCacheURICacheMissesTotal].FirstValue,
app[serviceCacheURICacheHitsTotal].FirstValue+app[serviceCacheURICacheMissesTotal].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheQueriesTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheHitsTotalKernel].FirstValue+app[ServiceCacheURICacheMissesTotalKernel].FirstValue,
app[serviceCacheURICacheHitsTotalKernel].FirstValue+app[serviceCacheURICacheMissesTotalKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheHitsTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheHitsTotal].FirstValue,
app[serviceCacheURICacheHitsTotal].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURICacheHitsTotal,
prometheus.CounterValue,
app[ServiceCacheURICacheHitsTotalKernel].FirstValue,
app[serviceCacheURICacheHitsTotalKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCached,
prometheus.GaugeValue,
app[ServiceCacheURIsCached].FirstValue,
app[serviceCacheURIsCached].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCached,
prometheus.GaugeValue,
app[ServiceCacheURIsCachedKernel].FirstValue,
app[serviceCacheURIsCachedKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCachedTotal,
prometheus.CounterValue,
app[ServiceCacheURIsCachedTotal].FirstValue,
app[serviceCacheURIsCachedTotal].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsCachedTotal,
prometheus.CounterValue,
app[ServiceCacheURIsCachedTotalKernel].FirstValue,
app[serviceCacheURIsCachedTotalKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsFlushedTotal,
prometheus.CounterValue,
app[ServiceCacheURIsFlushedTotal].FirstValue,
app[serviceCacheURIsFlushedTotal].FirstValue,
"user",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheURIsFlushedTotal,
prometheus.CounterValue,
app[ServiceCacheURIsFlushedTotalKernel].FirstValue,
app[serviceCacheURIsFlushedTotalKernel].FirstValue,
"kernel",
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCached,
prometheus.GaugeValue,
app[ServiceCacheMetadataCached].FirstValue,
app[serviceCacheMetadataCached].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheFlushes,
prometheus.CounterValue,
app[ServiceCacheMetadataCacheFlushes].FirstValue,
app[serviceCacheMetadataCacheFlushes].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheQueriesTotal,
prometheus.CounterValue,
app[ServiceCacheMetaDataCacheHits].FirstValue+app[ServiceCacheMetaDataCacheMisses].FirstValue,
app[serviceCacheMetaDataCacheHits].FirstValue+app[serviceCacheMetaDataCacheMisses].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCacheHitsTotal,
prometheus.CounterValue,
0, // app[ServiceCacheMetadataCacheHitsTotal].FirstValue,
0, // app[serviceCacheMetadataCacheHitsTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataCachedTotal,
prometheus.CounterValue,
app[ServiceCacheMetadataCachedTotal].FirstValue,
app[serviceCacheMetadataCachedTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheMetadataFlushedTotal,
prometheus.CounterValue,
app[ServiceCacheMetadataFlushedTotal].FirstValue,
app[serviceCacheMetadataFlushedTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheActiveFlushedItems,
prometheus.CounterValue,
app[ServiceCacheOutputCacheActiveFlushedItems].FirstValue,
app[serviceCacheOutputCacheActiveFlushedItems].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheItems,
prometheus.CounterValue,
app[ServiceCacheOutputCacheItems].FirstValue,
app[serviceCacheOutputCacheItems].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheMemoryUsage,
prometheus.CounterValue,
app[ServiceCacheOutputCacheMemoryUsage].FirstValue,
app[serviceCacheOutputCacheMemoryUsage].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheQueriesTotal,
prometheus.CounterValue,
app[ServiceCacheOutputCacheHitsTotal].FirstValue+app[ServiceCacheOutputCacheMissesTotal].FirstValue,
app[serviceCacheOutputCacheHitsTotal].FirstValue+app[serviceCacheOutputCacheMissesTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheHitsTotal,
prometheus.CounterValue,
app[ServiceCacheOutputCacheHitsTotal].FirstValue,
app[serviceCacheOutputCacheHitsTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheFlushedItemsTotal,
prometheus.CounterValue,
app[ServiceCacheOutputCacheFlushedItemsTotal].FirstValue,
app[serviceCacheOutputCacheFlushedItemsTotal].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.serviceCacheOutputCacheFlushesTotal,
prometheus.CounterValue,
app[ServiceCacheOutputCacheFlushesTotal].FirstValue,
app[serviceCacheOutputCacheFlushesTotal].FirstValue,
)
}