Are there any hooks that could be used to track queries from a provider?

24 views
Skip to first unread message

Thomas Kolanko

unread,
Sep 23, 2022, 12:20:25 PM9/23/22
to Gremlin-users
Is it possible to track queries and if they succeed or their errors if the query failed as a provider? Are there any hooks to be able to get at this information?

One of the things we are looking at is adding a custom step to a traversal determine when a query ends but that doesn't help with understanding if/why a query failed.

We extend WebSocketChannelizer as our entry point and I tried something similar to:

public class CustomWebSocketChannelizer extends WebSocketChannelizer {
Consumer<Bindings> afterSuccessConsumer = value -> {
logger.info("In after success consumer");
};
GremlinExecutor gremlinExecutor = GremlinExecutor.build()
.executorService(serverGremlinExecutor.getGremlinExecutorService())
.afterSuccess(afterSuccessConsumer).create();

ServerGremlinExecutor sc = new ServerGremlinExecutor(
serverGremlinExecutor.getSettings(), gremlinExecutor.getExecutorService(),
gremlinExecutor.getScheduledExecutorService());

...rest of our init code ...
}


but as far as I can see the afterSuccess consumer never gets called when a query completes

Stephen Mallette

unread,
Sep 26, 2022, 7:06:27 AM9/26/22
to gremli...@googlegroups.com
I don't think there's anything quite like that in Gremlin Server. I think that there are GremlinExecutor lifecycle overrides which are probably preventing your special consumer from being used. I don't know all the requirements you are looking for but as I mentioned in your other thread, this might be something more easily achieved by adding the feature directly to Gremlin Server as a new improvement. 



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/3f152af0-d0dc-4f9b-8380-6ae102e68been%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages