Metric Types

class uwsgiconf.options.monitoring_metric_types.Metric(name, *, oid=None, alias_for=None, collector=None, initial_value=None, collect_interval=None, reset_after_push=None)
Parameters:
  • name (str) –

    Metric name.

    Note

    Only numbers, letters, underscores, dashes and dots.

  • alias_for (str) – If set metric will be a simple alias for the specified one.
  • oid (str) –

    Metric OID.

    Required for SNMP.

  • collector (Collector) –

    Collector to be used. If not set it is considered that the value must be updated manually from applications using the metrics API.

  • initial_value (int) – Set the metric to a specific value on startup.
  • collect_interval (int) – How ofter the metric should be gathered. In seconds.
  • reset_after_push (bool) – Reset the metric to zero (or the configured initial_value) after it’s been pushed.
class uwsgiconf.options.monitoring_metric_types.MetricTypeCounter(name, *, oid=None, alias_for=None, collector=None, initial_value=None, collect_interval=None, reset_after_push=None)

A generally-growing up number.

Example:
  • number of requests
Parameters:
  • name (str) –

    Metric name.

    Note

    Only numbers, letters, underscores, dashes and dots.

  • alias_for (str) – If set metric will be a simple alias for the specified one.
  • oid (str) –

    Metric OID.

    Required for SNMP.

  • collector (Collector) –

    Collector to be used. If not set it is considered that the value must be updated manually from applications using the metrics API.

  • initial_value (int) – Set the metric to a specific value on startup.
  • collect_interval (int) – How ofter the metric should be gathered. In seconds.
  • reset_after_push (bool) – Reset the metric to zero (or the configured initial_value) after it’s been pushed.
class uwsgiconf.options.monitoring_metric_types.MetricTypeGauge(name, *, oid=None, alias_for=None, collector=None, initial_value=None, collect_interval=None, reset_after_push=None)

A number that can increase or decrease dynamically.

Example:
  • memory used by a worker
  • CPU load
Parameters:
  • name (str) –

    Metric name.

    Note

    Only numbers, letters, underscores, dashes and dots.

  • alias_for (str) – If set metric will be a simple alias for the specified one.
  • oid (str) –

    Metric OID.

    Required for SNMP.

  • collector (Collector) –

    Collector to be used. If not set it is considered that the value must be updated manually from applications using the metrics API.

  • initial_value (int) – Set the metric to a specific value on startup.
  • collect_interval (int) – How ofter the metric should be gathered. In seconds.
  • reset_after_push (bool) – Reset the metric to zero (or the configured initial_value) after it’s been pushed.
class uwsgiconf.options.monitoring_metric_types.MetricTypeAbsolute(name, *, oid=None, alias_for=None, collector=None, initial_value=None, collect_interval=None, reset_after_push=None)

An absolute number.

Example:
  • memory of the whole server
  • size of the hard disk.
Parameters:
  • name (str) –

    Metric name.

    Note

    Only numbers, letters, underscores, dashes and dots.

  • alias_for (str) – If set metric will be a simple alias for the specified one.
  • oid (str) –

    Metric OID.

    Required for SNMP.

  • collector (Collector) –

    Collector to be used. If not set it is considered that the value must be updated manually from applications using the metrics API.

  • initial_value (int) – Set the metric to a specific value on startup.
  • collect_interval (int) – How ofter the metric should be gathered. In seconds.
  • reset_after_push (bool) – Reset the metric to zero (or the configured initial_value) after it’s been pushed.
class uwsgiconf.options.monitoring_metric_types.MetricTypeAlias(name, *, oid=None, alias_for=None, collector=None, initial_value=None, collect_interval=None, reset_after_push=None)

This is a virtual metric pointing to another one .

You can use it to give different names to already existing metrics.

Parameters:
  • name (str) –

    Metric name.

    Note

    Only numbers, letters, underscores, dashes and dots.

  • alias_for (str) – If set metric will be a simple alias for the specified one.
  • oid (str) –

    Metric OID.

    Required for SNMP.

  • collector (Collector) –

    Collector to be used. If not set it is considered that the value must be updated manually from applications using the metrics API.

  • initial_value (int) – Set the metric to a specific value on startup.
  • collect_interval (int) – How ofter the metric should be gathered. In seconds.
  • reset_after_push (bool) – Reset the metric to zero (or the configured initial_value) after it’s been pushed.