github.com/aclisp/heapster@v0.19.2-0.20160613100040-51756f899a96/docs/sink-configuration.md (about)

     1  Configuring sources
     2  ===================
     3  
     4  Heapster can store data into different backends (sinks). These are specified on the command line
     5  via the `--sink` flag. The flag takes an argument of the form `PREFIX:CONFIG[?OPTIONS]`.
     6  Options (optional!) are specified as URL query parameters, separated by `&` as normal.
     7  This allows each source to have custom configuration passed to it without needing to
     8  continually add new flags to Heapster as new sinks are added. This also means
     9  heapster can store data into multiple sinks at once.
    10  
    11  ## Current sinks
    12  
    13  ### Log
    14  
    15  This sinks writes all data to the standard output which is particularly useful for debugging.
    16    
    17     --sink=log
    18  
    19  ### InfluxDB
    20  This sink supports both monitoring metrics and events.
    21  *Supports InfluxDB versions v0.9 and above*
    22  To use the InfluxDB sink add the following flag:
    23  
    24  	--sink=influxdb:<INFLUXDB_URL>[?<INFLUXDB_OPTIONS>]
    25  
    26  If you're running Heapster in a Kubernetes cluster with the default InfluxDB + Grafana setup you can use the following flag:
    27  
    28  	--sink=influxdb:http://monitoring-influxdb:80/
    29  
    30  The following options are available:
    31  * `user` - InfluxDB username (default: `root`)
    32  * `pw` - InfluxDB password (default: `root`)
    33  * `db` - InfluxDB Database name (default: `k8s`)
    34  * `secure` - Connect securely to InfluxDB (default: `false`)
    35  
    36  ### Google Cloud Monitoring
    37  This sink supports monitoring metrics only.
    38  To use the GCM sink add the following flag:
    39  
    40  	--sink=gcm
    41  
    42  *Note: This sink works only on a Google Compute Enginer VM as of now*
    43  
    44  GCM has one option - `metrics` that can be set to:
    45  * all - the sink exports all metrics
    46  * autoscaling - the sink exports only autoscaling-related metrics
    47  
    48  ### Google Cloud Logging
    49  This sink supports events only.
    50  To use the InfluxDB sink add the following flag:
    51  
    52  	--sink=gcl
    53  
    54  *Notes:* 
    55   * This sink works only on a Google Compute Enginer VM as of now
    56   * GCE instance must have “https://www.googleapis.com/auth/logging.write” auth scope
    57   * GCE instance must have Logging API enabled for the project in Google Developer Console
    58   * GCL Logs are accessible via:
    59      * `https://console.developers.google.com/project/<project_ID>/logs?service=custom.googleapis.com`
    60      * Where `project_ID` is the project ID of the Google Cloud Platform project ID.
    61      * Select `kubernetes.io/events` from the `All logs` drop down menu.
    62  
    63  ### Hawkular-Metrics
    64  This sink supports monitoring metrics only.
    65  To use the Hawkular-Metrics sink add the following flag:
    66  
    67  	--sink=hawkular:<HAWKULAR_SERVER_URL>[?<OPTIONS>]
    68  
    69  If `HAWKULAR_SERVER_URL` includes any path, the default `hawkular/metrics` is overridden. To use SSL, the `HAWKULAR_SERVER_URL` has to start with `https`
    70  
    71  The following options are available:
    72  
    73  * `tenant` - Hawkular-Metrics tenantId (default: `heapster`)
    74  * `labelToTenant` - Hawkular-Metrics uses given label's value as tenant value when storing data
    75  * `useServiceAccount` - Sink will use the service account token to authorize to Hawkular-Metrics (requires OpenShift)
    76  * `insecure` - SSL connection will not verify the certificates
    77  * `caCert` - A path to the CA Certificate file that will be used in the connection
    78  * `auth` - Kubernetes authentication file that will be used for constructing the TLSConfig
    79  * `user` - Username to connect to the Hawkular-Metrics server
    80  * `pass` - Password to connect to the Hawkular-Metrics server
    81  * `filter` - Allows bypassing the store of matching metrics, any number of `filter` parameters can be given with a syntax of `filter=operation(param)`. Supported operations and their params:
    82    * `label` - The syntax is `label(labelName:regexp)` where `labelName` is 1:1 match and `regexp` to use for matching is given after `:` delimiter
    83    * `name` - The syntax is `name(regexp)` where MetricName is matched (such as `cpu/usage`) with a `regexp` filter
    84  * `batchSize`- How many metrics are sent in each request to Hawkular-Metrics (default is 1000)
    85  * `concurrencyLimit`- How many concurrent requests are used to send data to the Hawkular-Metrics (default is 5)
    86  
    87  A combination of `insecure` / `caCert` / `auth` is not supported, only a single of these parameters is allowed at once. Also, combination of `useServiceAccount` and `user` + `pass` is not supported. To increase the performance of Hawkular sink in case of multiple instances of Hawkular-Metrics (such as scaled scenario in OpenShift) modify the parameters of batchSize and concurrencyLimit to balance the load on Hawkular-Metrics instances.
    88  
    89  ### OpenTSDB
    90  This sink supports monitoring metrics and events.
    91  To use the opentsdb sink add the following flag:
    92  
    93      --sink=opentsdb:<OPENTSDB_SERVER_URL>
    94  
    95  Currently, accessing opentsdb via its rest apis doesn't need any authentication, so you
    96  can enable opentsdb sink like this:
    97  
    98      --sink=opentsdb:http://192.168.1.8:4242
    99  
   100  ### Monasca
   101  This sink supports monitoring metrics only.
   102  To use the Monasca sink add the following flag:
   103  
   104  	--sink=monasca:[?<OPTIONS>]
   105  
   106  The available options are listed below, and some of them are mandatory. You need to provide access to the Identity service of OpenStack (keystone).
   107  Currently, only authorization through `username` / `userID` + `password` / `APIKey` is supported.
   108  
   109  The Monasca sink is then created with either the provided Monasca API Server URL, or the URL is discovered automatically if none is provided by the user.
   110  
   111  The following options are available:
   112  
   113  * `user-id` - ID of the OpenStack user
   114  * `username` - Name of the OpenStack user
   115  * `tenant-id` - ID of the OpenStack tenant (project)
   116  * `keystone-url` - URL to the Keystone identity service (*mandatory*). Must be a v3 server (required by Monasca)
   117  * `password` - Password of the OpenStack user
   118  * `api-key` - API-Key for the OpenStack user
   119  * `domain-id` - ID of the OpenStack user's domain
   120  * `domain-name` - Name of the OpenStack user's domain
   121  * `monasca-url` - URL of the Monasca API server (*optional*: the sink will attempt to discover the service if not provided)
   122  
   123  ### Kafka
   124  This sink supports monitoring metrics only.
   125  To use the kafka sink add the following flag:
   126  
   127      --sink="kafka:<?<OPTIONS>>"
   128  
   129  Normally, kafka server has multi brokers, so brokers' list need be configured for producer.
   130  So, we provide kafka brokers' list and topics about timeseries & topic in url's query string.
   131  Options can be set in query string, like this:
   132  
   133  * `brokers` - Kafka's brokers' list. 
   134  * `timeseriestopic` - Kafka's topic for timeseries. Default value : `heapster-metrics`
   135  * `eventstopic` - Kafka's topic for events.Default value : `heapster-events`
   136  
   137  For example, 
   138  
   139      --sink="kafka:?brokers=localhost:9092&brokers=localhost:9093&timeseriestopic=testseries&eventstopic=testtopic"
   140  
   141  ### Riemann
   142  This sink supports metrics only.
   143  To use the reimann sink add the following flag:
   144  
   145  	--sink="riemann:<RIEMANN_SERVER_URL>[?<OPTIONS>]"
   146  
   147  The following options are available:
   148  
   149  * `ttl` - TTL for writes to Riemann. Default: `60 seconds`
   150  * `state` - FIXME. Default: `""`
   151  * `tags` - FIXME. Default. `none`
   152  * `storeEvents` - Control storage of events. Default: `true`
   153  
   154  ### Elasticsearch
   155  This sink supports monitoring metrics and events.
   156  To use the Elasticsearch sink add the following flag:
   157  
   158      --sink=elasticsearch:<ES_SERVER_URL>[?<OPTIONS>]
   159  
   160  Normally, elasticsearch cluster has multi nodes or a proxy, so nodes' list or proxy 
   161  server need be configured for elasticsearch sink.
   162  Thus, we can set `ES_SERVER_URL` to a dummy value, and provide nodes list or proxy server
   163  in url's query string.
   164  Besides, the following options can be set in query string:
   165  
   166  * `Index` - ES's index for metrics&events. Default: `heapster`
   167  
   168    if the ES cluster needs authentication, we should provide the username and secret.
   169  
   170  * `esUserName`      - ES's user name
   171  * `esUserSecret`    - ES's user secret
   172  
   173  Like this:
   174  
   175      --sink="elasticsearch:?nodes=0.0.0.0:9200&Index=testMetric"
   176  	
   177  	or
   178  	
   179  	--sink="elasticsearch:?nodes=0.0.0.0:9200&Index=testEvent"
   180  
   181  ## Using multiple sinks
   182  
   183  Heapster can be configured to send k8s metrics and events to multiple sinks by specifying the`--sink=...` flag multiple times.
   184  
   185  For example, to send data to both gcm and influxdb at the same time, you can use the following:
   186  
   187  ```shell
   188      --sink=gcm --sink=influxdb:http://monitoring-influxdb:80/
   189  ```