-
Notifications
You must be signed in to change notification settings - Fork 131
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
Conversation
8a3afe6
to
0f4c577
Compare
0f4c577
to
d278247
Compare
.../opik-backend/src/main/java/com/comet/opik/infrastructure/bi/ApplicationStartupListener.java
Outdated
Show resolved
Hide resolved
6468b7e
to
414e280
Compare
dd525e8
to
a57e678
Compare
There was a problem hiding this 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.
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/OpikConfiguration.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/infrastructure/bi/ApplicationStartupListener.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/infrastructure/bi/ApplicationStartupListener.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/infrastructure/bi/ApplicationStartupListener.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/infrastructure/bi/ApplicationStartupListener.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/UsageReportDAO.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/UsageReportDAO.java
Outdated
Show resolved
Hide resolved
.../resources/liquibase/db-app-state/migrations/000002_create_usage_usage_information_table.sql
Show resolved
Hide resolved
.../resources/liquibase/db-app-state/migrations/000002_create_usage_usage_information_table.sql
Show resolved
Hide resolved
b99925f
to
1ae8e20
Compare
apps/opik-backend/src/main/java/com/comet/opik/OpikApplication.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/InstallationReportService.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/InstallationReportService.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/InstallationReportService.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/InstallationReportService.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/Metadata.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/bi/OpikStartupEvent.java
Outdated
Show resolved
Hide resolved
.../resources/liquibase/db-app-state/migrations/000002_create_usage_usage_information_table.sql
Show resolved
Hide resolved
} | ||
|
||
if (appContextConfig.usageReportEnabled()) { | ||
list.add("usageReport.enabled: true"); |
There was a problem hiding this comment.
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.
...k-backend/src/test/java/com/comet/opik/infrastructure/bi/ApplicationStartupListenerTest.java
Outdated
Show resolved
Hide resolved
I left my previous review. Things we have to check and agree on before moving forward:
Everything else is minor and not a blocker. |
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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.
50652fd
* [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
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