Skip to content

deep.api.plugin.metric

Definition of metric processor.

Metric processor gives the ability to attach dynamic metrics to metric providers.

MetricProcessor

Bases: Plugin, ABC

Metric processor connects Deep to a metric provider.

Source code in deep/api/plugin/metric/__init__.py
class MetricProcessor(Plugin, abc.ABC):
    """Metric processor connects Deep to a metric provider."""

    @abc.abstractmethod
    def counter(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
        """
        Create a counter type value in the provider.

        :param name: the metric name
        :param labels: the metric labels
        :param namespace: the metric namespace
        :param help_string: the metric help string
        :param unit: the metric unit
        :param value: the metric value
        """
        pass

    @abc.abstractmethod
    def gauge(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
        """
        Create a gauge type value in the provider.

        :param name: the metric name
        :param labels: the metric labels
        :param namespace: the metric namespace
        :param help_string: the metric help string
        :param unit: the metric unit
        :param value: the metric value
        """
        pass

    @abc.abstractmethod
    def histogram(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
        """
        Create a histogram type value in the provider.

        :param name: the metric name
        :param labels: the metric labels
        :param namespace: the metric namespace
        :param help_string: the metric help string
        :param unit: the metric unit
        :param value: the metric value
        """
        pass

    @abc.abstractmethod
    def summary(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
        """
        Create a summary type value in the provider.

        :param name: the metric name
        :param labels: the metric labels
        :param namespace: the metric namespace
        :param help_string: the metric help string
        :param unit: the metric unit
        :param value: the metric value
        """
        pass

    def clear(self):
        """Remove any registrations."""
        pass

clear()

Remove any registrations.

Source code in deep/api/plugin/metric/__init__.py
def clear(self):
    """Remove any registrations."""
    pass

counter(name, labels, namespace, help_string, unit, value) abstractmethod

Create a counter type value in the provider.

:param name: the metric name :param labels: the metric labels :param namespace: the metric namespace :param help_string: the metric help string :param unit: the metric unit :param value: the metric value

Source code in deep/api/plugin/metric/__init__.py
@abc.abstractmethod
def counter(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
    """
    Create a counter type value in the provider.

    :param name: the metric name
    :param labels: the metric labels
    :param namespace: the metric namespace
    :param help_string: the metric help string
    :param unit: the metric unit
    :param value: the metric value
    """
    pass

gauge(name, labels, namespace, help_string, unit, value) abstractmethod

Create a gauge type value in the provider.

:param name: the metric name :param labels: the metric labels :param namespace: the metric namespace :param help_string: the metric help string :param unit: the metric unit :param value: the metric value

Source code in deep/api/plugin/metric/__init__.py
@abc.abstractmethod
def gauge(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
    """
    Create a gauge type value in the provider.

    :param name: the metric name
    :param labels: the metric labels
    :param namespace: the metric namespace
    :param help_string: the metric help string
    :param unit: the metric unit
    :param value: the metric value
    """
    pass

histogram(name, labels, namespace, help_string, unit, value) abstractmethod

Create a histogram type value in the provider.

:param name: the metric name :param labels: the metric labels :param namespace: the metric namespace :param help_string: the metric help string :param unit: the metric unit :param value: the metric value

Source code in deep/api/plugin/metric/__init__.py
@abc.abstractmethod
def histogram(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
    """
    Create a histogram type value in the provider.

    :param name: the metric name
    :param labels: the metric labels
    :param namespace: the metric namespace
    :param help_string: the metric help string
    :param unit: the metric unit
    :param value: the metric value
    """
    pass

summary(name, labels, namespace, help_string, unit, value) abstractmethod

Create a summary type value in the provider.

:param name: the metric name :param labels: the metric labels :param namespace: the metric namespace :param help_string: the metric help string :param unit: the metric unit :param value: the metric value

Source code in deep/api/plugin/metric/__init__.py
@abc.abstractmethod
def summary(self, name: str, labels: Dict[str, str], namespace: str, help_string: str, unit: str, value: float):
    """
    Create a summary type value in the provider.

    :param name: the metric name
    :param labels: the metric labels
    :param namespace: the metric namespace
    :param help_string: the metric help string
    :param unit: the metric unit
    :param value: the metric value
    """
    pass