API Reference¶
-
dog_whistle.
_ddify
(message, prepend=True)¶ Datadogifys and normalizes a log message into a datadog key
Parameters: - message (str) – The message to concatentate
- prepend (bool) – prepend the application name to the metric
Returns: the final datado string result
-
dog_whistle.
_gauge
(name, value, tags)¶ Increments a gauge
Parameters: - name (str) – The name of the stats
- value (int) – The value of the gauge
- tag (list) – A list of tags
-
dog_whistle.
_get_config
()¶ Returns the current configuration of the module
-
dog_whistle.
_get_dw_stats
()¶ Returns the statsd implementation in use
-
dog_whistle.
_get_value
(item, key)¶ Grabs a nested value within a dict
Parameters: - item (dict) – the dictionary
- key (str) – the nested key to find
Returns: the value if found, otherwise None
-
dog_whistle.
_increment
(name, tags)¶ Increments a counter
Parameters: - name (str) – The name of the stats
- tag (list) – A list of tags
-
dog_whistle.
_reset
()¶ Resets the module configuration to the defaults
-
dog_whistle.
dw_analyze
(path)¶ Used to analyze a project structure and output the recommended settings dictionary to be used when used in practice. Run this method, then add the resulting output to your project
Parameters: path (str) – The folder path to analyze
-
dog_whistle.
dw_callback
(message, extras)¶ The actual callback method passed to the logger
Parameters: - message (str) – The log message
- extras (dict) – The extras dictionary from the logger
-
dog_whistle.
dw_config
(settings)¶ Set up the datadog callback integration
Parameters: settings (dict) – The settings dict containing the dw_analyze() configuration Raises: Exception
if configuration is missing