Introduction

Consul is a tool developed by HashiCorp that provides service discovery, configuration management, and a key-value store. It is commonly used for microservices architectures, especially in environments like Kubernetes (K8s), where services can dynamically scale and change.

Consul can be deployed to manage service discovery and health checking, and it can be integrated with other tools like Prometheus for monitoring and metrics collection.

Kubernetes 2.0 ConfigMap

Users should update or append the existing ConfigMap named opsramp-workload-metric-user-config by adding application-specific fields. These fields may include authentication credentials, collection frequency, and other relevant configurations.

apiVersion: v1
kind: ConfigMap
metadata:
  name: opsramp-workload-metric-user-config
  namespace: opsramp-agent
data:
  workloads: |
    consul:
    - name: consul
      collectionFrequency: 10s
      port: 9107
      targetPodSelector:
        matchLabels:
          - key: app.kubernetes.io/name
            operator: ==
            value:
              - consul
  ---

Supported Metrics

Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.

MetricMeaningLabels
consul_upWas the last query of Consul successful.
consul_raft_peersHow many peers (servers) are in the Raft cluster.
consul_serf_lan_membersHow many members are in the cluster.
consul_serf_lan_member_infoInformation of member in the cluster.member, role, version
consul_serf_lan_member_statusStatus of member in the cluster. 1=Alive, 2=Leaving, 3=Left, 4=Failed.member
consul_serf_wan_member_infoInformation of member in the wan cluster.member, dc, role, version
consul_serf_wan_member_statusStatus of member in the wan cluster. 1=Alive, 2=Leaving, 3=Left, 4=Failed.member, dc
consul_catalog_servicesHow many services are in the cluster.
consul_service_tagTags of a service.service_id, node, tag
consul_catalog_service_node_healthyIs this service healthy on this node.service_id, node, service_name
consul_health_node_statusStatus of health checks associated with a node.check, node, status
consul_health_service_statusStatus of health checks associated with a service.check, node, service_id, service_name, status
consul_catalog_kvThe values for selected keys in Consul's key/value catalog. Keys with non-numeric values are omitted.key
consul_service_checksLink the Consul service ID with check name if available.service_id,service_name, check_id, check_name, node