How to query the regions a process group exists in?

Currently I am trying to setup a NATS process group (embedded in Go) in my app that will automatically cluster regions, and supercluster when there is multiple regions. I’m trying to use the private networking DNS to deduce if there are machines in multiple regions for my process group. However, there seems to be no way to do this without either:

  1. Query regions.<appname>.internal, then query <process_group>.process.<appname>.internal, then query every single region for their 6PNs using <region>.<appname>.internal to intersect that with the result from <process_group>.process.<appname>.internal.
  2. Query <process_group>.process.<appname>.internal and then intersect those results with _instances.internal to see if there is multiple regions for your process group.

It seems wrong to do all the queries of the first solution, and also wrong to query EVERY machine in an organization for the second solution. I wish that I could use vms.<appname>.internal except it also (or instead) return the 6PN in the CSV instead of the Machine ID as there is no way to intersect machine IDs with the result from <process_group>.process.<appname>.internal. Or better yet, something like <process_group>.process.regions.<appname>.internal

Any insight on if I’m missing something with the DNS options would be so helpful! If not, I’ll probably go with the second option as at least it’s bounded to just 2 requests whereas the first option could be a ton of requests if the app is running in a lot of regions.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.