Skip to content

Commit

Permalink
Add nullable to Observation.parentObservation (#3532)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttddyy authored and shakuzen committed Nov 14, 2022
1 parent 990e817 commit 7f42bb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Expand Up @@ -16,6 +16,7 @@
package io.micrometer.observation;

import io.micrometer.common.KeyValue;
import io.micrometer.common.lang.Nullable;

/**
* No-op implementation of {@link Observation} so that we can disable the instrumentation
Expand All @@ -39,12 +40,12 @@ private NoopObservation() {
}

@Override
public Observation contextualName(String contextualName) {
public Observation contextualName(@Nullable String contextualName) {
return this;
}

@Override
public Observation parentObservation(Observation parentObservation) {
public Observation parentObservation(@Nullable Observation parentObservation) {
return this;
}

Expand Down
Expand Up @@ -302,7 +302,7 @@ static <T extends Context> Observation createNotStarted(ObservationConvention<T>
* @param parentObservation parent observation to set
* @return this
*/
Observation parentObservation(Observation parentObservation);
Observation parentObservation(@Nullable Observation parentObservation);

/**
* Adds a low cardinality key value. Low cardinality means that this key value will
Expand Down
Expand Up @@ -85,7 +85,7 @@ public Observation contextualName(@Nullable String contextualName) {
}

@Override
public Observation parentObservation(Observation parentObservation) {
public Observation parentObservation(@Nullable Observation parentObservation) {
this.context.setParentObservation(parentObservation);
return this;
}
Expand Down

0 comments on commit 7f42bb7

Please sign in to comment.