@@ -129,15 +129,15 @@ A reactive chain can be observed via the `tap` operator and `Micrometer.observat
129
129
----
130
130
listenToEvents()
131
131
.name("events") // <1>
132
- .tap(Micrometer.observation( // <2>
133
- applicationDefinedRegistry)) // <3>
134
132
.doOnNext(event -> log.info("Received {}", event))
135
133
.delayUntil(this::processEvent)
134
+ .tap(Micrometer.observation( // <2>
135
+ applicationDefinedRegistry)) // <3>
136
136
.retry()
137
137
.subscribe();
138
138
----
139
139
<1> The `Observation` for this pipeline will be identified with the "events" prefix.
140
- <2> We use the `tap` operator with the `observation` utility.
140
+ <2> We use the `tap` operator with the `observation` utility, making an anonymous `observation` available to upstream operators .
141
141
<3> A registry must be provided into which to publish the observation results. Note this is an `ObservationRegistry`.
142
142
143
143
The detail of the observation and its tags is provided in xref:metrics-details.adoc#micrometer-details-observation[Micrometer.observation()].
@@ -160,22 +160,22 @@ with your own Observation supplier, as follows:
160
160
----
161
161
listenToEvents()
162
162
.name("events") // <1>
163
+ .doOnNext(event -> log.info("Received {}", event))
164
+ .delayUntil(this::processEvent)
163
165
.tap(Micrometer.observation( // <2>
164
166
applicationDefinedRegistry, // <3>
165
167
registry -> Observation.createNotStarted( // <4>
166
168
myConvention, // <5>
167
169
myContextSupplier, // <6>
168
170
registry)))
169
- .doOnNext(event -> log.info("Received {}", event))
170
- .delayUntil(this::processEvent)
171
171
.retry()
172
172
.subscribe();
173
173
----
174
174
<1> The `Observation` for this pipeline will be identified with the "events" prefix.
175
- <2> We use the `tap` operator with the `observation` utility.
175
+ <2> We use the `tap` operator with the `observation` utility, making a custom `observation` available to upstream operators .
176
176
<3> A registry must be provided into which to publish the observation results. Note this is an `ObservationRegistry`.
177
177
<4> We provide our own function to create the Observation
178
178
<5> with a custom `ObservationConvention`
179
179
<6> and a custom `Supplier<Context>`.
180
180
181
- include::metrics-details.adoc[levelOffset=1]
181
+ include::metrics-details.adoc[levelOffset=1]
0 commit comments