You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-148 - Overhaul of the reference documentation ob actuators and observability.
Renamed top-level section to "Production-ready features" to align with Spring Boot. Moved actuator support before observability one. Introduced introductory section to showcase the Insight starter.
Copy file name to clipboardExpand all lines: src/docs/asciidoc/80-observability.adoc
+45-18Lines changed: 45 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,35 @@
1
-
[[observability]]
2
-
= Observing Application Modules
3
-
:imagesdir: images
1
+
[[production-ready]]
2
+
= Production-ready Features
4
3
5
-
The interaction between application modules can be intercepted to create Micrometer spans to ultimately end up in traces you can visualize in tools like https://zipkin.io/[Zipkin].
6
-
To activate the instrumentation add the following runtime dependency to your project:
4
+
Spring Modulith provides support to expose architectural information about your system as a Spring Boot actuator endpoint as well as observing the interaction between application modules by capturing metrics and traces.
5
+
As a production-ready application is likely to require both, the most convenient way to activate those features is to use the Spring Modulith Insight starter as follows:
This will cause all Spring components that are part of the application module's API being decorated with an aspect that will intercept invocations and create Micrometer spans for them.
19
-
A sample invocation trace can be seen below:
18
+
This will include the actuator and observability support as well as Spring Boot's actuator startup for general support for actuators.
19
+
Note, that you will still have to add further dependencies to connect your application to your monitoring tools such as https://zipkin.io/[Zipkin], https://docs.wavefront.com/[Wavefront] etc. usually via https://opentelemetry.io/[OpenTelemetry] or https://github.com/openzipkin/brave[Brave].
20
+
Find more information on that in https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.micrometer-tracing[the corresponding section] of Spring Boot's reference documentation.
20
21
21
-
.A sample module invocation trace
22
-
image::observability.png[]
23
-
24
-
In this particular case, triggering the payment changes the state of the order which then causes an order completion event being triggered.
25
-
This gets picked up asynchronously by the engine that triggers another state change on the order, works for a couple of seconds and triggers the final state change on the order in turn.
@@ -50,6 +46,7 @@ To enable the actuator, add the `spring-modulith-actuator` dependency to the pro
50
46
51
47
Running the application will now expose an `applicationmodules` actuator resource:
52
48
49
+
.Accessing the actuator HTTP resource
53
50
[source, json]
54
51
----
55
52
GET http://localhost:8080/actuator
@@ -79,6 +76,7 @@ GET http://localhost:8080/actuator
79
76
80
77
The `applicationmodules` resource adheres to the following structure:
81
78
79
+
.The JSON structure of the application modules actuator
82
80
[%autowidth.stretch]
83
81
|===
84
82
|JSONPath|Description
@@ -93,6 +91,7 @@ The `applicationmodules` resource adheres to the following structure:
93
91
94
92
An example module arrangement would look like this:
95
93
94
+
.An example response for the application modules actuator
96
95
[source, json]
97
96
----
98
97
{
@@ -110,6 +109,34 @@ An example module arrangement would look like this:
110
109
} ]
111
110
}
112
111
}
112
+
----
113
113
114
+
[[production-ready.observability]]
115
+
== [[observability]]Observing Application Modules
116
+
:imagesdir: images
117
+
118
+
The interaction between application modules can be intercepted to create Micrometer spans to ultimately end up in traces you can visualize in tools like https://zipkin.io/[Zipkin].
119
+
To activate the instrumentation add the following runtime dependency to your project:
NOTE: You will have to configure additional infrastructure dependencies depending on the tooling you want to pipe the observability metadata in.
133
+
For details, please check the corresponding https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.micrometer-tracing[Spring Boot documentation] on which dependencies to include for your setup.
134
+
135
+
This will cause all Spring components that are part of the application module's API being decorated with an aspect that will intercept invocations and create Micrometer spans for them.
136
+
A sample invocation trace can be seen below:
137
+
138
+
.A sample module invocation trace
139
+
image::observability.png[]
140
+
141
+
In this particular case, triggering the payment changes the state of the order which then causes an order completion event being triggered.
142
+
This gets picked up asynchronously by the engine that triggers another state change on the order, works for a couple of seconds and triggers the final state change on the order in turn.
0 commit comments