---
# Source: signalfx-agent/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: signalfx-agent-v5
  labels:
    app: signalfx-agent
data:
  agent.yaml: |
    signalFxAccessToken: ${SFX_ACCESS_TOKEN}

    signalFxRealm: us0

    disableHostDimensions: false

    etcPath: /hostfs/etc
    procPath: /hostfs/proc

    enableBuiltInFiltering: true

    intervalSeconds: 10

    cluster: MY-CLUSTER

    writer:
      signalFxEnabled: true

    logging:
      level: info
      format: text

    globalDimensions:
      kubernetes_cluster: MY-CLUSTER

    observers:
    - type: k8s-api
      discoverAllPods: false
      discoverNodes: false

    monitors:
    - type: cpu
    - type: filesystems
      hostFSPath: /hostfs
    - type: disk-io
    - type: net-io
    - type: load
    - type: memory
    - type: host-metadata
    - type: processlist
    - type: vmem


    - type: kubelet-metrics
      kubeletAPI:
        authType: serviceAccount
      usePodsEndpoint: true



    # Collects k8s cluster-level metrics
    - type: kubernetes-cluster



    - type: docker-container-stats
      dockerURL: unix:///var/run/docker.sock
      excludedImages:
       - '*pause-amd64*'
       - 'k8s.gcr.io/pause*'
      labelsToDimensions:
        io.kubernetes.container.name: container_spec_name
        io.kubernetes.pod.name: kubernetes_pod_name
        io.kubernetes.pod.uid: kubernetes_pod_uid
        io.kubernetes.pod.namespace: kubernetes_namespace


    collectd:

      readThreads: 5
      writeQueueLimitHigh: 500000
      writeQueueLimitLow: 400000
      timeout: 40
      logLevel: info

    metricsToExclude:
      # The StackDriver metadata-agent pod on GKE restarts every few minutes so
      # ignore its containers
      - dimensions:
          container_spec_name: metadata-agent
