kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.56k stars 535 forks source link

Adding prom metrics handler #14

Closed jrnt30 closed 6 years ago

jrnt30 commented 6 years ago

In prep for your TGIK demo, if you wanted to have something simple in KUARD to expose metrics with... This is really just a hammer to add in prom metrics exposed on :8080/metrics. As you see it wraps every endpoint.

Additionally, it does not attempt to match on the actual pattern of the URL and instead uses the URL. This in reality is not a good practice as Prometheus does not scale well with super high cardinality data.

Essentially just plagiarizing content from https://youtu.be/TJLpYXbnfQ4?list=PLxlCI-LN9VxoOd4bPaWytkfgHo7qyregA as I found it very useful

jbeda commented 6 years ago

Love it! Thanks!