Spring i/o: Deep and Brief Dive Into Causality

NeleUhlemann 109 views 45 slides Jun 11, 2024
Slide 1
Slide 1 of 45
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45

About This Presentation

Slides from my presentation at Spring i/o 2024:
https://2024.springio.net/sessions/navigating-the-complexities-of-service-to-service-invocations-deep-and-brief-dive-into-causality/


Slide Content

Navigating the Complexity of
Service to Service Invocation

Deep and Brief Dive Into
causality

Cause -> Effect

Spring i/0
-How did a talk Influence your Perspective?

-Which new Tool will you try out next week?

-Did any networking interaction lead to a
significant connection?

Causality in tech
High traffic -> increase latency SLO’s
Alerts
Business Problem

@nele_lea


@[email protected]
@nlea
Nele Lea Uhlemann

Call Graphs Traces Workflows

Call Graphs
Service A
Micrometer
Service B
Micrometer

Call Graph with a
Service Mesh
Service A
Envoy
Service B
Envoy

DEMO

Trace 1
Span 1.1
Span 1.2
Span 1.3
Span 1.4

Service A Service B Service C
Request
header
Request
header
Trace 1
Span 1.1 Span 1.2 Span 2.1 Span 2.2
Trace 2

Service A
Service B
Service C
Request
header
Request
header
Trace 1
Span 1.1 Span 1.2 Span 1.3 Span 1.4
Context
Propagation

Service A
Service B Service C
Service Invocation Besides HTTP
Message Broker

TRACES
Service A
Auto instrumentation
Manual
instrumentation

OpenTelemetry
Application
Instrument
Telemetry data
Query-,
alerting-,
visualization
Platform
Observibility
data backend

DEMO

Ice Cream Recommender
Recommen-
dation
Service
Location
Service
Weather
Service
AI Service
Kafka

Ice Cream Recommender
Recommen-
dation
Service
Location
Service
Weather
Service
AI Service
Kafka

Traces

Traces
Metrics
Logs
< Exemplars
Tags >
Trace ID
https://spring.io/blog/2022/10/12/observability-with-spring-boot-3

Where is my Ice Cream
Recommendation?

Workflows
User A
Service A
Activity BActivity A
Event

Ice Cream Recommender
Recommen-
dation
Service
Location
Service
Weather
Service
AI Service
Kafka

workflow
Recommendation
Workflow
Application
Location
Service
Get Weather
Activity
REcommender
Service
Request Geo
Data Activity
Request Recommendation
Activity
Geo data
received
Recommendation
received
Kafka

DEMO
Service A
+
Workflow
Service B

public class IceCreamRecommendationWorkflow extends Workflow {
@Override
public WorkflowStub create() {
return ctx-> {
Logger logger = ctx.getLogger();
String instanceId = ctx.getInstanceId();
logger.info("Instance ID: " + instanceId);

RecommendationPayload recommendationPayload = ctx.getInput(RecommendationPayload .class);
logger.info("Received recommendation request for: " +recommendationPayload .toString());
recommendationPayload .setWorkflowID(instanceId);

//Send Location name to Location Service
Location location = new Location();
location.setName(recommendationPayload .getLocation());
location.setWorkflowID(instanceId);
ctx.callActivity(RequestLocationDetailsActivity .class.getName(), location).await();
System.out.println("Workflow waits for geo Info" + instanceId);

//Wait for the geo information
Geodata geodata = null;
try {
geodata = ctx.waitForExternalEvent( "geoInformationRecieved" , Duration.ofDays(1), Geodata.class).await();
System.out.println("Workflow received geo Info " + instanceId);
} catch (TaskCanceledException e ) {
Recommendation norecommendation = new Recommendation();
norecommendation.setContent("Sorry we can't provide and recommendation for your location" );
ctx.complete(norecommendation);
}
//More things

ctx.complete(recommendation);

};
}
}

Same Same but Different

-Network Traffic
-Service to Service Invocation
-Based On traces
-Context propagation
-Outer Edges
-Observability
-Auto or Manual
Instrumentation
-Customize Span definitions
-Inside the application
Context
-Observability
-Application Design/ Build
-State Management
-Rollbacks, Timeouts etc
-Business Case

@nele_lea


@[email protected]
@nlea