Help with API scraping


I’m trying to use the API for two things:

  1. Get the old behavior of #each (show all services, not just active ones) for Prometheus (you don’t want nodes to be removed from monitoring / alerting when the supervisor stops on a node)
  2. Get some information to feed into Prometheus (hopefully this can go back in-core at some stage)

For the first one I get all the .service.list. entries and then remove all the .departure.list.departure entries. This works well.

For the second one I’m trying to identify the following:

  • total number of supervisors running a service (the service appears in hab sup status)

I can’t for the life of me seem to find a way of identifying this.

I can get the list of all services, and I can count the supervisor ids which are listed - but I can’t find a way of identifying supervisors which are no longer running the service so I can exclude them.

Am I just looking in the wrong place??

Got this working!


Actually not working :frowning:

Would you expect to be able to locate running services from /census or /butterfly ?

Does the /services endpoint have the information you need?

It does, but then I have to contact all the supervisors individually.

I was under the assumption service state changed was gossiped when I wrote this - I was wrong!