Measure and expose DNS programming latency from Kubernetes plugin. (#3171)

For now metric is measure only for headless services. Informer has been slighlty
refactored, so the code can measure latency without storing extra fields on
Endpoint struct.

Signed-off-by: Janek Łukaszewicz <janluk@google.com>

Suggestions from code review

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
janluk
2019-10-04 17:48:43 +02:00
committed by Miek Gieben
parent 03ea2ae955
commit d7cdb992b4
11 changed files with 330 additions and 37 deletions

View File

@@ -229,3 +229,19 @@ plugin is also enabled:
* kubernetes/service: the service name in the query
* kubernetes/client-namespace: the client pod's namespace, if `pods verified` mode is enabled
* kubernetes/client-pod-name: the client pod's name, if `pods verified` mode is enabled
## Metrics
The *kubernetes* plugin exports the following *Prometheus* metrics.
* `coredns_kubernetes_dns_programming_latency_seconds{service_kind}` - exports the
[DNS programming latency SLI](https://github.com/kubernetes/community/blob/master/sig-scalability/slos/dns_programming_latency.md).
The metrics has the `service_kind` label that identifies the kind of the
[kubernetes service](https://kubernetes.io/docs/concepts/services-networking/service).
It may take one of the three values:
* `cluster_ip`
* `headless_with_selector`
* `headless_without_selector`
## Bugs
* add support for other service types; only "headless_with_selector" is supported now