I spent some time recently mucking around with neo4j attempting to model infrastructure, incidents, teams, users, etc. Basically what does it take to answer questions about organizations.

Getting neo4j set up with go was non trivial and thankfully someone had documented how to do it already (instructions in the readme: https://github.com/devshorts/graphql). In the sample API I exposed we can

  • Find related incidents. The pathway here is incidentA is failing because of infraA. incidentB is failing because of infraB. InfraB depends on some pathway that ends up infraA. This means that from InfraB -> InfraA there is a relationship, and so that implies that IncidentA and IncidentB are related.
  • Find betweeness of the graph. This shows graph nodes that have heavy flow (high connections) and can be potential hot spots
  • Find communities in the graph. This shows clusterability of infrastructure/teams/etc.

The API exposed in the github is meant to model dynamically creating incidents and adding semantic links. So for example, you can post an incident to the /incidents api and then add links to the incident (users/failing infra/etc) via the /links api. As you add links you can query for related incidents and then find pathways from your incident to another.

Pretty neat!

Included in the project is a way to build a sample graph: