DEV Community

Seito Tanaka
Seito Tanaka

Posted on

Visualizing Service Maps with Static Analysis

I created a new feature to visualize service maps on Inga. This tool can help the developer by visualizing impacted endpoints from code changes.
Now, I supported analysis for SOA (e.g., microservices), which can find relationships if they are separated from HTTP requests.

Inga service maps

How to Get Service Maps

Similar features have tools, for example, Codecov, CodeSee, and AppMap, which tools require runtime information, such as OpenTelemetry tracing data. The analysis approach for Inga does not require runtime information; it uses static code analysis only. Thus, safe as it does not require sensitive data on your system.
However, using static analysis has difficult challenges. If get relationships between services, the below info is required with servers and clients:

  • method (e.g., GET, POST..)
  • path (e.g., "/users/{id}")

For example, if you have the below client call, Inga found the getForObject API is a GET method and finds path definitions from uri variable references.

return restTemplate.getForObject(uri, User.class);
Enter fullscreen mode Exit fullscreen mode

In Java, there are many HTTP clients such as RestTemplate and WebClient, so it is difficult to support all APIs, but I believe that the number of commonly used client libraries is limited to some extent, so this analysis method is adopted.

Inga is still in beta, if you're interested, check out my Patreon 😄

GitHub:

Top comments (0)