Distributed Tracing Context Propagation in Microservices

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Debugging errors in microservices-based cloud environments is challenging due to the large volume of logs without a standard format, making it difficult to identify the root cause of issues across multiple services.

Innovation Solution

Implementing distributed tracing, which follows a request through services in a distributed system to pinpoint exactly where a problem occurred, using a process that includes tracing and span diagrams to track requests and propagate context information between services.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If distributed tracing is implemented to track requests through microservices, then debugging efficiency and root cause identification speed are improved, but system complexity and implementation overhead increase

Engineering Contradiction:
Improvedebugging efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces a tracing system as an intermediary component that mediates between microservices and the logging infrastructure. This tracing system propagates context information through headers and enables centralized tracking without requiring fundamental changes to the microservices themselves, thus improving debugging efficiency while limiting the increase in system complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The tracing system is designed to be universal and multi-functional, serving multiple purposes including request tracking, error identification, performance monitoring, and dependency mapping. By consolidating these functions into a single tracing infrastructure, the system avoids the need for multiple separate debugging tools, thereby improving productivity without proportionally increasing complexity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Loss of time

If traditional logging processes are used to track errors across microservices, then implementation simplicity is maintained, but time consumption and difficulty in identifying root causes increase

Engineering Contradiction:
Improvetime to identify root causeVSAvoiddebugging ease
Core Design Contradiction:
Loss of timeVSEase of operation

Solution Approach 1:

The tracing system performs preliminary actions by injecting trace context information into request headers at the beginning of the request lifecycle. This context is propagated through all microservice interactions in advance, enabling immediate root cause identification when errors occur, rather than requiring time-consuming manual log analysis afterward.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms by collecting and aggregating trace data from all microservices into a centralized logging system. This feedback loop provides real-time visibility into request flows and error locations, enabling rapid identification of root causes and improving debugging ease without sacrificing implementation simplicity.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12026036B2Distributed tracing in a microservices-based system
Publication Date: 2024.07.02 SAP SE
  • US12026036B2 patent drawing
  • US12026036B2 patent drawing
  • US12026036B2 patent drawing

AI summary

Disclosed herein are system, method, and computer program product embodiments for providing distributed tracing in a computing system comprising a plurality of microservices. An embodiment operates by transmitting, from a first microservice, a request associated with a task to a second microservice. The embodiment generates distributed tracing data associated with the request, comprising: propagating trace context associated with the request between the first microservice and the second microservice; propagating the trace context associated with the request between operators within the first microservice; and propagating the trace context associated with the request between functions within the first microservice or the second microservice. The embodiment receives, from the second microservice, a response associated with the task. The embodiment then ceases, at least based on the response, generating the distributed tracing data associated with the request.