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

Update UserAcceptableVerifiedCredentialCountsJob to use StatsD #11780

Merged
merged 0 commits into from
Feb 24, 2023

Conversation

rileyanderson
Copy link
Contributor

@rileyanderson rileyanderson commented Feb 13, 2023

Summary

Run Sidekiq cron job daily to set StatsD gauges with user_avc totals. user_avc_totals.{proivider}.{scope}.total

  • use StatsD gauge for user_avc Metrics
  • Updated docs

How to test

  • Start server - bundle exec rails c
  • In different terminal start sidekiq - bundle exec sidekiq
  • In different terminal tail statsd logs - tail -f log/statsd.log
  • Go to http://localhost:3000/sidekiq/recurring-jobs
  • Enqueue - UserAcceptableVerifiedCredentialTotals
  • Check logs for user_avc_totals.*.*.total statsd keys

Related issue(s)

Testing done

  • Specs
  • Ran locally, StatsD metrics show up
  • Checked logs for errors
  • checked authentication

Screenshots

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

@github-actions
Copy link

github-actions bot commented Feb 13, 2023

1 Error
🚫 This PR changes 716 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, those exceeding
500 will not be reviewed, nor will they be allowed to merge. Please break this PR up into
smaller ones.

If you have reason to believe that this PR should be granted an exception, please see the
Submitting pull requests for approval - FAQ.

File Summary

Files

  • app/models/user_acceptable_verified_credential.rb (+6/-0)

  • app/services/login/user_acceptable_verified_credential_updater_logger.rb (+2/-8)

  • app/workers/identity/user_acceptable_verified_credential_counts_job.rb (+0/-107)

  • app/workers/identity/user_acceptable_verified_credential_totals_job.rb (+54/-0)

  • config/initializers/statsd.rb (+8/-0)

  • config/sidekiq_scheduler.yml (+2/-2)

  • spec/factories/user_acceptable_verified_credentials.rb (+37/-0)

  • spec/jobs/identity/user_acceptable_verified_credential_counts_job_spec.rb (+0/-375)

  • spec/jobs/identity/user_acceptable_verified_credential_totals_job_spec.rb (+115/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vfs-bot va-vfs-bot temporarily deployed to uavc-count-job-statsd/main/main February 13, 2023 19:01 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to uavc-count-job-statsd/main/main February 13, 2023 21:04 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to uavc-count-job-statsd/main/main February 15, 2023 15:24 Inactive
@rileyanderson rileyanderson marked this pull request as ready for review February 15, 2023 21:17
@rileyanderson rileyanderson requested review from a team as code owners February 15, 2023 21:17
@rileyanderson rileyanderson marked this pull request as draft February 16, 2023 15:55
@rileyanderson rileyanderson marked this pull request as ready for review February 16, 2023 16:48
@rileyanderson rileyanderson marked this pull request as draft February 16, 2023 19:09
@rileyanderson
Copy link
Contributor Author

Closing for #11854

@va-vfs-bot va-vfs-bot temporarily deployed to uavc-count-job-statsd/main/main February 21, 2023 21:33 Inactive
@rileyanderson
Copy link
Contributor Author

rileyanderson commented Feb 23, 2023

Reopening. Replacing current logging solution with StatsD

@rileyanderson rileyanderson reopened this Feb 23, 2023
@rileyanderson rileyanderson marked this pull request as ready for review February 23, 2023 21:25
@rileyanderson rileyanderson requested a review from bosawt February 23, 2023 21:26
@va-vfs-bot va-vfs-bot temporarily deployed to uavc-count-job-statsd/main/main February 23, 2023 21:33 Inactive
bosawt
bosawt previously approved these changes Feb 24, 2023
Copy link
Contributor

@bosawt bosawt left a comment

Choose a reason for hiding this comment

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

I think this makes sense. My only comments would be around potential for performance issues, but I'm not super concerned since it's a Sidekiq job once a day. And if we ever see issues with the queries not completing or something we can revisit (I doubt this will be an issue)

Copy link
Contributor

@bosawt bosawt left a comment

Choose a reason for hiding this comment

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

Looks good!

@rileyanderson rileyanderson merged commit 95e5c23 into master Feb 24, 2023
@rileyanderson rileyanderson deleted the uavc-count-job-statsd branch February 24, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants