add prometheus_exporter gem and feature flag#10287
Conversation
lib/feature_management.rb
Outdated
| def self.prometheus_exporter? | ||
| !Rails.env.test? && IdentityConfig.store.prometheus_exporter | ||
| end | ||
|
|
There was a problem hiding this comment.
instead of adding logic like this, would it be easier to just update the test: stanza of the sample application.yml to be false?
There was a problem hiding this comment.
Well, in the code example (https://github.com/discourse/prometheus_exporter?tab=readme-ov-file#rails-integration), they seem to not want it to be enabled for test stuff, so I was just copying what they were doing. I also was using the pattern I found in the log_to_stdout feature above it to implement that logic.
I'm not sure it's easier or not, but I was trying to do things the way other things are done. Would you like me to change this?
|
Does this need any configuration of where to export metrics to? |
Nope. It will export to localhost:9394, which is where the local exporter will run. You can see one being fired up in the Procfile, but in k8s, we'll make them be a sidecar. There will be no centralized exporter service, because at scale, it would fall over. We might need to add some special tags to the metrics so we know what version the code is or something, but I'll deal with that as we figure out what the best way to do the blue/green stuff is. |
|
I noticed this doesn't shut down very gracefully when Ctrl+C'ing to stop the server: |
I think we could remove it from the |
🛠 Summary of changes
This enables prometheus_exporter functionality in the idp, behind a feature flag, which is off by default.
It also updates the
cborgem version, since it would not compile on my machine.This functionality is to support metrics gathering that we can use in blue/green deploys.
📜 Testing Plan