Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class CommandObservationContext extends RequestReplySenderContext<Object,

private RemoteServerAddress remoteServerAddress;

CommandObservationContext(int command, Object[] arguments) {
CommandObservationContext(int command, Object... arguments) {
super((carrier, key, value) -> {}, Kind.CLIENT);
this.command = command;
this.arguments = arguments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,15 @@ private final class ObservationConnection implements Connection {
public ReindexerResponse rpcCall(int command, Object... args) {
CommandObservationContext context = new CommandObservationContext(command, args);
context.setRemoteServiceAddress(url);
Observation observation = Observation.createNotStarted(CONVENTION, () -> context, registry).start();
try (Observation.Scope scope = observation.openScope()) {
Observation observation = Observation.createNotStarted(CONVENTION, () -> context, registry);
return observation.observe(() -> {
ReindexerResponse response = delegate.rpcCall(command, args);
context.setResponse(response);
if (response.hasError()) {
observation.error(ReindexerExceptionFactory.fromResponse(response));
}
return response;
} catch (Throwable t) {
observation.error(t);
throw t;
} finally {
observation.stop();
}
});
}

@Override
Expand Down
Loading