launchdarkly / node-server-sdk

LaunchDarkly Server-side SDK for Node
Other
79 stars 65 forks source link

Debug logs showing in the Live Events #287

Closed Raymond-Ly closed 11 months ago

Raymond-Ly commented 11 months ago

Describe the bug Debug logs are showing in the Live Events for Feature Flags. However, from the documentation in https://docs.launchdarkly.com/home/code/live-events#flag-events , it indicates that "Debug events describe feature flag evaluations when debugging mode is on in your SDK. But not how we could turn off debugging mode in the SDK."

Also passing diagnosticOptOut: true as a LaunchDarkly option to the client does not disable the debug logs.

To reproduce

  1. Use the latest version of this SDK.
  2. Setup a feature flag.
  3. Open up the Live Events view.
  4. Trigger the feature flag.
  5. Click Full fidelity details and you will see debug logs, each time you trigger the feature flag.

Expected behavior Debug logs shouldn't be in live events.

Logs If applicable, add any log output related to your problem.

SDK version 7.0.3

Language version, developer tools Node 18.16.1

kinyoklion commented 11 months ago

Clicking on "Full fidelity details" sends an update to the SDK adding a "debugEventsUntilDate" to the flag. This will cause it to temporarily generate debug events which you can view in "Live Events". The debug events are not being emitted unless you request it by clicking "Full fidelity details", it isn't just showing a different view of data it already has.

This is some example network traffic from a client SDK: image You can see if gets a put, but then I clicked "Full fidelity details" and the SDK received an update indicating that we are now interested in debug events for that flag.

If you are interested in inspecting this data yourself you could use the debugger, or examine your network traffic with something like ngrok.

We should have some documentation updates that clarify this soon.

Diagnostic events are unrelated to debug events and include things like the operating environment of the SDK, as well as diagnostic information about how many stream initialization occurred within a period of time.

Thank you, Ryan

Raymond-Ly commented 11 months ago

Thanks for explaining @kinyoklion . I did notice that from this documentation: https://docs.launchdarkly.com/home/data-export/schema-reference#event-kinds , is there no way of disabling the debug events?

kinyoklion commented 11 months ago

There is not a way to explicitly disable them, but they are generally speaking not enabled, until you use the event debugger to activate them.

Is there something specific you are trying to avoid by disallowing debug events?

Raymond-Ly commented 11 months ago

I see, thanks for confirming. We were trying to reduce the noise in the live events. However, like mentioned, the debug logs only appear if you click on "Full fidelity details".