Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Make it possible to draw diagrams of dependencies between services #79

Closed
marcingrzejszczak opened this issue Nov 5, 2014 · 6 comments · Fixed by #143
Closed

Make it possible to draw diagrams of dependencies between services #79

marcingrzejszczak opened this issue Nov 5, 2014 · 6 comments · Fixed by #143
Assignees
Milestone

Comments

@marcingrzejszczak
Copy link
Contributor

We would have to go around each of the microservices inside zookeeper and check their collaborators. Then repeat that recursively until we draw the full diagram of the dependencies.

@nurkiewicz
Copy link
Contributor

Ideas:

  1. Connect to Zookeeper in order to find all microservices in the environment (logical names and all instance URLs)
  2. Call /collaborators for each microservice to analyze availability and connectivity. We will get rich information like: which services are up and which connections are working. Bonus point: checking health endpoint
  3. Produce JSON representation of dependency graph and overall system status from information above. Either each microservice can expose such data or specialized microservice (?)
  4. Implement a simple JavaScript dashboard for drawing dependency graph, e.g. in D3.js. See: demo.
  5. JavaScript dashboard should update graph in real time.
  6. In JavaScript we can choose what type of information is shown (uptime, latencies, etc.)

@nurkiewicz nurkiewicz added this to the 0.7.3 milestone Dec 10, 2014
nurkiewicz added a commit that referenced this issue Dec 21, 2014
…low full introspection of all deployed microservices
nurkiewicz added a commit that referenced this issue Dec 21, 2014
…pring, should degrade and emulate new format
nurkiewicz added a commit that referenced this issue Dec 21, 2014
This can happen for very old versions of micro-infra-spring that do not support /collaborators.
Closes #79
@nurkiewicz
Copy link
Contributor

Currently open PR #143 introduces several improvements:

  1. /collaborators includes all instances (URLs) of my collaborators, not just random one chosen by Curator:

    curl -qs localhost:8095/collaborators | python -mjson.tool
    {
        "com/ofg/twitter-places-collerator": {
            "http://127.0.1.1:8096": "DOWN",
            "http://127.0.1.1:8097": "UP"
        }
    }
    
  2. /collaborators/all endpoint aggregates /collaborator responses from all instances of all microservices:

    curl -qs localhost:8095/collaborators/all | python -mjson.tool
    {
        "com/ofg/twitter-places-analyzer": {
            "http://127.0.1.1:8095": {
                "collaborators": {
                    "com/ofg/twitter-places-collerator": {
                        "http://127.0.1.1:8096": "DOWN",
                        "http://127.0.1.1:8097": "UP"
                    }
                },
                "status": "UP"
            }
        },
        "com/ofg/twitter-places-collerator": {
            "http://127.0.1.1:8096": {
                "collaborators": {},
                "status": "DOWN"
            },
            "http://127.0.1.1:8097": {
                "collaborators": {},
                "status": "UP"
            }
        },
        "com/ofg/social-engine": {
            "http://127.0.1.1:8098": {
                "collaborators": {
                    "com/ofg/twitter-places-analyzer": {
                        "http://127.0.1.1:8095": "UP"
                    }
                },
                "status": "UP"
            }
        }
    }
    
  3. /collaborators/view.html is a simple JavaScript view of data returned from collaborators/all:

    Graph image

    Red arrow means that connectivity between given two services is broken. Red circle represents unresponsive service. Notice that it's possible to have working (green) microservice but some connections to it broken. The opposite would be quite unusual.

  4. The API (especially ServiceResolve) was refined to always use service path (e.g. com/ofg/twitter-places-collerator) rather than aliases (collerator), which are local to each microservice and should never escape.

  5. Because changes to /collaborators aren't backward compatible, /collaborators/all has a fallback mode to work with older clients. If clients are so old that they don't support /colleborators (pre-0.5.3), meta-fallback is used that calls barely /ping.

I will place description above in Wiki once merged.

Areas to improve:

  1. Use Hystrix to parallelize /collaborators invocations of each instance (now calling /collabortors/all can take significant time as it traverses instances one by one). Also hystrix will automatically apply timeout. Make sure each microservice uses separate thread pool
  2. Automatically refresh JavaScript view when services come and go. Brute-force - periodic refresh. Elegant: listening on ZK changes and pushing data from client to server.

nurkiewicz added a commit that referenced this issue Dec 22, 2014
@mchmielarz
Copy link
Contributor

+1

@marcingrzejszczak
Copy link
Contributor Author

Definitely +1 :)

@nurkiewicz
Copy link
Contributor

I'm looking for a review, not applause :-).

@marcingrzejszczak
Copy link
Contributor Author

Don't flatter yourself :P I think that those +1 are written after a review and not before it ;)

nurkiewicz added a commit that referenced this issue Dec 30, 2014
…low full introspection of all deployed microservices
nurkiewicz added a commit that referenced this issue Dec 30, 2014
…pring, should degrade and emulate new format
nurkiewicz added a commit that referenced this issue Dec 30, 2014
This can happen for very old versions of micro-infra-spring that do not support /collaborators.
Closes #79
nurkiewicz added a commit that referenced this issue Dec 30, 2014
nurkiewicz added a commit that referenced this issue Dec 30, 2014
[#79] Drawing diagram of all microservices
nurkiewicz added a commit that referenced this issue Dec 30, 2014
…low full introspection of all deployed microservices
nurkiewicz added a commit that referenced this issue Dec 30, 2014
nurkiewicz added a commit that referenced this issue Dec 30, 2014
This can happen for very old versions of micro-infra-spring that do not support /collaborators.
Closes #79
nurkiewicz added a commit that referenced this issue Dec 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants