Skip to content

Commit 22a81f0

Browse files
Add note to Observation#observationConvention about setting the convention
1 parent 3f0ca2f commit 22a81f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

micrometer-observation/src/main/java/io/micrometer/observation/Observation.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ default boolean isNoop() {
414414

415415
/**
416416
* Sets an observation convention that can be used to attach key values to the
417-
* observation. WARNING: You must set the ObservationConvention to the Observation
417+
* observation. Implementations should only set the convention when it supports (see:
418+
* {@link ObservationConvention#supportsContext(Context)}) the current
419+
* {@link Context}. WARNING: You must set the ObservationConvention to the Observation
418420
* before it is started.
419421
* @param observationConvention observation convention
420422
* @return this

0 commit comments

Comments
 (0)