Time Series Publisher Block Config

The Time Series Publisher block can be instantiated by using the block type timeseries.

See The Blocks Section for an explanation of what a block is in the Cloud Gateway.

The configuration fields (in the config portion of the block configuration) for the timeseries block are as follows:
Table 1. Configuration Fields
FieldTypeRequiredDefault
log_nameStringno<block name>
log_levelStringno'off'
mqtt/transport_addrStringnomqtt-tcp://predix-edge-broker
mqtt/qosIntegerno0
mqtt/client_idStringno
mqtt/topicsArray of Stringsyes
policy String no store_on_failure
store_forwardObjectyes
store_forward/max_store_percentIntegerno10
store_forward/max_batch_intervalIntegerno1000
timeseries/compressBooleannotrue
timeseries/transport_addrStringyes
timeseries/predix_zone_idStringyes
timeseries/token_fileString/Objectno/edge-agent/access_token
timeseries/proxy_urlStringno

The following is a sample block config for the timeseries block. This should be placed in the blocks section of the overall configuration file.

The block below is configured to subscribe to the MQTT topic input_data on the Predix Edge Broker and ingest all data received from that topic to a Predix Time Series instance with the Predix Zone ID xxx-xxx at the URL wss://dummy_url.run.aws-usw02-pr.ice.predix.io/v1/stream/messages.

The block's name in this example is time_series_sender, but it can be any string you wish to use.
"time_series_sender": {
    "type": "timeseries",
    "config": {
        "log_name": "time_series_block",
        "log_level": "debug",
        "mqtt": {
            "transport_addr": "mqtt-tcp://predix-edge-broker",
            "qos": 2,
            "client_id": "time_series_mqtt_client0",
            "topics": [
                "input_data"
            ]
        },
        "store_forward": {
            "max_store_percent": 30,
            "max_batch_interval": 2000,
            "policy": "store_on_failure"
        },
        "timeseries": {
            "transport_addr": "wss://dummy_url.run.aws-usw02-pr.ice.predix.io/v1/stream/messages",
            "predix_zone_id": "xxx-xxx",
            "token_file": "/edge-agent/access_token",
            "proxy_url": "$http_proxy"
        }
    }
}

log_level and log_name

For details on the log_level and log_name fields of the Time Series Publisher block's config section, see Common Block Config Fields.

mqtt

For details on fields within the mqtt portion of the Time Series Publisher block's config section, see Common Block Config Fields.

store_forward/max_store_percent and store_forward/max_batch_interval

For details on the store_forward/max_store_percent and store_forward/max_batch_interval fields of the Time Series Publisher block's config section, see Common Block Config Fields.

timeseries/compress

The timeseries/compress tag is an optional boolean (true/false) that defaults to 'true'. When enabled, the Time Series service will receive JSON payloads compressed (GZIP) by the cloud gateway. The size limit for the actual JSON payload is 512 KB regardless of the ingestion request format. For compressed payloads, this means the decompressed payload cannot exceed 512 KB.

timeseries/transport_addr

The transport_addr field within the timeseries section should be set to the URI of whatever Predix Time Series instance you wish to publish data to.

timeseries/predix_zone_id

The predix_zone_id field within the timeseries section should be set to the Predix Zone ID of whatever Predix Time Series instance you wish to publish data to.

timeseries/token_file

The token_file field within the timeseries section should usually be set to the path to the file on your Predix Edge device that holds your UAA token for authentication with your Predix Time Series instance.
Note: Use the default value for token_file path unless your application requires you to change it.
To use a separate UAA other than the one utilized by Edge Manager you may provide a JSON object with the following keys:
  • uaa_url - The URL of the host where the UAA service is running. The UAA service provides the access token that is subsequently used to push to the Timeseries server. The path oauth/token is appended and the resulting URL is used to request the access token.
  • client_id - The client ID associated with an account that has access to the desired Timeseries zone.
  • client_secret - The secret associated with the client_id.
  • proxy_url - The proxy required to access the UAA URL.
Key Type Required Default
timeseries/token_file/uaa_url String Only if a separate Time Series UAA is used
timeseries/token_file/client_id String Only if a separate Time Series UAA is used
timeseries/token_file/client_secret String Only if a separate Time Series UAA is used
timeseries/token_file/proxy_url String Only if a separate Time Series UAA is used

timeseries/proxy_url

The proxy_url field within the timeseries section should be set to the URL of whatever proxy you want to use (if any) to connect to whatever Predix Time Series instance you wish to publish data to. This field can be omitted or set to an empty string if no proxy is desired.
Note: This can be either the Predix Edge OS environment variable $http_proxy or a URL in the format <protocol>://<FQDN or IP Address>:<port>. The $http_proxy variable is set via PETC. See Configuring the Network and Proxy Settings.