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

Local PLG MVP #3174

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Local PLG MVP #3174

merged 2 commits into from
Sep 18, 2024

Conversation

elipe17
Copy link

@elipe17 elipe17 commented Sep 5, 2024

Summary of Changes

  • Added Loki and Promtail to app
  • Added Loki dashboard and updated plg resources
  • Added backend file based logger for Promtail to scrape
  • Updated Nginx to write logs to file for Promtail to scrape

Pull request closes #3047

How to Test

List the steps to test the PR
These steps are generic, please adjust as necessary.

cd tdrs-frontend && docker-compose up
cd tdrs-backend && docker-compose up --build
  1. Run mkdir -p ~/tdp-logs/nginx
  2. Open http://localhost:3000/ and sign in.
  3. Submit a file or two to get some logs
  4. Go to the Grafana tab and checkout the Loki Test dashboard

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • Logs from backend are available in Grafana
  • Logs from frontend (Nginx) are available in Grafana
  • Backend and Frontend servers are monitored by Grafana (availability, cpu usage, HDD usage)
  • README is updated, if necessary

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic?
  • Are links included to any other gov-approved PRs associated with epic?
  • Does PR include documentation for Raft's a11y review?
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR?

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces dependencies, are their licenses documented?
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

- Added loki dashboard and update plg resources
- Added backend file logger
- UPdated nginx to write logs to file
@elipe17 elipe17 self-assigned this Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.36%. Comparing base (c7f0010) to head (ec545fb).
Report is 28 commits behind head on 3044-prometheus-grafana.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##           3044-prometheus-grafana    #3174   +/-   ##
========================================================
  Coverage                    91.36%   91.36%           
========================================================
  Files                          290      290           
  Lines                         8044     8044           
  Branches                       751      751           
========================================================
  Hits                          7349     7349           
  Misses                         588      588           
  Partials                       107      107           
Flag Coverage Δ
dev-backend 91.17% <ø> (ø)
dev-frontend 92.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tdrs-backend/tdpservice/settings/common.py 99.32% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7f0010...ec545fb. Read the comment docs.

- Updated logs dashboard with correct loki UID
@elipe17 elipe17 marked this pull request as ready for review September 6, 2024 12:41
@elipe17 elipe17 added frontend backend dev raft review This issue is ready for raft review labels Sep 6, 2024
Copy link
Collaborator

@andrew-jameson andrew-jameson left a comment

Choose a reason for hiding this comment

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

Yes, this looks great!
Screenshot 2024-09-06 at 9 54 42 AM

Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

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

LGTM!

@andrew-jameson andrew-jameson mentioned this pull request Sep 17, 2024
31 tasks
@ADPennington
Copy link
Collaborator

@elipe17 and I just briefly discussed this PR, and I've reviewed the tabletop. This incorporates #3163 and both PRs are only for local development, therefore bypassing QASP review is 🆗

@elipe17 elipe17 merged commit e372381 into 3044-prometheus-grafana Sep 18, 2024
22 checks passed
@elipe17 elipe17 deleted the 3047-plg-mvp branch September 18, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dev frontend raft review This issue is ready for raft review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants