8000 Add notification metrics by tifayuki · Pull Request #2522 · distribution/distribution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add notification metrics #2522

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

Merged
merged 6 commits into from
Jun 28, 2019
Merged

Conversation

tifayuki
Copy link
Contributor

It adds notification related prometheus metrics, including:

  • total count for events/success/failure/error
  • total count for notification per each status code
  • gauge of the pending notification queue

Signed-off-by: tifayuki tifayuki@gmail.com

@codecov
Copy link
codecov bot commented Feb 13, 2018

Codecov Report

Merging #2522 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2522      +/-   ##
=========================================
+ Coverage   60.45%   60.5%   +0.04%     
=========================================
  Files         102     102              
  Lines        8001    8011      +10     
=========================================
+ Hits         4837    4847      +10     
  Misses       2517    2517              
  Partials      647     647
Flag Coverage Δ
#linux 60.5% <100%> (+0.04%) ⬆️
Impacted Files Coverage Δ
notifications/endpoint.go 94.44% <100%> (ø) ⬆️
notifications/metrics.go 97.14% <100%> (+0.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d3efad...92a6436. Read the comment docs.

@dmp42
Copy link
Contributor
dmp42 commented Mar 21, 2018

Same as the other PR.
Can we see the output?

Thanks.

@@ -10,4 +10,7 @@ const (
var (
// StorageNamespace is the prometheus namespace of blob/cache related operations
StorageNamespace = metrics.NewNamespace(NamespacePrefix, "storage", nil)

// NotificationNamespace is the prometheus namespace of notification related metrics
NotificationNamespace = metrics.NewNamespace(NamespacePrefix, "notification", nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pluralize this as notifications.

@tifayuki tifayuki force-pushed the notification_metrics branch from 0dfd56e to 636c645 Compare March 26, 2018 21:53
@tifayuki
Copy link
Contributor Author

An sample output is:

# HELP registry_notifications_events_total The number of total events
# TYPE registry_notifications_events_total counter
registry_notifications_events_total{type="Events"} 8
registry_notifications_events_total{type="Successes"} 8
# HELP registry_notifications_pending_total The gauge of pending events in queue
# TYPE registry_notifications_pending_total gauge
registry_notifications_pending_total 0
# HELP registry_notifications_status_total The number of status code
# TYPE registry_notifications_status_total counter
registry_notifications_status_total{code="200 OK"} 8

@stevvooe @dmp42

@mrueg
Copy link
mrueg commented Apr 12, 2018

@stevvooe any chance to take a look at this? would be great to have this change in.

@mrueg
Copy link
mrueg commented Aug 1, 2018

@dmcgowan @stevvooe friendly ping on this one :)

@manishtomar
Copy link
Contributor

@tifayuki Could you add endpoint label also to this PR?

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "notification_metrics" git@github.com:tifayuki/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354473512
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@tifayuki
Copy link
Contributor Author

@manishtomar I added the endpoint label. Can you take a look at it?

@manishtomar
Copy link
Contributor

@tifayuki Thanks! Code LGTM. Could you merge latest master and push it? I wonder if it will fix travis build.

@tifayuki tifayuki force-pushed the notification_metrics branch from 78ec108 to 99ce26e Compare October 15, 2018 10:25
@tifayuki tifayuki force-pushed the notification_metrics branch 2 times, most recently from 9f514b8 to a3d6f72 Compare October 15, 2018 12:28
@tifayuki
Copy link
Contributor Author

@manishtomar
I merged the upstream master to this PR. But on Travis, it always shows:

The command "export CGO_ENABLED=$TRAVIS_CGO_ENABLED" exited with 0.
0.23s$ DCO_VERBOSITY=-q script/validate/dco
/home/travis/gopath/bin/git-validation
 99ce26e - FAIL - has whitespace errors. See `git show --check 99ce26efeda8fc8661974a1d3edaab0740c2abc3`.
1 commits to fix
The command "DCO_VERBOSITY=-q script/validate/dco" exited with 1.

Any idea what error it is?

@manishtomar
Copy link
Contributor

@dmp42 Would you know why this is failing? The error is coming for not-recent commit. Should one squash into commit to fix it?

@mrueg
Copy link
mrueg commented Dec 13, 2018

@tifayuki can you rebase on master and see if the build still fails?

@tifayuki tifayuki force-pushed the notification_metrics branch from a3d6f72 to 5c66b57 Compare December 14, 2018 12:03
@tifayuki
Copy link
Contributor Author

@mrueg it worked

@mrueg
Copy link
mrueg commented Dec 14, 2018

@dmcgowan any chance to get this in for 2.7.1?

@manishtomar manishtomar added this to the Registry/2.7.2 milestone Jan 31, 2019
@manishtomar
Copy link
Contributor

@dmcgowan I added this in 2.7.2 milestone. Any chance this can be merged?

@dmcgowan
Copy link
Collaborator

LGTM

If you are going to open up a backport to 2.7 for this, please provide strong justification and show how it is not impactful for compatibility. Such a change in a patch release is very irregular, but I understand there is no 2.8 currently on the horizon.

@dmcgowan
Copy link
Collaborator

Can you squash this before merging? Will make cherry-picking cleaner

Copy link
Contributor
@manishtomar manishtomar left a comment

Choose a reason for hiding this comment

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

@tifayuki Sorry I just realized the mistake in the code. It is incrementing by 1 instead of len(events). Can you please address the mistake and put it up for review again?

@manishtomar
Copy link
Contributor

If you are going to open up a backport to 2.7 for this, please provide strong justification and show how it is not impactful for compatibility.

It does not impact compatibility. I originally wanted it in 2.7 release as this change is being used in Hub registry but missed the train. I thought we could get it in 2.7.1|2 release but I that was assuming that 2.7.x release will be based on master branch which is incorrect. Hence, please ignore my request to put this change in patch release. It can go in next release. I just wanted to get this merged. Also I apologize I just realized a mistake when looking at the code and have requested these. We can merge it after @tifayuki makes those changes. Thanks for your time!

@manishtomar
Copy link
Contributor

@tifayuki Thanks for the changes. However build is failing due to unsigned commits which was GH fault when accepting the suggestion. Could you please rebase with one signed commit? Also, you will need to put .Inc(float64(len(events))) to fix the lint error.

It adds notification related prometheus metrics, including:
  - total count for events/success/failure/error
  - total count for notification per each status code
  - gauge of the pending notification queue

Signed-off-by: tifayuki <tifayuki@gmail.com>
Signed-off-by: Honglin Feng <tifayuki@gmail.com>
Signed-off-by: Honglin Feng <tifayuki@gmail.com>
Signed-off-by: Honglin Feng <tifayuki@gmail.com>
@tifayuki tifayuki force-pushed the notification_metrics branch from e1663b8 to b0c2c80 Compare February 15, 2019 13:15
Signed-off-by: Honglin Feng <tifayuki@gmail.com>
Copy link
Contributor
@manishtomar manishtomar left a comment

Choose a reason for hiding this comment

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

LGTM with a comment. Thanks a lot for this.

Signed-off-by: Honglin Feng <tifayuki@gmail.com>
@manishtomar
Copy link
Contributor

@dmcgowan Can this be merged now please?

@thaJeztah
Copy link
Member

do we want some of the commits to be squashed before merging?

@manishtomar
Copy link
Contributor

@tifayuki Can you please squash commits?

@manishtomar
Copy link
Contributor
manishtomar commented Jun 21, 2019

Actually since this only needs to be merged and not cherry-picked it should be ok to squash during merge @dmcgowan . If thats ok can you or @caervs please merge this?

Copy link
Contributor
@caervs caervs left a comment

Choose a reason for hiding this comment

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

LGTM

@manishtomar
Copy link
Contributor

@caervs Can you please merge this?

@caervs caervs merged commit be07be9 into distribution:master Jun 28, 2019
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.

9 participants
0