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

Update webflux to Instrumenter API (and improvements/simplifications) #3798

Merged
merged 17 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Renames
  • Loading branch information
trask committed Aug 9, 2021
commit 72a27e3c3fd558fd5ceac460458161b9384d6b03
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.springframework.web.method.HandlerMethod;

public class HandlerTypeAttributeExtractor extends AttributesExtractor<Object, Void> {
public class ExperimentalAttributesExtractor extends AttributesExtractor<Object, Void> {

private static final AttributeKey<String> HANDLER_TYPE_ATTRIBUTE_KEY =
private static final AttributeKey<String> HANDLER_TYPE =
AttributeKey.stringKey("spring-webflux.handler.type");

@Override
protected void onStart(AttributesBuilder attributes, Object handler) {
attributes.put(HANDLER_TYPE_ATTRIBUTE_KEY, getHandlerType(handler));
attributes.put(HANDLER_TYPE, getHandlerType(handler));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class WebfluxSingletons {
GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, new WebfluxSpanNameExtractor());

if (SpringWebfluxConfig.captureExperimentalSpanAttributes()) {
builder.addAttributesExtractor(new HandlerTypeAttributeExtractor());
builder.addAttributesExtractor(new ExperimentalAttributesExtractor());
}

INSTRUMENTER = builder.newInstrumenter();
Expand Down