Skip to content

Commit

Permalink
[docs] Highlight Micrometer.observation vs Micrometer.metrics differe…
Browse files Browse the repository at this point in the history
…nce (#3862)

Related to #3424
  • Loading branch information
chemicL committed Aug 9, 2024
1 parent 102a7da commit 8e86d2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/modules/ROOT/pages/metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ listenToEvents()

The detail of the observation and its tags is provided in xref:metrics-details.adoc#micrometer-details-observation[Micrometer.observation()].

WARNING: The set of meters collected with
xref:metrics-details.adoc#micrometer-details-observation[`Micrometer.observation()`]
differs from the set of meters that
xref:metrics-details.adoc#micrometer-details-metrics[`Micrometer.metrics()`] provides.
`Micrometer.observation()` covers the lifecycle of an entire reactive chain, while
`Micrometer.metrics()` provides some insight into individual signals within the chain.
Due to the generic nature of `Micrometer.observation()` (like providing traces aside
from metrics) it might require wrapping unitsof work, like `Mono.just(processedItem)`
and observing a sub-chain using a `flatMap`-like operator.

You can also fully customize Micrometer's Observation via
`Micrometer.observation(ObservationRegistry registry, Function<ObservationRegistry, Observation> observationSupplier)`
with your own Observation supplier, as follows:
Expand Down

0 comments on commit 8e86d2f

Please sign in to comment.