You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ approvers:
20
20
- "@x13n"
21
21
editor: "@brancz"
22
22
creation-date: 2019-04-04
23
-
last-updated: 2019-06-05
23
+
last-updated: 2019-11-06
24
24
status: implementable
25
25
see-also:
26
26
- 20181106-kubernetes-metrics-overhaul
@@ -43,6 +43,8 @@ see-also:
43
43
-[Stability Classes](#stability-classes)
44
44
-[API Review](#api-review)
45
45
-[Deprecation Lifecycle](#deprecation-lifecycle)
46
+
-[Show Hidden Metrics](#show-hidden-metrics)
47
+
-[Why Not Bool Flag](#why-not-bool-flag)
46
48
-[Design Details](#design-details)
47
49
-[Test Plan](#test-plan)
48
50
-[Graduation Criteria](#graduation-criteria)
@@ -260,7 +262,40 @@ some_counter 0
260
262
```
261
263
Like their stable metric counterparts, deprecated metrics will be automatically registered to the metrics endpoint.
262
264
263
-
On a subsequent release (when the metric's deprecatedVersion is equal to current_kubernetes_version - 1)), a deprecated metric will become a __hidden metric__. _Unlike_ their deprecated counterparts, hidden metrics will __*no longer be automatically registered*__ to the metrics endpoint (hence hidden). However, they can be explicitly enabled through a command line flag on the binary (i.e. '--enable-hidden-metrics=really_deprecated_metric'). This is to provide cluster admins an escape hatch to properly migrate off of a deprecated metric, if they were not able to react to the earlier deprecation warnings. Hidden metrics should be deleted after one release.
265
+
On a subsequent release (when the metric's deprecatedVersion is equal to current_kubernetes_version - 1)), a deprecated metric will become a __hidden metric__. _Unlike_ their deprecated counterparts, hidden metrics will __*no longer be automatically registered*__ to the metrics endpoint (hence hidden). However, they can be explicitly enabled through a command line flag on the binary (i.e. '--show-hidden-metrics-for-version=<previous minor release>'). This is to provide cluster admins an escape hatch to properly migrate off of a deprecated metric, if they were not able to react to the earlier deprecation warnings. Hidden metrics should be deleted after one release.
266
+
267
+
### Show Hidden Metrics
268
+
As described above, admins can enable hidden metrics through a command-line flag on a specific binary.
269
+
This intends to be used as an escape hatch for admins if they missed the migration of the metrics deprecated in the last release.
270
+
271
+
The flag `show-hidden-metrics-for-version` takes a version for which you want to show metrics deprecated in that release.
272
+
The version is expressed as __x.y__, where __x__ is the major version, __y__ is the minor version.
273
+
The patch version is not needed even though a metrics can be deprecated in a patch release, the reason for that is
274
+
the metrics deprecation policy runs against the minor release.
275
+
276
+
The flag can only take the previous minor version as it's value.
277
+
All metrics hidden in previous will be emitted if admins set the previous version to `show-hidden-metrics-for-version`.
278
+
The too old version is not allowed because this violates the metrics deprecated policy.
279
+
280
+
Take metric `A` as an example, here assumed that `A` is deprecated in `1.n`.
281
+
According to metrics deprecated policy, we can reach the following conclusion:
282
+
- In release `1.n`, the metric is deprecated, and it can be emitted by default.
283
+
- In release `1.n+1`, the metric is hidden by default and it can be emitted by command line `show-hidden-metrics-for-version=1.n`.
284
+
- In release `1.n+2`, the metric should be removed from the codebase. No escape hatch anymore.
285
+
286
+
So, if admins want to enable metric `A` in release `1.n+1`, they should set `1.n` to the command line flag.
287
+
That is `show-hidden-metrics=1.n`.
288
+
289
+
### WhyNotBoolFlag
290
+
Alternatively, another solution which was previously suggested(refer to the discussion on [PR](https://github.com/kubernetes/kubernetes/pull/84292))
291
+
was provide a bool flag-like `show-hidden-metrics`. That works like:
292
+
- `show-hidden-metrics=true`: enable all hidden metrics deprecated in a previous minor version.
293
+
- `show-hidden-metrics=false`: the default value, do nothing.
294
+
295
+
This proposal has a side effect(thanks for @lavalamp pointed it out) in the scenario:
296
+
1. in version X, turn this on to get back deprecated metric M
297
+
2. in version Y, not turn this off, and therefore fail to notice metric N is being deprecated
298
+
3. in version Z, metric N is removed with (effectively) no warning
0 commit comments