-
Notifications
You must be signed in to change notification settings - Fork 3
Structured Logging #43
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
base: main
Are you sure you want to change the base?
Conversation
|
@devSparkle How does "ClientRelay" works? |
|
@zhiyan114 first of all, thank you for your work! I've been studying the updated SDK documentation a bit. For us to remain in compliance with the documentation, this would have to be buffered in a layer between the logger and Transport, called the Telemetry Buffer, and then be sent over through The SentryClientRelay currently works only with the now deprecated There is also another question, about how we should handle separating client and server logs. To put it simply — this will require a significant upgrade to the package. |
On the client, I think it would entirely depend on the design of remoteEvent/Function. We could probably run a test to see if the client would perform better if the remote fire each event individually or in a batched manner. For the server, the only issue I can see is figuring out the best tradeoff between the size of the server buffer and number of endpoint request we make (maybe we could let the user to choose a value that fits their game or automatically scale based on some metrics like player count).
I believe all custom-defined attributes are filterable on the dashboard, so we could simply use that to identify if the log originate from client or server. Something like For now, you want me to finish other implementation and submit the PR (since I'd expect that it'll take a while for the re-write) or wait until the upgrade happens? For |
|
I'm perfectly happy with a patch release in the meantime! |
|
Everything looks good on my side. Here's a sample test code I've used: local SDK = game.ReplicatedStorage.SentrySDK
require(SDK):Init({
DSN= "DSN",
enableLogs= true,
beforeSendLog=function(e)
print("EVENT",e)
return e
end,
Integrations={}
})
warn("SERVER LOG AUTO CAPTURED!!")Client Script warn("CLIENT LOG AUTO CAPTURED!!")I did observe a (studio bug?) that causes |
|
This looks good! Did you account for logs generated by the SDK itself? We don't want to cause a loop. |
|
So users aren't suppose to use print/warn inside I tried to allow this behavior by dropping the log under I also do want to note that the fenv function is deprecated by roblox, but the alternative is just documenting this behavior and hoping users don't actually use print/warn inside that function. |
|
So, the problem is that using Wouldn't it be more viable to prefix output from our own code with |
|
It would, but the issue is that the loop would only occur if the user generates log content (calling print/warn) within Using I could probably still add that filtering just to drop any noisy log that's generated by the SDK itself, if any, but other than that, it's kind of a compromise we're taking here:
|
Resolves #33
Feature:
beforeSendLogoptLogServiceMessageOut.luauto support new logging system instead of using old, event-based message.SentryClientRelayto support client-side Structured Logging