fix(kubernetes): record cluster_ip services in dns_programming_duration metric#7951
Conversation
ffe8edc to
7f3ea4c
Compare
…on metric Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
7f3ea4c to
98c3738
Compare
|
The What happened: The fix is in |
…e test cluster_ip is now also recorded by the dns_programming_duration metric (coredns/coredns#7951), so Metric[0] is no longer reliably the headless_with_selector series. Use a label-based lookup instead. Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
|
Companion fix for the CircleCI failure opened at coredns/ci#174. |
The
coredns_kubernetes_dns_programming_duration_secondsmetric has three documentedservice_kindvalues (cluster_ip,headless_with_selector,headless_without_selector), but onlyheadless_with_selectorwas ever emitted. The original PR (#3171) deferred the rest and it never got finished — the README even had a Bugs entry for it.The guard in
record()wasif !isHeadless || l.TT.IsZero(), which skipped all ClusterIP services unconditionally. The fix drops the!isHeadlesscondition and branches onHeadless()to pick the right label. TheEndpointsLastChangeTriggerTimeannotation is set by the endpoints-controller for any service with a selector (headless or ClusterIP), so the existing TT check already captures the right population.headless_without_selectoris still not covered — that would need a new field on theServicestruct which the struct comment explicitly gates on maintainer sign-off. Leaving that for a follow-up.Also added the first tests for the
objectpackage (five table-driven cases) and updated the README Bugs section.Fixes #7644