Repository navigation
Conversation
|
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
AGENT:
Why
Staff need to see how each customer actually uses OHE: how many conversations, users and orgs, whether SSO and personal workspaces are on, and which sandbox it runs on. Customer Center now stores usage reports and shows them on the admin customer page.
It also needs to count installs. Several people at one company may each run their own install, so each report carries a stable instance ID.
This is the OHE side that sends those reports.
Summary
usage_reportjob every 30 minutes. It's on wheneverOPENHANDS_LICENSE_KEYis set, whether or not license enforcement is on, and has noOH_WORKER_SCHEDULED_JOBS_*switch.instance_settings.instance_idcolumn. The first report creates it, and it never changes. Replicas that race to create it all get the first one.Issue Number
PLTF-3967
How to Test
make local-db) and start the worker withOPENHANDS_LICENSE_KEY=<key>andLICENSE_SERVER_URL=<customer center>:make start-worker.worker.startedlog line listsusage_reportinscheduled_jobs. At the next :00 or :30 the log showsusage_report_sent./adminin Customer Center. The install shows under its instance ID with the reported numbers.Unit tests:
uv run pytest tests/unit/server/licensing/test_usage_report.py tests/unit/storage/test_instance_settings_store.py tests/unit/app_server/test_worker_scheduled_jobs.py tests/unit/test_user_store.py.Video/Screenshots
See Demo below.
Type
Notes
Where each field comes from:
conversations,users: row counts ofconversation_metadataanduser.orgs: team orgs only. A personal workspace shares its id with its user, so it's already counted inusers.automations: sent asnull(not reported). The automation service has no global count yet.sso_enabled:ENABLE_ENTERPRISE_SSO, or with OAuth v2 login an enabled SAML or OIDC login provider. Keycloak's own rows and git providers don't count.personal_workspaces_enabled: the web client'shide_personal_workspacesflag.sandbox_strategy: the sandbox service in use (OH_SANDBOX_KIND, elseRUNTIME).The first user's insert into
instance_settingsnow fillssetup_user_idon an existing row. A report can create the row before anyone signs in, and the first-install wizard still needs that column.Migration 207 adds the column. Docker Compose now passes
OPENHANDS_LICENSE_KEYandLICENSE_SERVER_URLto the app and worker.Helm and Replicated installs report only once the OpenHands-Cloud chart runs the worker; Docker Compose already does.
Stacked on #1112.
Demo
The worker runs the
usage_reportjob against a local OHE database, and the report shows up on the customer's admin page in a local Customer Center, under the install's instance ID.PLTF-3967-ohe-usage-report.webm
Enterprise server image for this PR: