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

fix: add a metric to track client registrations #9314

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

ivarconr
Copy link
Member

Adding a counter to track every time a client registers with Unleash.

@ivarconr ivarconr requested a review from kwasniew February 14, 2025 14:57
Copy link

vercel bot commented Feb 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2025 2:57pm
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Feb 14, 2025 2:57pm

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@@ -807,6 +812,9 @@ export function registerPrometheusMetrics(
clientDeltaMemory.reset();
clientDeltaMemory.set(event.memory);
});
eventBus.on(events.CLIENT_REGISTERED, ({ appName, environment }) => {
Copy link
Contributor

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

Copy link
Member Author

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);
Copy link
Contributor

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

@ivarconr ivarconr merged commit 3f730bb into main Feb 17, 2025
9 checks passed
@ivarconr ivarconr deleted the fix/metric_for_client_registered branch February 17, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants