-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expose usage of deprecated features #9258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose usage of deprecated features #9258
Conversation
569213f to
487a940
Compare
|
suggestion: It may be useful to add some coded name of the deprecation and return it as well as version when deprecated and version when plan to be removed as separate columns. So whatever consumer there will be will not need to group by message and instead can group by some shorter name. Also can grep by version which deprecation they interested in. |
|
Short names are already there; see the It wasn't clear to me whether version-deprecated and removal-target where particularly useful bits to include here; I think the better pattern would be for the user to check the published details on the website as we do end up changing these details occasionally. |
Sorry missed the ID. As for versions - in example they are part of the message. Maybe including when they were deprecated as it wouldn't change, but not when they will be removed than? |
11cedeb to
2a0caa3
Compare
I don't think these really belong in the introspection service. I could see individual plugins exporting a field to indicate that a deprecated feature is in use, but the record/list functionality is new functionality entirely. From a backport-able to 1.6/1.7 perspective, it is cleaner to extend the Server response and plugin exports rather than add new functions which will change the generated introspection interface. Is it necessary for Record to be an exported interface rather than having it handled within plugins? The |
|
Right now, the usage of I can take a look at the exports approach. It's a bit more limiting, but maybe that's the right tradeoff. Another idea would be to introduce a new service entirely rather than modifying the introspection service. |
2a0caa3 to
cbfcaf4
Compare
|
I've rewritten this to use the
With this rewrite the only API addition is a field in the |
|
Thanks Sam! This will be helpful when migrating to 2.0. One concern: |
|
I've moved this to a draft for now. #9292 has some discussion and I've also written up a much longer doc covering my thinking in this area. |
@SergeyKanzhelev @ruiwen-zhao I've moved this to the bikeshedding section of the proposal doc. |
cbfcaf4 to
17c9862
Compare
17c9862 to
c55f9df
Compare
This package enumerates the known deprecations in the current version of containerd. New deprecations should be added here, and old ones removed. Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
The Server rpc in introspection service is extended to expose deprecation warnings based on observed feature use in containerd. Signed-off-by: Samuel Karp <samuelkarp@google.com>
Deprecation warnings are retrieved from the warning service and returned via the Server RPC. Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Fixes #9292
This series of commits adds support for recording and querying deprecated feature usage. We currently document our deprecations in the RELEASES.md file and have some warnings emitted into the log, but determining whether any of those features are in use requires understanding the config and call patterns of clients and/or log scanning. A service that records deprecated feature usage will make it possible to surface warnings to administrators who may not be the regular end-user of containerd (such as a Kubernetes cluster admin).
To help with the significant deprecations being made for containerd 2.0, I intend to backport this to 1.7 and 1.6, adding warnings where necessary.
The series as-is adds the basic infrastructure and warnings for 2 current deprecations that still exist in
main:mainsoon)I have not yet added support for other config property deprecations; that can be handled in a follow-up PR.
The implementation is as follows:
warningservice has been implemented which plugins can call to emit deprecation warnings.ServerRPC now returns deprecation warnings, retrieved from thewarningservice.ServerRPC response by the number of deprecations and bounds the memory usage of thewarningservice.ctr deprecations listcan be used to query recorded warnings and output either for human consumption or in jsonSample output:
It may be easiest to review this PR commit-by-commit, as the overall size is somewhat large but each individual commit is scoped to a single piece.