---
name: log-cache-expvar-forwarder

templates:
  bpm.yml.erb: config/bpm.yml
  run.sh: bin/run.sh
  loggregator_ca.crt.erb: config/certs/loggregator_ca.crt
  loggregator_agent.crt.erb: config/certs/loggregator_agent.crt
  loggregator_agent.key.erb: config/certs/loggregator_agent.key

packages:
- log-cache-expvar-forwarder

provides:
- name: log-cache-expvar-forwarder
  type: log-cache-expvar-forwarder

consumes:
- name: log-cache
  type: log-cache
- name: loggregator
  type: loggregator

properties:
  default_source_id:
    description: |
      Source ID to use for reported metrics when none is provided. Also used
      for version metrics.
    default: log-cache
  interval:
    description: |
      How often the expvar-forwarder should scrape registered
      endpoints and report values.
    default: 1m
  log_metrics:
    description: Write each metric from the endpoints to Log Cache and stdout.
    default: true
  counters:
    description: |
        An array of Objects that have the following fields:
        - addr: address of the expvar endpoint
        - name: The output name of the Counter
        - source_id: The output sourceID of the Counter
        - template: The golang text/template to find the metric in the expvar
          output.
        - tags: An object that can only have string values. They will be
          passed as tags on the envelope.
    default: []
  gauges:
    description: |
        An array of Objects that have the following fields:
        - addr: address of the expvar endpoint
        - name: The output name of the Counter
        - unit: The output unit of the Counter
        - source_id: The output sourceID of the Counter
        - template: The golang text/template to find the metric in the expvar
          output.
        - tags: An object that can only have string values. They will be
          passed as tags on the envelope.
    default: []
  maps:
    description: |
        An array of Objects that have the following fields:
        - addr: address of the expvar endpoint
        - name: The output name of the Counter
        - source_id: The output sourceID of the Map
        - template: The golang text/template to find the metric in the expvar
          output. (Hint: you'll probably want to use a custom map formatter
          such as the jsonMap)
        - tags: An object that can only have string values. They will be
          passed as tags on the envelope.
        Each entry in the map will be parsed into one gauge per key before it
        is forwarder onto the receiving log cache instance.
    default: []

  loggregator_agent:
    tls:
      ca_cert:
        description: CA Cert signing the loggregator_agent certificates.
      cert:
        description: Certificate for communication with loggregator_agent.
      key:
        description: Private Key for communication with loggregator_agent.
