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

Improve telemetry with deeper insights into system usage #22337

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

licitdev
Copy link
Member

@licitdev licitdev commented Apr 29, 2024

Scope

What's changed:

  • Filter by active users instead of all users
  • Filter by enabled extensions instead of all extensions
  • Add field counts: fields_max & fields_total
  • Add database size

Potential Risks / Drawbacks

  • More queries to the DB.

Review Notes / Questions

  • The queries had been tested on the DB containers, but wrapped in a try-catch in case it fails.

Fixes #21982

Copy link

changeset-bot bot commented Apr 29, 2024

🦋 Changeset detected

Latest commit: dcf8332

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@licitdev licitdev changed the title Improve telemetry Improve telemetry with deeper insights into system usage Apr 29, 2024
@licitdev licitdev marked this pull request as ready for review April 29, 2024 19:19
licitdev and others added 3 commits May 3, 2024 14:33
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

Great work ✨

  • For the newly introduced data (db size, and especially fields count) do we expect them to perform well? Wondering after seeing this comment:
    // Counts can be a little heavy if the table is very large, so we'll only ever execute 3 of these
    // queries simultaneously to not overload the database
  • Just because it might be good to know (and maybe add inline docs): Do (some of) the DB size queries require some special DB permissions?

api/src/database/helpers/schema/types.ts Outdated Show resolved Hide resolved
@paescuj paescuj self-assigned this May 9, 2024
@paescuj paescuj assigned DanielBiegler and paescuj and unassigned paescuj May 9, 2024
@alexchopin alexchopin added this to the Next Minor Release milestone May 17, 2024
licitdev and others added 2 commits May 23, 2024 21:48
api/src/telemetry/utils/get-extension-count.ts Outdated Show resolved Hide resolved
api/src/telemetry/utils/get-extension-count.ts Outdated Show resolved Hide resolved
api/src/telemetry/lib/get-report.ts Outdated Show resolved Hide resolved
api/src/telemetry/types/report.ts Outdated Show resolved Hide resolved
api/src/telemetry/utils/get-extension-count.test.ts Outdated Show resolved Hide resolved
api/src/telemetry/utils/get-field-count.ts Outdated Show resolved Hide resolved
@DanielBiegler DanielBiegler dismissed their stale review May 28, 2024 15:52

Added changes :)

Tricky to map fields from older versions into the updated field names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Improve Telemetry Reporting
5 participants