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

Add nullable to Observation.parentObservation #3532

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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