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

Add observability #54

Open
buro9 opened this issue Mar 14, 2017 · 3 comments
Open

Add observability #54

buro9 opened this issue Mar 14, 2017 · 3 comments

Comments

@buro9
Copy link
Owner

buro9 commented Mar 14, 2017

Add as an observer middleware and observe all HTTP attributes, this will later be hooked to https://www.outlyer.com/ in production instances, and dev instances could always spin up prometheus and grafana containers to view it.

@yemble
Copy link
Collaborator

yemble commented Mar 15, 2017

Sniffing around this one. I've done prometheus from Go on another project so just learning a bit about how chi and middleware work.

@buro9
Copy link
Owner Author

buro9 commented Mar 15, 2017

I imagine we'd make a simple middleware that calls much of the existing middleware that Prometheus gives us: https://github.com/prometheus/client_golang/blob/master/prometheus/promhttp/http.go

We'd need to configure a gatherer that has the opts we want, specifically Prometheus labels that surface the HTTP Host, HTTP Method, HTTP Status and a normalised version of http.Req.URL.

This way the resulting metrics can be analysed using other systems so that it's possible to plot reports where data is grouped by HTTP Status (and if it's slow we can see that it's for the POSTs rather than the PUTs), and additionally we would know which templated paths were slow, i.e. /microcosms/{id} would be the normalised path for all forums. And of course, those who host multiple forums would need the host to be able to group data by that.

URL normalisation would simply be "find integers within the path part of the URL and replace them with {id}, strip the scheme, host and query so we just have the path".

@buro9
Copy link
Owner Author

buro9 commented Sep 4, 2022

Now I work at Grafana I want to change this ticket.

  • Add Prometheus histograms
  • Add logfmt logging
  • Add full tracing
  • Modify metrics, logging and tracing to enable exemplars (navigating between all three)
  • Add support for on-demand profiling

@buro9 buro9 changed the title Add prometheus /metrics endpoint Add observability Sep 4, 2022
@buro9 buro9 added this to the 5. Production readiness milestone Sep 9, 2022
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