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

[OPIK-130] Add anonymous usage information #316

Merged
merged 13 commits into from
Sep 30, 2024

Conversation

thiagohora
Copy link
Contributor

@thiagohora thiagohora commented Sep 26, 2024

Details

Add a log table to report the first start-up as a BI event.

Issues

OPIK-130

Resolves #

Testing

Via automated tests

Documentation

By default, the report is enabled, but the user can disable it via OPIK_REPORTING_ENABLED

@thiagohora thiagohora self-assigned this Sep 26, 2024
@thiagohora thiagohora force-pushed the OPIK-130/add_anonymous_usage_information branch from 8a3afe6 to 0f4c577 Compare September 26, 2024 08:16
@thiagohora thiagohora force-pushed the OPIK-130/add_anonymous_usage_information branch from 0f4c577 to d278247 Compare September 26, 2024 08:24
apps/opik-backend/config.yml Outdated Show resolved Hide resolved
@thiagohora thiagohora force-pushed the OPIK-130/add_anonymous_usage_information branch from 6468b7e to 414e280 Compare September 26, 2024 09:39
@thiagohora thiagohora marked this pull request as ready for review September 26, 2024 09:41
@thiagohora thiagohora requested a review from a team as a code owner September 26, 2024 09:41
@thiagohora thiagohora force-pushed the OPIK-130/add_anonymous_usage_information branch from dd525e8 to a57e678 Compare September 26, 2024 15:27
Copy link
Collaborator

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a functional implementation, but there are a few things to polish and others to discuss before moving forward.

Additionally, we need to make sure that this would work perfectly fine if it was enabled in our environments by counting them as installations. This won't be the case, but ensures a robust installation.

Finally, the implementation has to make clear that the inner tables are just for functionality purposes such as tracking if the event was sent or not and to persist the anonymous ID once it's generated the first time. So it should be clear that the real usage isn't and can't be tracked on those tables and that it's actually in the server receiving the client events.

@thiagohora thiagohora force-pushed the OPIK-130/add_anonymous_usage_information branch from b99925f to 1ae8e20 Compare September 27, 2024 10:38
Nimrod007
Nimrod007 previously approved these changes Sep 30, 2024
}

if (appContextConfig.usageReportEnabled()) {
list.add("usageReport.enabled: true");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this shouldn't be hardcoded to true.

@andrescrz
Copy link
Collaborator

I left my previous review. Things we have to check and agree on before moving forward:

  • Assure listener callback goes on a separated thread, so it isn't blocking app start-up.
    • If not, make sure clients (HTTP etc.) properly timeout and move the logic to a separated Executor.
  • UUID v4 for the anonymous ID.
  • Event storage as just an insertion vs insert and update.
    • Related to that, review timestamp fields.
  • Metadata enum fix.
  • Comments on the testing approach and configuration.

Everything else is minor and not a blocker.

Nimrod007
Nimrod007 previously approved these changes Sep 30, 2024
andrescrz
andrescrz previously approved these changes Sep 30, 2024
Copy link
Collaborator

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment to improve in the future, but LGTM. Thanks for putting this together.

try {
lockService.executeWithLock(lock, tryToReportStartupEvent(eventType))
.subscribeOn(Schedulers.boundedElastic())
.block();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: maybe in this case it's recommended to have a timeout. We don't in resource calls as we have both REST server side and client side timeouts, but this call path is different.

@thiagohora thiagohora dismissed stale reviews from andrescrz and Nimrod007 via 50652fd September 30, 2024 13:23
@thiagohora thiagohora merged commit 0cc1242 into main Sep 30, 2024
7 checks passed
@thiagohora thiagohora deleted the OPIK-130/add_anonymous_usage_information branch September 30, 2024 13:27
dsblank pushed a commit that referenced this pull request Oct 4, 2024
* [OPIK-130] Add anonymous usage information

* PR review

* Add body check

* Update config.yml

* Update ApplicationStartupListener.java

* Fix response

* Add services and DAO and extracting installation report to a service

* Address PR review comments

* Add documentation and timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants