[Operational] Shepherd service
Shepherd service collects prometheus metrics on a cluster and writes them into an influxDB.
The service collects cluster-wide as well as per-pod metrics. Service will create database clusterstats in the influxDB if one doesn't exist.
Cluster metrics are collected and stored in crm-cluster measurement in clusterstats database. It includes the following metrics:
cpu- cluster CPU utilization percentagemem- cluster memory utilization percentagedisk- cluster filesystem utilization percentagesendBytes- cluster tx traffic rate averaged over 1 minuterecvBytes- cluster rx traffic rate averaged over 1 minutetcpConns- total number of established TCP connections on this clustertcpRetrans- total number of TCP retransmissions on this clusterudpRecv- total number of rx UDP datagrams on this clusterudpSend- total number of tx UDP datagrams on this clusterudpRecvErr- tatal number of UDP errors received on this cluster In addition to the above valuesclustertag is added to each measurement with the name of a cluster. Per-pod metrics are collected and stored incrm-appinstmeasurement inclusterstatsdatabase. The following metrics are collected:cpu- CPU utilization of this pod as a percentage of total available CPUmem- current memory footprint of a given pod in bytesdisk- filesystem usage for a given podsendBytes- tx traffic rate averaged over 1 minute for a given podrecvBytes- rx traffic rate averaged over 1 minute for a given pod In addition to the above valuescluster,dev, andapptags are added to the measurement to uniquely identify a particular time series.
The collection of the above metrics happens every set interval by running queries against a prometheus running in a cluster. See Usage section for addition details of how to configure interval/influxDB address/Prometheus address.
Usage
This service is meant to run as a process (similar to crm) that can be started locally with the following usage.
$ shepherd -h
Usage of shepherd:
-cloudletKey string
Json or Yaml formatted cloudletKey for the cloudlet in which this CRM is instantiated; e.g. '{"operator_key":{"name":"DMUUS"},"name":"tmocloud1"}'
-d string
comma separated list of [etcd api notify dmedb dmereq locapi mexos metrics upgrade]
-influxdb string
InfluxDB address to export to (default "http://0.0.0.0:8086")
-interval duration
Metrics collection interval (default 15s)
-notifyAddrs string
CRM notify listener addresses (default "127.0.0.1:51001")
-physicalName string
Physical infrastructure cloudlet name, defaults to cloudlet name in cloudletKey
-platform string
Platform type of Cloudlet
-tls string
server9 tls cert file. Keyfile and CA file mex-ca.crt must be in same directory
-vaultAddr string
Address to vault
Docker Image
Currently not available, will be soon
TODO
- Need to find a better way to organize metrics being sent to influxdb. It is currently too rigid to provide configurable metrics and adding in a new one later would be a hassle.
- Register shepherd with the country controller to be able to send metrics through the notify framework so that controller writes to influxdb instead of shepherd.
- Azure support