Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[prior art] sdk/log/xlog: Add FilterProcessor and EnabledParameters #6271
base: main
Are you sure you want to change the base?
[prior art] sdk/log/xlog: Add FilterProcessor and EnabledParameters #6271
Changes from 16 commits
96a79ee
6282e71
69ff66d
bf61d44
5b3c8ca
f24fc64
fffc077
55adcc4
008cf4d
4df6669
d31f329
fe5ae63
4e54827
abe7833
d5817c6
c23714b
cb91d27
71376d1
e6b34ae
4ff41e1
628f916
98d6811
5cf1eaf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean when this is stabilized, this module will depend on an unstable module we control?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I think the impact would be acceptable.
This would require the users to use versions that are compatible. This would affect mostly users that opt-in to use xlog so that it is a direct dependency. FWIW most people do not bump indirect dependencies.
Personaly, I think it is an acceptable trade-off.
Similarly we depend on unstable
github.com/google/go-cmp
andgolang.org/x/sys
and I do not thing it prevents as from stabilization of the modules that use it.I think it is good to not depend on unstable modules but it is not always feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not maintained by us though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the crux of the problem. We need to provide stability guarantees for the SDK we release. I don't think saying "people do not bump indirect dependencies" is a valid way to get around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it will share the same issue we had with cross-module internal dependencies, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this will work with type assertions when the argument is an experiental type. But I will double check.
If not then I think I can make a longer list of arguments for Enabled (context, severity, scope, resource) instead of EnabledPararamters (which could be introduced when the feature is going to be stabilized).
I will try this in a separate PR(s) to have a comparison between different designs.
Thanks a lot for your feedback 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting we are going to use the same EnabledParameters for
Logger.Enabled
andFilterProcessor.Enabled
? This will lead us to an awkward position if we need to changeFilterProcessor.Enabled
after stabilizing theLogger
.I think we can copy experimental interface definitions to the stable module if we want to make it stable. After that, we drop the use of experimental interfaces in SDK. This will break all existing processors that implement the experimental interfaces, but it seems fine, as they are experimental features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we need
scope.Instrumentation
andresource.Resource
. I meant something likeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suspected. It does not work with type assertions. However, I think we can try use
reflect
instead to make it working.The benefit of this approach is that it should never break the compilation for the users. It mitigates the problem if they happen to run in a conflict and have incompatible version of
xlog
(e.g. transient dependencies).The main drawback for users is no compile-time guarantee for people that opt-in in to an experimental feature.
The other drawback is the complexity of the implementation (on our side) because of using reflection.
The minor drawbacks are a little more overhead
It seems reasonable to favor stability guarantees. It also looks like a safer, less disruptive approach for our users. For sure it is worth creating a PR that tries doing it so that we can compare both approaches.
The next alternative is to have an experimental interface like
This way we would be able to use type assertions, but I think it is a bad idea given we would like to introduce
EnabledParameters
. It would make migration from experimental to stable very awkward and inconvenient. I do not like this and I do not want to go forward. I think this would look very hacky and unprofessional. At last we would not be able to use such approach for more complex parameters.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6286 is ready for review.
This file was deleted.
This file was deleted.