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

removing _total prefix from nginx guage metrics #1912

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

noqcks
Copy link
Contributor

@noqcks noqcks commented Jan 17, 2018

What this PR does / why we need it: This fixes #1509. We want to be following best practices! https://prometheus.io/docs/practices/naming/

Which issue(s) this PR fixes:
Fixes #1509 and corrects #1910

Release note:

action required: Changed the names of default Nginx ingress prometheus metrics. If you are scraping default Nginx ingress metrics with prometheus the metrics changes are as follows
nginx_active_connections_total -> nginx_connections_total{state="active"}
nginx_accepted_connections_total -> nginx_connections_total{state="accepted"}
nginx_handled_connections_total -> nginx_connections_total{state="handled"}
nginx_current_reading_connections_total -> nginx_connections{state="reading"}
nginx_current_writing_connections_total -> nginx_connections{state="writing"}
current_waiting_connections_total -> nginx_connections{state="waiting"}

I'm not sure if we would like to remove the current_ prefix from the gauges if that's implied without some kind of total prefix, but I think this fixes the issues @discordianfish and @brancz had with #1910.

Side note: does this need some kind of release note action to notify people using these metrics since it could break their monitoring/alerting?

tagging @kubernetes/sig-instrumentation-pr-reviews for input.

@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 17, 2018
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

@noqcks: Reiterating the mentions to trigger a notification:
@kubernetes/sig-instrumentation-pr-reviews

In response to this:

What this PR does / why we need it: This fixes #1509. We want to be following best practices! https://prometheus.io/docs/practices/naming/

Which issue(s) this PR fixes:
Fixes #1509 and corrects #1910

NONE

I'm not sure if we would like to remove the current_ prefix from the gauges if that's implied without some kind of total prefix, but I think this fixes the issues @discordianfish and @brancz had with #1910.

tagging @kubernetes/sig-instrumentation-pr-reviews for input.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 17, 2018
@noqcks
Copy link
Contributor Author

noqcks commented Jan 17, 2018

/assign @brancz

@SuperQ
Copy link

SuperQ commented Jan 17, 2018

I would suggest removing current_, this is implied because metrics are always "current".

@SuperQ
Copy link

SuperQ commented Jan 17, 2018

I might actually reverse these metrics.

ingress_class_connections_reading

But, thinking more, is it valid to sum() up these metrics? So they should be labeled?

ingress_class_connections{state="reading"} X
ingress_class_connections{state="writing"} X
ingress_class_connections{state="waiting"} X

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 17, 2018
@piosz
Copy link
Member

piosz commented Jan 17, 2018

FYI @loburm

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 36.822% when pulling 0d93f20 on noqcks:correcting-metric-names into 8079322 on kubernetes:master.

@aledbf
Copy link
Member

aledbf commented Jan 17, 2018

Side note: does this need some kind of release note action to notify people using these metrics since it could break their monitoring/alerting?

We need to add a note in the breaking section of the release notes.
Before we merge this can you add a comment with the changes?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 17, 2018
@aledbf
Copy link
Member

aledbf commented Jan 17, 2018

@noqcks you can use gofmt -w -s internal/ingress/controller/metric/collector/nginx.go to fix the style issues
Also please squash your commits

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 17, 2018
@noqcks
Copy link
Contributor Author

noqcks commented Jan 17, 2018

Nice, thanks @aledbf

Ok. I updated this PR and I think it makes sense based on the feedback from @SuperQ

image

cc: @brancz @discordianfish

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 36.837% when pulling c9e0b6b on noqcks:correcting-metric-names into 07c2bb8 on kubernetes:master.

@aledbf
Copy link
Member

aledbf commented Jan 18, 2018

@noqcks please squash the commits

@aledbf
Copy link
Member

aledbf commented Jan 18, 2018

@noqcks is this PR ready to be reviewed/merged?

updating Go names to not use underscores

accidental tab autocomplete 🔪
@noqcks
Copy link
Contributor Author

noqcks commented Jan 18, 2018

squashed commits. ready for review @aledbf

@aledbf
Copy link
Member

aledbf commented Jan 18, 2018

@brancz @discordianfish please review
Thanks!

Copy link

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

@aledbf
Copy link
Member

aledbf commented Jan 18, 2018

@SuperQ sorry I forgot to add you in the comment :)
Thanks for the help and LGTM

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 36.88% when pulling fae55e8 on noqcks:correcting-metric-names into 5a16a7a on kubernetes:master.

@brancz
Copy link
Member

brancz commented Jan 19, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2018
@aledbf
Copy link
Member

aledbf commented Jan 19, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, brancz, noqcks

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2018
@aledbf aledbf merged commit 40718c3 into kubernetes:master Jan 19, 2018
@noqcks noqcks deleted the correcting-metric-names branch January 19, 2018 14:37
@discordianfish
Copy link
Contributor

Awesome, that was quick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make prometheus metric names follow best practices
9 participants