awslimitchecker.metrics.datadog module

class awslimitchecker.metrics.datadog.Datadog(region_name, prefix='awslimitchecker.', api_key=None, extra_tags=None, host='https://api.datadoghq.com')[source]

Bases: awslimitchecker.metrics.base.MetricsProvider

Initialize the Datadog metrics provider. This class does not have any additional requirements. You must specify at least the api_key configuration option.

Parameters:
  • region_name (str) – the name of the region we’re connected to. This parameter is automatically passed in by the Runner class.
  • prefix (str) – Datadog metric prefix
  • api_key (str) – Datadog API key. May alternatively be specified by the DATADOG_API_KEY environment variable.
  • host (str) – The datadog host URL to use; defaults to https://api.datadoghq.com. This parameter is overridden by the DATADOG_HOST environment variable, if set. This must NOT end with a trailing slash.
  • extra_tags (str) – CSV list of additional tags to send with metrics. All metrics will automatically be tagged with region:<region name>
__init__(region_name, prefix='awslimitchecker.', api_key=None, extra_tags=None, host='https://api.datadoghq.com')[source]

Initialize the Datadog metrics provider. This class does not have any additional requirements. You must specify at least the api_key configuration option.

Parameters:
  • region_name (str) – the name of the region we’re connected to. This parameter is automatically passed in by the Runner class.
  • prefix (str) – Datadog metric prefix
  • api_key (str) – Datadog API key. May alternatively be specified by the DATADOG_API_KEY environment variable.
  • host (str) – The datadog host URL to use; defaults to https://api.datadoghq.com. This parameter is overridden by the DATADOG_HOST environment variable, if set. This must NOT end with a trailing slash.
  • extra_tags (str) – CSV list of additional tags to send with metrics. All metrics will automatically be tagged with region:<region name>
__module__ = 'awslimitchecker.metrics.datadog'
_name_for_metric(service, limit)[source]

Return a metric name that’s safe for datadog

Parameters:
  • service (str) – service name
  • limit (str) – limit name
Returns:

datadog metric name

Return type:

str

_validate_auth(api_key)[source]
flush()[source]

Flush all metrics to the provider. This is the method that actually sends data to your metrics provider/store. It should iterate over self._limits and send metrics for them, as well as for self._duration.