# salt.returners.carbon_return

Take data from salt and "return" it into a carbon receiver

Add the following configuration to the minion configuration file:

    carbon.host: <server ip address>
    carbon.port: 2003

Errors when trying to convert data to numbers may be ignored by setting `carbon.skip_on_error` to True:

    carbon.skip_on_error: True

By default, data will be sent to carbon using the plaintext protocol. To use the pickle protocol, set `carbon.mode` to `pickle`:

    carbon.mode: pickle

You can also specify the pattern used for the metric base path (except for virt modules metrics):

  carbon.metric_base_pattern: carbon.[minion_id].[module].[function]

These tokens can used :

  [module]: salt module [function]: salt function [minion_id]: minion id

Default is :

  carbon.metric_base_pattern: [module].[function].[minion_id]

Carbon settings may also be configured as:

    carbon:
      host: <server IP or hostname>
      port: <carbon port>
      skip_on_error: True
      mode: (pickle|text)
      metric_base_pattern: <pattern> | [module].[function].[minion_id]

Alternative configuration values can be used by prefacing the configuration. Any values not found in the alternative configuration will be pulled from the default location:

    alternative.carbon:
      host: <server IP or hostname>
      port: <carbon port>
      skip_on_error: True
      mode: (pickle|text)

To use the carbon returner, append '--return carbon' to the salt command.

    salt '*' test.ping --return carbon

To use the alternative configuration, append '--return_config alternative' to the salt command.

Added in version 2015.5.0.

    salt '*' test.ping --return carbon --return_config alternative

To override individual configuration items, append --return_kwargs '{"key:": "value"}' to the salt command.

Added in version 2016.3.0.

    salt '*' test.ping --return carbon --return_kwargs '{"skip_on_error": False}'

salt.returners.carbon_return.event_return(events)

  Return event data to remote carbon server

  Provide a list of events to be stored in carbon

salt.returners.carbon_return.prep_jid(nocache=False, passed_jid=None)

  Do any work necessary to prepare a JID, including sending a custom id

salt.returners.carbon_return.returner(ret)

  Return data to a remote carbon server using the text metric protocol

  Each metric will look like:

      [module].[function].[minion_id].[metric path [...]].[metric name]