Skip to content
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

Feature Request: Make logging to DDNoopRUMMonitor louder #978

Closed
dfed opened this issue Aug 23, 2022 · 3 comments
Closed

Feature Request: Make logging to DDNoopRUMMonitor louder #978

dfed opened this issue Aug 23, 2022 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@dfed
Copy link
Contributor

dfed commented Aug 23, 2022

Background

Today, accidentally logging user actions or errors to the DDNoopRUMMonitor does not alert developers of API misuse – developers are only warned when startView events are propagated to it.

When an engineer accidentally retains an instance of Global.rum prior to running Global.rum = RUMMonitor.initialize(), they capture a DDNoopRUMMonitor instance. If an engineer then logs a user action or error to this rum instance, no warnings appear in the console, and of course no logs appear in DataDog dashboards either.

The baseline request

Update DDNoopRUMMonitor to alert a developer that they are misusing the DataDog SDK when any event (and not just startView) is sent to the DDNoopRUMMonitor. I'd be happy to put up a PR to accomplish this if the proposal is well received by maintainers.

The stretch request

Given that console logs might get lost in apps that log a lot to the console, and that errors routed to a Global.rum instance are explicitly high-priority events, ideally DDNoopRUMMonitor's addError implementation would trigger an assertionFailure(...). Again, I'd be happy to put up a PR to accomplish this if the proposal is well received by maintainers.

@ncreated ncreated self-assigned this Sep 20, 2022
@ncreated
Copy link
Member

Hello @dfed 👋 and sorry for late response. What you propose totally makes sense. We should enhance DDNoopRUMMonitor to uniformly report all misuses, not only startView.

Update DDNoopRUMMonitor to alert a developer that they are misusing the DataDog SDK when any event (and not just startView) is sent to the DDNoopRUMMonitor. I'd be happy to put up a PR to accomplish this if the proposal is well received by maintainers.

Sounds good 👍, we'll be happy to receive such PR 🙂.

Given that console logs might get lost in apps that log a lot to the console, and that errors routed to a Global.rum instance are explicitly high-priority events, ideally DDNoopRUMMonitor's addError implementation would trigger an assertionFailure(...). Again, I'd be happy to put up a PR to accomplish this if the proposal is well received by maintainers.

I get the idea, especially that (by default) assertions are disabled in Release builds. However, as convention in all similar places we only report things as error log when Datadog.verbosityLevel is set. Given that we actively work on SDK 2.x, where most things will be centralised, I'd recommend to wait with this improvement - we will consider adding it for 2.x.

@ncreated ncreated added the help wanted Extra attention is needed label Sep 20, 2022
@dfed
Copy link
Contributor Author

dfed commented Sep 20, 2022

Sounds great! I've opened #1007 to cover the baseline request. I have no qualms if you would like to close this issue after #1007 lands, though I am hoping that 2.x gets this stretch request 🙂

@maxep
Copy link
Member

maxep commented Sep 21, 2022

Thank you again @dfed for your contribution. This will land in 2.x when we migrate the RUM monitor 👍

@maxep maxep closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants