mdawar / rq-exporter

Prometheus metrics exporter for Python RQ (Redis Queue).
MIT License
66 stars 29 forks source link

How to set multiple sentinels? #27

Closed caimaoy closed 1 year ago

caimaoy commented 1 year ago

In my system, I have multi-sentinels. How to set the environment "RQ_SENTINEL_HOST"?

https://github.com/mdawar/rq-exporter/blob/master/rq_exporter/utils.py#L48

This code support only one sentinel?

mdawar commented 1 year ago

The RQ_SENTINEL_HOST env variable can be a list of Sentinel hosts separated commas, for example host1,host2,host3 and the port will be set for all the hosts using RQ_SENTINEL_PORT which defaults to 26379.

Sorry this was not documented, I'll make sure to add this info to the readme.

caimaoy commented 1 year ago

@mdawar I think so. but my sentinels are not using the same port. They are using different ports.

mdawar commented 1 year ago

@caimaoy how do you think we should add support for multiple sentinel hosts with different ports?

I don't think we should pass the ports in a different env variable, the host string should have the ports included for each host host1:1234,host2:4567,host3:8910, what do you think?

mdawar commented 1 year ago

@caimaoy You can now use multiple Sentinel hosts with different ports using version v2.1.0.

For example: sentinel1,sentinel2:23680,sentinel3:23681 if the port is not specified like in sentinel1, then the port set with --sentinel-port or RQ_SENTINEL_PORT will be used which defaults to 26379.