Skip to content

fix: Tag Enterprise telemetry by deployment kind - #441

Merged
malhotra5 merged 1 commit into
mainfrom
oss-13530-deployment-kind-telemetry
Sep 21, 2026
Merged

malhotra5 merged 1 commit into
mainfrom
oss-13530-deployment-kind-telemetry

Conversation

@malhotra5

@malhotra5 malhotra5 commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

  • A human has tested these changes.

Simple telemetry fix doesn't require extensive testing.

AGENT:

This PR was created by an AI agent (OpenHands) on behalf of the user.


Why

Enterprise telemetry currently uses app_mode = saas|oss and deployment_mode = cloud|self_hosted in different places, which does not provide a single PostHog field for distinguishing hosted/cloud telemetry from local or self-hosted telemetry. This adds the canonical deployment_kind marker used by the SDK telemetry pipeline.

Linear: OSS-13530

Summary

  • Add deployment_kind: "remote" | "local" to Enterprise backend analytics common properties.
  • Pass deployment_kind: "local" for self-hosted Enterprise and "remote" for hosted SaaS startup analytics initialization.
  • Add a frontend PostHog before_send hook that stamps deployment_kind based on web-client config.

Issue Number

Linear: OSS-13530

How to Test

Commands run:

uv run pytest tests/unit/test_analytics_service.py tests/unit/test_saas_lifespan.py
uv run ruff check openhands/analytics/analytics_service.py openhands/analytics/__init__.py server/app_lifespan/saas_app_lifespan_service.py tests/unit/test_analytics_service.py tests/unit/test_saas_lifespan.py
cd frontend && npx vitest run __tests__/components/providers/posthog-wrapper.test.tsx
cd frontend && npm run typecheck:staged
cd frontend && npx eslint src/components/providers/posthog-wrapper.tsx __tests__/components/providers/posthog-wrapper.test.tsx
cd frontend && npx prettier --check src/components/providers/posthog-wrapper.tsx __tests__/components/providers/posthog-wrapper.test.tsx

Results:

  • tests/unit/test_analytics_service.py and tests/unit/test_saas_lifespan.py: 82 tests passed.
  • Frontend PostHog wrapper test: 9 tests passed.
  • Frontend TypeScript typecheck passed.
  • Targeted Ruff, ESLint, and Prettier checks passed.
  • Commit hook also ran frontend checks and backend pre-commit, including mypy, successfully.

Video/Screenshots

N/A — this is a telemetry payload property change validated with backend/frontend tests, typechecking, linting, formatting, and pre-commit checks.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Existing app_mode and deployment-mode fields are preserved for compatibility. New events can be queried directly with properties.deployment_kind = "remote" or "local".

@malhotra5 can click here to continue refining the PR


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-46b8b8a

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  openhands/analytics
  __init__.py
  analytics_service.py
  server/app_lifespan
  saas_app_lifespan_service.py
Project Total  

This report was generated by python-coverage-comment-action

@malhotra5
malhotra5 requested review from a team and hieptl and removed request for a team September 21, 2026 18:30
@malhotra5 malhotra5 changed the title OSS-13530: Tag Enterprise telemetry by deployment kind fix: Tag Enterprise telemetry by deployment kind Sep 21, 2026
@github-actions github-actions Bot added the type: fix A bug fix label Sep 21, 2026
@malhotra5
malhotra5 marked this pull request as ready for review September 21, 2026 18:30

@hieptl hieptl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! 🙏

@malhotra5
malhotra5 merged commit 574f5ed into main Sep 21, 2026
23 of 24 checks passed
@malhotra5
malhotra5 deleted the oss-13530-deployment-kind-telemetry branch September 21, 2026 18:35
@openhands-release-bot openhands-release-bot Bot added the released: 1.63.0 Shipped in 1.63.0 label Sep 22, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.63.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.63.0 Shipped in 1.63.0 type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants