-
-
Notifications
You must be signed in to change notification settings - Fork 658
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: feature changes counted in new table #4958
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
3443abf
to
72467ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, I feel we're probably close to considering CDC, but I don't think that'll help with self-hosted. 👍
enterprise: data.versions.enterprise, | ||
}; | ||
this.isLatest = data.latest; | ||
if (this.versionCheckUrl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is unrelated but it's worth having it independently of this PR
yes, this looks spot on! We might peek at environment type in the future when taking out the counters, but that can be improved later. |
"SUM(CASE WHEN day > NOW() - INTERVAL '90 days' THEN updates END)", | ||
), | ||
}) | ||
.from('stat_environment_updates'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a where clause here, to only pick production envs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree. thanks for the reminder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also updated it to look at the environment type and sum across all environments of type 'production'.
…vironmnts of type production
d7ba56e
to
f04b3c8
Compare
As part of more telemetry on the usage of Unleash.
This PR adds a new
stat_
prefixed table as well as a trigger on the events table trigger on each insert to increment a counter per environment per day.The trigger will trigger on every insert into the events base, but will filter and only increment the counter for events that actually have the environment set. (there are events, like user-created, that does not relate to a specific environment).
Bit wary on this, but since we truncate down to row per (day, environment) combo, finding conflict and incrementing shouldn't take too long here.
@ivarconr was it something like this you were considering?