Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Create Prometheus Exporter #53

Merged
merged 8 commits into from
Jan 11, 2019
Merged

Create Prometheus Exporter #53

merged 8 commits into from
Jan 11, 2019

Conversation

TobyRet
Copy link
Contributor

@TobyRet TobyRet commented Jan 9, 2019

Add Prometheus exporter to the application.

This will allow us to create and capture application metrics which can then:

  • become searchable via Prometheus Querying.
  • generate alerts
  • graphed via Granfana

deploy/metrics.yaml Outdated Show resolved Hide resolved
deploy/metrics.yaml Outdated Show resolved Hide resolved
deploy/metrics.yaml Outdated Show resolved Hide resolved
@TobyRet TobyRet force-pushed the prometheus-metrics branch from b717acb to 2a7b817 Compare January 9, 2019 13:40
@TobyRet TobyRet changed the title [DO NOT MERGE] - Create service monitor for prometheus metrics Create Prometheus Exporter Jan 9, 2019
deploy/deployment.yaml Outdated Show resolved Hide resolved
@jennyd
Copy link
Contributor

jennyd commented Jan 10, 2019

@TobyRet and I just had a chat about this - main points to think about are:

  • running an exporter per replica rather than one for all of them, so we can get separate application metrics for each replica
  • we'd prefer to not have our metrics endpoint visible to everyone on the internet, but Prometheus still needs to be able to reach it - does that mean setting up auth on it?
  • docs/script for running the exporter in dev, so that we can easily see what our metrics are doing and work on adding new ones with confidence

@alkar
Copy link

alkar commented Jan 10, 2019

To be clear, I've recommended running this as a stand-alone Deployment only if the metrics are going to always be the same in each replica, thinking it might be easier to manage. It does not have to be done that way and it would be fine to export duplicate metrics from a number of replicas.

As @jennyd points out, if you want to export additional application metrics (eg. response times) then it's obviously preferable to export from the actual application, from each replica.

To prevent metrics from leaking to the internet, the most common design I've seen is to start another http listener on a separate port that is not exposed via the Ingress. Alternatively, if the app structure allows it, you can specify paths in the Ingress rules (eg. expose /api only ).

@jennyd
Copy link
Contributor

jennyd commented Jan 10, 2019

Also, it's definitely worth keeping an eye on prometheus/client_ruby#95 - if the official ruby client starts supporting pre-fork servers then we should consider switching over to use that 🎉

@TobyRet
Copy link
Contributor Author

TobyRet commented Jan 11, 2019

There is now one Prometheus client pre replica as discussed

@TobyRet TobyRet force-pushed the prometheus-metrics branch from 92ec875 to 7889b83 Compare January 11, 2019 09:23
@TobyRet TobyRet merged commit 019bcfe into master Jan 11, 2019
@TobyRet TobyRet deleted the prometheus-metrics branch January 11, 2019 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants