[PR #3837] [CLOSED] feat: SH instance analytics data collection #4547

Closed
opened 2026-03-17 02:04:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3837
Author: @balub
Created: 2/16/2024
Status: Closed

Base: release/2024.3.0Head: feat/sh-usage-analytics-collection


📝 Commits (10+)

📊 Changes

138 files changed (+8317 additions, -10826 deletions)

View changed files

📝 docker-compose.yml (+3 -3)
📝 packages/hoppscotch-backend/package.json (+4 -1)
📝 packages/hoppscotch-backend/src/admin/infra.resolver.ts (+23 -1)
📝 packages/hoppscotch-backend/src/app.module.ts (+4 -0)
📝 packages/hoppscotch-backend/src/errors.ts (+6 -0)
📝 packages/hoppscotch-backend/src/infra-config/helper.ts (+10 -0)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.service.ts (+24 -1)
packages/hoppscotch-backend/src/posthog/posthog.module.ts (+9 -0)
packages/hoppscotch-backend/src/posthog/posthog.service.ts (+61 -0)
📝 packages/hoppscotch-backend/src/types/InfraConfig.ts (+5 -0)
📝 packages/hoppscotch-cli/package.json (+2 -1)
📝 packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts (+201 -85)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/collection-level-headers-auth-coll.json (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/env-flag-tests-coll.json (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/fails-coll.json (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll-2.json (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll.json (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/notjson-coll.txt (+0 -0)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/passes-coll.json (+0 -0)
packages/hoppscotch-cli/src/__tests__/samples/collections/pre-req-script-env-var-persistence-coll.json (+21 -0)

...and 80 more files

📄 Description

Closes HSB-363

Description

In this PR we allow basic analytics to be collected from the hosted SH instance and sent to PostHog. Analytics collection is enabled by default and admins can chose to disable it from the admin dashboard which uses a new mutation to toggle data collection by the instance.

mutation {
  toggleAnalyticsCollection(status: ENABLE)
}

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3837 **Author:** [@balub](https://github.com/balub) **Created:** 2/16/2024 **Status:** ❌ Closed **Base:** `release/2024.3.0` ← **Head:** `feat/sh-usage-analytics-collection` --- ### 📝 Commits (10+) - [`d7cdeb7`](https://github.com/hoppscotch/hoppscotch/commit/d7cdeb796ae472874dabe7946c0996f20dd7b2ac) chore(common): analytics on spotlight (#3727) - [`0ba33ec`](https://github.com/hoppscotch/hoppscotch/commit/0ba33ec187503dbe6410f0b131a724354bc495db) fix: request endpoint heading (#3804) - [`0028f6e`](https://github.com/hoppscotch/hoppscotch/commit/0028f6e878770b964b65854462d5fce924a94929) feat(js-sandbox): expose `atob` & `btoa` functions for Node.js (#3724) - [`3911c9c`](https://github.com/hoppscotch/hoppscotch/commit/3911c9cd1f47a62f8a2507b52629f3f4b4cec3a7) refactor: update share request flow (#3805) - [`16803ac`](https://github.com/hoppscotch/hoppscotch/commit/16803acb26f3d70e684760c536bce6855456937e) chore: Oauth temporary ux improvements (#3792) - [`00862eb`](https://github.com/hoppscotch/hoppscotch/commit/00862eb192f4df30f564d408b48ba9843d48b0c8) feat: secret variables in environments (#3779) - [`5bcc38e`](https://github.com/hoppscotch/hoppscotch/commit/5bcc38e36b458cf0754a2664d8a4e456ae1891ff) feat: support secret environment variables in CLI (#3815) - [`c0fae79`](https://github.com/hoppscotch/hoppscotch/commit/c0fae7967844bcbc47826e21fe72edc48ae1fa77) fix(sh-admin): persist active selection in the sidebar (#3812) - [`672ee69`](https://github.com/hoppscotch/hoppscotch/commit/672ee69b2cf13f9584e830a7af271b9cbcddb586) chore: correct linting errors - [`6a0e73f`](https://github.com/hoppscotch/hoppscotch/commit/6a0e73fdecf0510b0a7229b60c95c473586453db) chore: bump versions ### 📊 Changes **138 files changed** (+8317 additions, -10826 deletions) <details> <summary>View changed files</summary> 📝 `docker-compose.yml` (+3 -3) 📝 `packages/hoppscotch-backend/package.json` (+4 -1) 📝 `packages/hoppscotch-backend/src/admin/infra.resolver.ts` (+23 -1) 📝 `packages/hoppscotch-backend/src/app.module.ts` (+4 -0) 📝 `packages/hoppscotch-backend/src/errors.ts` (+6 -0) 📝 `packages/hoppscotch-backend/src/infra-config/helper.ts` (+10 -0) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.service.ts` (+24 -1) ➕ `packages/hoppscotch-backend/src/posthog/posthog.module.ts` (+9 -0) ➕ `packages/hoppscotch-backend/src/posthog/posthog.service.ts` (+61 -0) 📝 `packages/hoppscotch-backend/src/types/InfraConfig.ts` (+5 -0) 📝 `packages/hoppscotch-cli/package.json` (+2 -1) 📝 `packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts` (+201 -85) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/collection-level-headers-auth-coll.json` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/env-flag-tests-coll.json` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/fails-coll.json` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll-2.json` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll.json` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/notjson-coll.txt` (+0 -0) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/passes-coll.json` (+0 -0) ➕ `packages/hoppscotch-cli/src/__tests__/samples/collections/pre-req-script-env-var-persistence-coll.json` (+21 -0) _...and 80 more files_ </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes HSB-363 ### Description <!-- Add a brief description of the pull request --> In this PR we allow basic analytics to be collected from the hosted SH instance and sent to PostHog. Analytics collection is enabled by default and admins can chose to disable it from the admin dashboard which uses a new mutation to toggle data collection by the instance. ``` mutation { toggleAnalyticsCollection(status: ENABLE) } ``` <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:04:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4547
No description provided.