Friday, September 18, 2026
HomeGolangBehind the Scenes: How the OpenTelemetry Plugin Maps Your Microservices in Actual-Time

Behind the Scenes: How the OpenTelemetry Plugin Maps Your Microservices in Actual-Time


All Issues Internet
Backstage
Growth
GoLand
IntelliJ IDEA
IntelliJ Platform
Plugin Highlights
Plugins
PyCharm
Analysis
Rider
WebStorm

We’ve all been there: you be part of a brand new challenge, and the very first thing you ask for is the structure diagram. You’re handed a diagram that appears nice, however after every week of debugging, you notice it’s six months old-fashioned. Service A hasn’t talked to Service B because the spring, and there’s a brand new message queue no one bothered to doc.

Determining how a posh system really suits collectively is a traditional engineering headache. You may attempt to determine it out manually (when you’ve got religion in your self and sufficient time to spare), or you should use static evaluation to discover the codebase (which frequently fails to seize how companies are literally wired collectively at runtime).

However there’s a 3rd approach: dynamic evaluation. What if we may simply watch the system run and draw the map primarily based on what is definitely taking place?

Because the OpenTelemetry plugin is already amassing a wealth of runtime information – logs, metrics, and traces – we realized we had the right alternative to auto-generate this structure map for you. Right here’s a glance underneath the hood on the Service Map function, constructed as a part of a collaboration between the Rider Execution staff and Software program Engineering Analysis.

The magic ingredient: traces

In case you’re accustomed to observability, you already know the “three pillars”: logs, metrics, and traces.

Whereas logs let you know what occurred and metrics let you know how a lot, traces present you the journey of a request by your system. Traces are made up of particular person items of labor referred to as spans.

As a result of OpenTelemetry standardizes these spans (as an illustration, explicitly defining HTTP Shopper and HTTP Server spans), they’re the final word cheat code for understanding system structure. Counting on the OpenTelemetry normal means the plugin can visualize your system utterly independently of your expertise stack, so long as your app and libraries emit spans the way in which OTel expects.

Constructing a map from traces has one large benefit: it’s the supply of runtime fact. We aren’t guessing primarily based on supply code or outdated specs. We’re information generated by the dwell system.

The way it works

So, how does this really work inside your JetBrains IDE?

If you begin your IDE with OpenTelemetry plugin enabled, the plugin begins a light-weight native OpenTelemetry backend that may course of your software telemetry information. 

If you hit Run in your IDE: 

  1. Plugin offers normal OTel setting variables to the appliance, so it is aware of that information needs to be despatched to the native backend.
  2. Your app (already configured to emit spans) begins sending telemetry information to our native backend.
  3. The backend asynchronously crunches these incoming spans, repeatedly constructing and updating an inside mannequin of your structure.
  4. If you click on on the Service Map tab, the OpenTelemetry plugin fetches the newest structural mannequin from the backend and renders the visible diagram.

The messy actuality of telemetry information

In case you have a look at an structure diagram, it appears to be like static and orderly. However the stream of telemetry information producing that diagram is something however. Earlier than we may write an algorithm to attach the dots, we needed to remedy a number of hidden challenges:

Chaos within the wire 

Spans arrive utterly independently, and their order isn’t assured. A mother or father span may end and arrive after its youngster span has already been processed.

No end line 

A hint by no means explicitly says “I’m achieved.” At any given second, we will by no means be 100% certain {that a} late-arriving span isn’t about to indicate up.

Untyped payloads

OpenTelemetry doesn’t present a strictly typed model for every span sort. As a substitute, every span carries a key-value map with attributes that describe the semantics of the operation. We needed to deduce what sort of interplay they signify purely by inspecting their attributes.

The reconstruction algorithm

To deal with this asynchronous, out-of-order information, we constructed the structure reconstruction as a stream processing algorithm. As a substitute of ready round for a whole hint – which, as we simply established, is unattainable to ensure – we course of each span the second it arrives.

First we work out what we’re . We pull the essential metadata off the span, then examine its semantic attributes to categorise it: attributes resembling http.request.technique and http.response.status_code inform us it’s an HTTP name, whereas others level to a database question, a message queue interplay, and so forth.

Subsequent we ask which service emitted it. New service we haven’t seen? It goes on the map. Already there? We merge the brand new information in and replace its statistics.

Then comes the fascinating half: connecting the dots throughout service boundaries. A completely instrumented HTTP name has two sides: the calling service emits a CLIENT span, whereas the receiving service emits a SERVER span. The hint context travels with the request, so the downstream SERVER span is created as a toddler of the upstream CLIENT span.

So when an outgoing HTTP Shopper span exhibits up, we go on the lookout for its youngster on the server aspect. When an incoming HTTP Server span exhibits up, we search for the mother or father that referred to as it. If the associate span is already in our system, we draw (or replace) the connection between the 2 companies straight away. If it isn’t, we park the span in reminiscence and watch for its different half to reach. 

Other forms of dependencies require barely completely different guidelines. A database name is often represented by a single CLIENT span, so we infer the database node immediately from its semantic attributes. Messaging is extra diversified: producer and shopper operations could also be linked by a parent-child relationship or by span hyperlinks, relying on the messaging system and instrumentation. In each case, the backend processes spans as they arrive and incrementally enriches the map as extra proof turns into obtainable

That final step is what lets the plugin construct an correct, real-time map, even when the community delivers all the things late and out of order.

Service map displaying cross-service http communication and db entry.

This fashion we will course of and present you details about http requests, database requests and message queues.

Service map displaying cross-service communication by message queue (rabbit) and db entry.

As a result of the map is constructed from normal OpenTelemetry spans and the reconstruction algorithm depends on semantic conventions somewhat than framework-specific APIs, the function is language- and vendor-agnostic. The identical logic works throughout JVM, .NET, Python, Go, and different OpenTelemetry-instrumented functions, so long as their instrumentation emits the anticipated spans and propagates context appropriately. This additionally means you should use the function within the JetBrains IDE that most closely fits your stack, together with IntelliJ IDEA, GoLand, PyCharm, WebStorm, and Rider.

See your individual structure

Wish to see your individual structure mapped out in real-time? Anticipated one HTTP name or database question, however the diagram exhibits a number of? Discovering that in improvement provides you time to repair it earlier than launch.

You may set up the OpenTelemetry plugin proper now and cease guessing how your companies discuss to one another.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments