Skip to content
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

HTTP Logging doesn't print user-id #116

Open
gouthamve opened this issue Aug 1, 2018 · 4 comments
Open

HTTP Logging doesn't print user-id #116

gouthamve opened this issue Aug 1, 2018 · 4 comments

Comments

@gouthamve
Copy link
Contributor

While I think the idea was to print user/org ids, with http req logging, as seen here: https://github.com/weaveworks/common/blob/master/middleware/logging.go#L40 we don't.

This is because logging is currently the first middleware and auth is usually the last. Which means the context that the logging middleware has access to doesn't have the user/org-ids.

Not sure how to put the auth middleware at the first though....

@bboreham
Copy link
Collaborator

bboreham commented Aug 1, 2018

good spot!

We could prepend the supplied server.Config.HTTPMiddleware instead of appending it.
Might need to tweak the opentracing handler.

Or server.Config could have pre- and post- middleware.

@gouthamve
Copy link
Contributor Author

Oh, I am not sure that'll help. Because AFAICS, the auth part comes here: https://github.com/weaveworks/cortex/blob/master/cmd/querier/main.go#L106-L109

@bboreham
Copy link
Collaborator

bboreham commented Aug 2, 2018

I don't see why it needs to be done that way. It is allowing non-authenticated access to /ring, but that doesn't seem essential.

@gouthamve
Copy link
Contributor Author

Looking into this again, https://github.com/weaveworks/common/blob/master/middleware/logging.go#L36 should inject the user-id into the context, not sure why it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants