WIP get service and pod metrics via our prometheus scraper #204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This isn't quite ready yet, but it brings in the latest service and pod metrics functionality from the upstream prometheus scraper:
https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml
Since our prometheus is not
in-cluster
, we have to get svc/pod metrics via the load balancer. I lifted relabeling configs to do this from the following gist:https://gist.github.com/sacreman/b61266d2ec52cf3a1af7c278d9d93450
It's still not quite right though:
As an example into the red, see what prometheus is effectively trying to do for the
nginx-ingress
pod:You might say, "oh hey, just stop trying to hit pod:443 and you'll get past this". I'd be like, "OK", and then show you this:
We do have some green, which makes me think we're on the right track. It could be some of these things are not producing metrics, or we're looking for them in the wrong place (maybe not proxied how we expect). I wanted to put this up to solicit ideas from anyone who may know how to scrape pods/services from a prometheus that is not
in-cluster
.NOTE: to even get what we have now, we have to annotate pods and services so that the scraper sees them from the api server: