-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Configure Finch pools #169
Conversation
@@ -129,6 +129,9 @@ defmodule PromEx.Config do | |||
- Git SHA of the last commit (if the GIT_SHA environment variable is present) | |||
- Git author of the last commit (if the GIT_AUTHOR environment variable is present) | |||
|
|||
* `:finch_pools` - (optional) A map that will be passed to Finch.start_link/1 as the :pools key, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for finch_pools
rather than finch: [ pools: ... ]
for two reasons:
Finch.start_link/1
only defines two options:name
andpools
. If they add more options at some point, this could get messy - but if that happened, we could consider changing this to justfinch
.- More importantly,
PromEx.grafana_client_child_spec/4
passes:name
toGrafanaClient.child_spec/
, which passes it to Finch.
This would lead to some ambiguity if you did e.g. finch: [ name: MyApp, pools: %{ ... }]
.
It's possible to address - maybe just set a default name if the Finch options key doesn't exist. I just don't know that it's worth it at this point.
finch: [ pools: ... ]
is more future-proof though, and I think would be straightforward to do.
Any preference on which it should be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way that you have it now it fine given that finch doesn't provide any other configuration options that need to be leveraged. Will merge in as soon as CI passes :)
Change description
This adds a
finch_pools
key to the Grafana config, to be passed as thepools
key toFinch.start_link/1
.What problem does this solve?
We connect to our Grafana instance over an HTTP proxy. Configuring a proxy in Finch requires passing connection opts to the underlying Mint library.
Example usage
Additional details and screenshots
This bumps the Finch dependency, because v0.12.0 adds "support for
Mint.UnsafeProxy
connections". I opted to bump to the latest 0.13.0.Checklist