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 go-kit/metrics/provider to save us from dependency overload #177

Merged
merged 3 commits into from Feb 5, 2019

Conversation

jprobinson
Copy link
Contributor

At this point in time, everyone at NYT is either using Prometheus or OpenCensus + Stackdriver (or they should be)

To save us from requiring the entire world of dependencies behind go-kit/metrics/provider, including mgo, influxdb and all sorts of weird test clients, I'm removing:

  • The config/metrics package
  • server.Config.Metrics and replacing it with 3 fields for Prometheus specifically
  • All Timer and Counter implementations in server/metrics.go
  • References to kit/metrics/provider in the examples.

Copy link
Contributor

@fsouza fsouza left a comment

Choose a reason for hiding this comment

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

🚀 🚀 🚀

@coveralls
Copy link

coveralls commented Jan 31, 2019

Coverage Status

Coverage decreased (-1.8%) to 45.597% when pulling f74c9b4 on simpler-metrics into 27bac81 on master.

Copy link
Contributor

@oliver-nyt oliver-nyt left a comment

Choose a reason for hiding this comment

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

🐼 🐼 🐼

Copy link
Contributor

@darrenmcc darrenmcc left a comment

Choose a reason for hiding this comment

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

🍔

}), registeredPath, r.Method, s.mets).ServeHTTP(w, r)

registeredPath = strings.TrimPrefix(registeredPath, "/")
prometheus.InstrumentHandler(registeredPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

While you're changing this code, can you change this to use InstrumentHandlerWithOpts () with

SummaryOpts{
			Subsystem:   "http",
			ConstLabels: Labels{"handler": handlerName},
			Objectives:  map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.95: 0.005, 0.99: 0.001},
		}

This should add the 95%tile which will give us a better comparison number as it seems like a lot of teams use 95% instead of 90%tile or 99%tile.

Danke!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is done. Mind taking a look and verifying its what you want?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good - thanks!

prometheus.InstrumentHandlerWithOpts(prometheus.SummaryOpts{
Subsystem: "http",
ConstLabels: prometheus.Labels{"handler": registeredPath},
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.95: 0.005, 0.99: 0.001},
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@fsouza
Copy link
Contributor

fsouza commented Feb 5, 2019

🚀 🚀 🚀 🚀 🚀

@jprobinson jprobinson merged commit 30c33e4 into master Feb 5, 2019
@jprobinson jprobinson deleted the simpler-metrics branch February 5, 2019 16:59
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.

None yet

5 participants