Right pipeline to integrate plugins?

I would like to integrate Sentry and Elk with my project to monitor anything on the server side, including business layer logs, errors, and performance. The question is that Nakama does not provide a chain of responsibility for global error handling and input integration. What is the suggestion?

Should I make a wrapper method to simulate chain of responsibility in Nakama, or are there some standard ways?

Another use of the chain of responsibility is that I need to access the final model in my endpoint instead of checking input validation on every request. it’s the feature that frameworks like Gin and EF Core support.

Hello @virtouso

I believe there’s ways to integrate Sentry error reporting in your custom functions by listening to exceptions that aren’t handled and report them, but you’d need to do this from within your custom code as there’s no globally exposed custom error handler for Nakama errors.

For monitoring, you should use Prometheus, Nakama already exposes a lot of metrics by default but you can also emit custom ones from the runtimes.

I’m not sure what you mean with:

I need to access the final model in my endpoint instead of checking input validation on every request

Can you please clarify?

in ef core endpoint (called actions) i can write method like this:

public User GetUsers(string userId){
return users.find(userId)
}

i dont need to serialize or deserialize the payloads. to get the response and return it to the user. it can cause to cleaner and shorter code. i even can write my own filters before the message is received to the main handler.

i also can have post processors to catch what is the final result and if there is any error or not.

i know i can write my own chain of responsibility framework but its not clean and its much better for it to be part of the framework and not business layer code.

i know if I don’t add it i will have lots of repeating and boilerplate code for logging anytime if i want to handle and check for errors.

please also mention what logging service you suggest to log bussiness layer codes in nakama. is there any good sample for it? im testing loki and elk.