Open psarna opened 3 years ago
We already print warnings with tracing
(although unconditionally, without a way to disable it):
It seems that there are some mechanisms to filter events provided by the tracing
ecosystem (I see something here), however I'm not very familiar with tracing
so I cannot tell if and how it would fit in this case - more investigation is needed.
It's also worth mentioning that it's up to the user to correctly set up tracing
so that it prints messages or does something useful (fortunately, it's easy, e.g. like this).
We already print warnings with
tracing
(although unconditionally, without a way to disable it).
I think we can close this then. WDYT @Lorak-mmk?
Ping @Lorak-mmk
Printing trough tracing is enough, but the issue also suggests a mechanism to disable it. We should either implement it or verify that such filtering is possible and ergonomic using mechanisms provided by tracing ecosystem.
Ref: https://github.com/scylladb/scylla/issues/9001#issuecomment-878073435
Responses from correct CQL queries should generally not contain any warnings. If they do, it usually means that the user is doing something wrong and should be notified about it. Our driver already uses the
tracing
crate for logs, so this mechanism should also be used to propagate warnings from CQL responses, if any are found.In order to be able to avoid spam in certain cases (e.g. a large number of queries is expected to cause warnings, but they need to be executed anyway), this mechanism should have a safety valve, which allows disabling the propagation.