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

Basic auth: add metrics #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

roidelapluie
Copy link
Member

Signed-off-by: Julien Pivotto [email protected]

https/users.go Outdated Show resolved Hide resolved
@roidelapluie
Copy link
Member Author

Ready for a second review, once that is in I will add metrics for the TLS part (or I can do in the same PR if you want)

u.failuresCounter = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "prometheus_toolkit",
Subsystem: "https",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https and basic auth are not the same thing

In general, it's better to have the metric name as a single string literal as it makes grepping and determining what the actual metric name is easier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed the metric. However I think that keeping namespace separated is better, it that's fine for you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred it named based on the package name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the package name?

Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
@roidelapluie
Copy link
Member Author

Would renaming the package to http help, like this?

Signed-off-by: Julien Pivotto <[email protected]>
@roidelapluie
Copy link
Member Author

I did not like the "http" package rename as it is too close with go's net/http.

I have reworked this to have a metric name: prometheus_toolkit_https_basic_authentication_failures_total which does not read as 'https_requests' anymore. does it sound better ?

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

Successfully merging this pull request may close these issues.

3 participants