I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.
Is there any way to run a check on only one subscriber of a group of subscribers?
This may be a naive question, but is there a leader in your cluster? Often pools/clusters are fronted by a virtual IP to provide failover capability. If your check runs on the Sensu server and uses the “source” attribute (see https://sensuapp.org/docs/latest/clients#jit-clients) and hits the VIP you can use that to gather your metrics. That way if the VIP fails over to another host, you won’t be stuck with a gap in the metrics. #shrug Not knowing anything about your cluster management or configuration, it’s hard to provide more specific advice.
I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.
Is there any way to run a check on only one subscriber of a group of subscribers?
I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.
Is there any way to run a check on only one subscriber of a group of subscribers?
Thanks guys,
I saw the roundrobin option in the docs Glenn linked, but it’s good that you pointed it out Justin for anyone that maybe glosses over it and misses it.
Glenn, no not a naive question. Clusters fronted by HAProxies with a VIP are common in my network. The JIT client is interesting, but I think in this instance the roundrobin works perfectly.
I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.
Is there any way to run a check on only one subscriber of a group of subscribers?
Actually, I wasn’t aware of the roundrobin option; I haven’t kept up with the new features. If I’d known I probably would have suggested it as well as it does appear to suit your use case better.
I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.
Is there any way to run a check on only one subscriber of a group of subscribers?