Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Highlight Micrometer.observation vs Micrometer.metrics difference #3862

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading