Loading…
Transcript

Client interceptor

Server Interceptor

  • Calls Tracer.extract() to extract possible remote IDs from the network (HTTP Headers)
  • This return null as the context is not passed
  • Calls Tracer.buildSpan() to create new span
  • Populates span with the information from the adapter:
  • http.url = http://blabla.com
  • http.method = GET
  • propagation_type = HTTP
  • etc
  • Calls Tracer.buildSpan() to create new span
  • Tracer is aware of the thread context, so new span is child of Span [1]
  • Span is populated with the information about the request to be made:
  • http.url = mybackend.com
  • http.method = POST
  • propagation_type = HTTP
  • reference = child_of (sync call)
  • Calls Tracer.inject() to inject the ids of new client span into headers

Span [1]

  • id = 1
  • traceId = 1
  • parentId = 1
  • caller = false
  • tags, propagation type, etc

Span [2]:

  • id = 2
  • traceId = 1
  • parentId = 1
  • caller = true
  • ....

Server interceptor

  • As context is passed over the network, this time Tracer.extract() returns the context of the calling span
  • Thus new created span is the child of that one
  • Other information as tags, propagation, etc is also added to span

Span [3]:

  • id = 3
  • trace = 1
  • parent = 2
  • caller = false
  • tags, etc...

Front-End JVM

servlet()

Remote Server Hook - Before body

Span [1] (id = 1, trace = 1, parent = 1)

Backend JVM

http://...

Remote Server Hook - Before Body

Remote Client Hook - Before Body

Span [3] (id = 3, trace = 1, parent = 2)

Span [2] (id = 2, trace = 1, parent = 1)

inspectit-id=2, inspectit-trace=1

Remote Server Hook - After Body

Hook transforms the finished span and

adds it to the core service for sending to

the CMR

Both after bodies are executed and spans are finished inside of the interceptors. Then spans are transformed to inspectIT like format and added to the core service for sending to the CMR

Server interceptor

  • Calling the interceptor also on finish to pick up information that is available after the request like status code
  • Finishes the spans which sets the duration correctly