-
Notifications
You must be signed in to change notification settings - Fork 69
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
Getting rid of sirupsen/logrus and log.Interface #359
Conversation
7852e6d
to
598d45b
Compare
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 just did a very high level pass.
62c7d10
to
1d4cd9e
Compare
Are users meant to use |
Hi @zalegrala, I will ask all the teams that use |
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 okay with the proposed change, but in case we wanted to appeal to projects (external/internal) which don't use log-kit, this interface is useful and in theory could be developed into compatibility with slog
, which is in the stdlib from 1.21.
In any way I am not seeing any blockers from a consumer perspective of grafana/pyroscope
Hi @simonswine,
they simply do (not exactly, this is just an example)
So, we can, for the moment, remove the interface, and if at a point there will be a need to move to another logger (e.g., |
afd1df3
to
d27fa49
Compare
@duricanikolic the original ambition for dskit was to be generic and adopted inside and outside of Grafana Labs by people building distributed services. This is obviously not the reality today (and might never be). This is in no way blocking or a strongly held opinion, but I think this gets us further from that vision. |
f564a9d
to
a995ee0
Compare
Signed-off-by: Yuri Nikolic <[email protected]>
Signed-off-by: Yuri Nikolic <[email protected]>
Signed-off-by: Yuri Nikolic <[email protected]>
Signed-off-by: Yuri Nikolic <[email protected]>
a995ee0
to
69fe22b
Compare
@simonswine if we decide to keep For example, all occurrences of
will have to be replaced with
Moreover, the interface has some disadvantages: for example, if we want to log
we need to do
but the calls to |
I see @simonswine comment about the This PR is not a regression in that regards: dskit doesn't use Do we want to be less opinionated and support a generic log interface for all the logging done by dskit? Maybe. Is this the main blocker to dskit wide adoption? I doubt (e.g. the lack of any doc may be a bigger blocker). Personally, I would defer the discussion about a generic logging interface until we'll have a proof that's the blocker for an adoption outside Grafana Labs. |
Signed-off-by: Yuri Nikolic <[email protected]>
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.
LGTM, modulo one last fix
c6b3a4b
to
3d505b9
Compare
Signed-off-by: Yuri Nikolic <[email protected]>
3d505b9
to
928f665
Compare
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 looks reasonable to me.
@zalegrala could you please approve the PR? |
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.
Looks good from Loki team. Thanks!
Signed-off-by: Yuri Nikolic <[email protected]>
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 hope I haven't missed anything. LGTM! (I just left a last nit)
Signed-off-by: Yuri Nikolic <[email protected]>
…#10434) This PR removes unnecessary code used to convert the dereleased `dslog.Interface` (see grafana/dskit#359) into `go-kit.Logger`. Additionally, it modifies the signature and implementation of `pkg/util/log/log.go`'s `InitLogger` as follows: - previous signature ``` InitLogger(*server.Config, prometheus.Registerer, bool, bool) ``` has been replaced with ``` InitLogger(*server.Config, prometheus.Registerer, bool, bool) log.Logger ``` Namely, the new `InitLogger` initialises the global logger and returns it. - the new implementation initializes the global logger, but it does not override the default logger for the server. This is now done by the callers of `InitLogger`. Previously, it was done inside `InitLogger` for convenience, since the types of the 2 loggers were not the same. Signed-off-by: Yuri Nikolic <[email protected]>
…grafana#10434) This PR removes unnecessary code used to convert the dereleased `dslog.Interface` (see grafana/dskit#359) into `go-kit.Logger`. Additionally, it modifies the signature and implementation of `pkg/util/log/log.go`'s `InitLogger` as follows: - previous signature ``` InitLogger(*server.Config, prometheus.Registerer, bool, bool) ``` has been replaced with ``` InitLogger(*server.Config, prometheus.Registerer, bool, bool) log.Logger ``` Namely, the new `InitLogger` initialises the global logger and returns it. - the new implementation initializes the global logger, but it does not override the default logger for the server. This is now done by the callers of `InitLogger`. Previously, it was done inside `InitLogger` for convenience, since the types of the 2 loggers were not the same. Signed-off-by: Yuri Nikolic <[email protected]>
What this PR does:
Recently some parts of
weaveworks/common
have been migrated todskit
(PR). That migration included intodskit
also thelog.Interface
interface that 'unifies'gokit
logging andlogrus
logging.On the other hand, all
Loki
,Tempo
,Mimir
andPyroscope
use onlygokit
, and neither from them useslogrus
directly. Therefore, this PR removes the usage oflrogus
andlog.Interface
fromdskit
.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]