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

Collect metrics from the gateway #2171

Merged
merged 8 commits into from
Jan 13, 2025
Merged

Collect metrics from the gateway #2171

merged 8 commits into from
Jan 13, 2025

Conversation

zkokelj
Copy link
Contributor

@zkokelj zkokelj commented Nov 29, 2024

Why this change is needed

We would like to have some metrics of the gateway usage. We were able to get some of those metrics from the unencrypted database before. But with encrypted database we don't have that ability anymore.

What changes were made as part of this PR

  • new metrics package that allows us to count number of users, accounts registered and active users in last month
  • we are displaying those statistics every day in logs where we can easily see them
  • Metrics are available also in cosmosDB (which is also used to persist metrics in case of app restarts, etc)
Screenshot 2025-01-08 at 09 43 00

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

"time"
)

type MetricsTracker struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

the problem with this is that it's volatile. Any restart of the gateway will wipe the numbers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a fix for that.

Metrics are now regularly stored in CosmosDB.

@zkokelj zkokelj force-pushed the ziga/add_gateway_metrics branch from 99f2502 to d051e42 Compare January 7, 2025 09:54
@zkokelj zkokelj requested a review from tudor-malene January 8, 2025 14:11
Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

lgtm

@zkokelj zkokelj merged commit c7e8f8a into main Jan 13, 2025
2 checks passed
@zkokelj zkokelj deleted the ziga/add_gateway_metrics branch January 13, 2025 16:36
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