lib/fluent/plugin/monitoring.rb in fluent-plugin-google-cloud-0.7.15 vs lib/fluent/plugin/monitoring.rb in fluent-plugin-google-cloud-0.7.16
- old
+ new
@@ -14,11 +14,11 @@
module Monitoring
# Base class for the monitoring registry.
class BaseMonitoringRegistry
def counter(_name, _desc)
- _undefined
+ nil
end
end
# Prometheus implementation of the monitoring registry, that uses the default
# registry in the official Prometheus client library.
@@ -45,9 +45,13 @@
class MonitoringRegistryFactory
@known_registry_types = {
PrometheusMonitoringRegistry.name =>
PrometheusMonitoringRegistry
}
+
+ def self.supports_monitoring_type(name)
+ @known_registry_types.key?(name)
+ end
def self.create(name)
(@known_registry_types[name] || BaseMonitoringRegistry).new
end
end