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

feat(copilot): Adds engagement and seat analysis metrics #3241

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

Conversation

henrikedegrd
Copy link
Contributor

Hey, I just made a Pull Request!

Adds metrics for engagement and seat analysis.

It adds a few new metrics:

  • Total assigned seats
  • Seats never used
  • Seats not used in the last 7/14/28 days

The new metrics are presented with the value from the last day of the selected period range, since an average of the above does not make sense.

It also show some new metrics from the previous change to the new metrics API:

  • Total engaged users
  • Total active users
  • Total engaged IDE completion users
  • Total engaged IDE chat users
  • Total engaged Github.com chat users
  • Total engaged Github.com PR users

Average metrics of the above are calculated excluding weekends, since that can make the average a bit missleading.

Backend also changed to use octokit to fetch data from Github.

Also found that when using PostgreSQL as database, the unique index using null are not working as expected. So the new metrics use empty string instead. This will have to be addressed for the other metrics also. Will do that in a separate PR.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)
    Screenshot 2025-03-14 095528
    Screenshot 2025-03-14 091854

@henrikedegrd henrikedegrd requested a review from a team as a code owner March 14, 2025 09:25
@henrikedegrd henrikedegrd requested a review from 04kash March 14, 2025 09:25
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Mar 14, 2025

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-copilot-backend workspaces/copilot/plugins/copilot-backend minor v0.8.0
@backstage-community/plugin-copilot-common workspaces/copilot/plugins/copilot-common minor v0.8.0
@backstage-community/plugin-copilot workspaces/copilot/plugins/copilot minor v0.8.0

Copy link
Member

@04kash 04kash left a comment

Choose a reason for hiding this comment

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

Thanks @henrikedegrd, left a few comments

@henrikedegrd
Copy link
Contributor Author

Thanks @henrikedegrd, left a few comments

Fixed them, and also fixed a bug where I fetched the wrong datapoint for some metrics.

@04kash
Copy link
Member

04kash commented Mar 24, 2025

Should be good to merge after conflicts are resolved

Changes the backend to use octokit in order to have pagination

Signed-off-by: Henrik Edegård <[email protected]>
Signed-off-by: Henrik Edegård <[email protected]>
Signed-off-by: Henrik Edegård <[email protected]>
Signed-off-by: Henrik Edegård <[email protected]>
@henrikedegrd henrikedegrd force-pushed the copilot-add-engagement branch from 1aec1a2 to 75704af Compare March 24, 2025 14:17
Copy link
Member

@04kash 04kash left a comment

Choose a reason for hiding this comment

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

lgtm! Thanks @henrikedegrd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants