- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 751
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
fix: add a metric to track client registrations #9314
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
@@ -807,6 +812,9 @@ export function registerPrometheusMetrics( | |||
clientDeltaMemory.reset(); | |||
clientDeltaMemory.set(event.memory); | |||
}); | |||
eventBus.on(events.CLIENT_REGISTERED, ({ appName, environment }) => { |
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'm assuming we don't need to batch those before calling inc
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.
no need, its just in-memory counters.
@@ -105,6 +111,7 @@ export default class ClientInstanceService { | |||
value.clientIp = clientIp; | |||
value.createdBy = SYSTEM_USER.username!; | |||
this.seenClients[this.clientKey(value)] = value; | |||
this.eventBus.emit(CLIENT_REGISTERED, value); |
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.
it's slightly confusing the we have CLIENT_REGISTER and CLIENT_REGISTERED events
Adding a counter to track every time a client registers with Unleash.