-
Notifications
You must be signed in to change notification settings - Fork 0
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
DR-3325: Cleaning up logging and README #264
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
README.md
Outdated
| Branch | Environment | AWS Account | Cluster | Link To Application | | ||
| :--------- | :---------- | :------------- | :-------------------------------------------- | :------------------------------------------------------------------------------------- | | ||
| main | development | | | [localhost:3000](http://localhost:3000) | | ||
| qa | qa | nypl-dams-dev | nyplorg-dc-rp-qa AND dc-frontend-qa | [https://qa-digitalcollections.nypl.org/](https://qa-new-digitalcollections.nypl.org/) | |
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.
Is this confusing to list two clusters/ is this technically correct? I think the fact that I'm STILL unsure about this setup means we need to have a very clear written description so I'd like to make that happen
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.
That's fair and I can include that later, but no, this is not technically correct. The cluster is only dc-frontend-qa
(similar for prod). The reverse proxy cluster is its own thing.
This isn't great but if we can live with this for now, let's keep it this way. It might be more effort to consolidate both apps, on Cloudwatch and NR, than to just wait until DCF completely replaces legacy. |
Ha, thanks, but I did look. Did you cause the |
I think you're talking about Cloudwatch logs from today/yesterday? I did try it a bunch because I initially expected the logs to go to the QA RP log group. It should not still be logging unless |
@@ -106,7 +106,7 @@ export default function DivisionPage({ data }: any) { | |||
laneName={data.name} | |||
/> | |||
) : ( | |||
<LaneLoading withTitle={false} /> | |||
<LaneLoading id={"unloaded"} withTitle={false} /> |
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.
nit: you don't need braces around string prop values
@@ -19,6 +19,11 @@ interface DivisionsProps { | |||
|
|||
export default function DivisionsPage({ summary, divisions }: DivisionsProps) { | |||
const [isLoaded, setIsLoaded] = useState(false); | |||
if ((window as any).newrelic) { | |||
(window as any).newrelic.log("test log from divisions page", { |
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.
Do you know where I can see this in NR? I see logs here https://one.newrelic.com/logger?account=121334&duration=86400000&filters=%28domain%20IN%20%28%27BROWSER%27%2C%20%27BROWSER%27%29%20AND%20type%20IN%20%28%27APPLICATION%27%2C%20%27MICRO_FRONTEND%27%29%29&state=97ecb909-d652-d0ee-7371-53a1dcc37c0e
but it's only the "test error from fetch API". I was confused, I saw the following in NR but not in the repo and then noticed from the commits that you added and then removed it. From what I understand, you logged "test error from fetch API" through the logger which uses winston and that did log to cloudwatch. I was not expecting that to log to NR unless if I missed a commit.
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.
Oh interesting ! I wasn't expecting it to log to NR either, since I was looking at the browser logs. But NR is actually picking up everything I guess via this other APM service– so all those "test error from fetch API" were just logging whenever fetchAPI
was called at all, so that makes sense.
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.
Testing with the divisions page now...
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.
Some comments in the readme. I appreciate taking the time to tidy it and def not carried away.
README.md
Outdated
| Branch | Environment | AWS Account | Cluster | Link To Application | | ||
| :--------- | :---------- | :------------- | :-------------------------------------------- | :------------------------------------------------------------------------------------- | | ||
| main | development | | | [localhost:3000](http://localhost:3000) | | ||
| qa | qa | nypl-dams-dev | nyplorg-dc-rp-qa AND dc-frontend-qa | [https://qa-digitalcollections.nypl.org/](https://qa-new-digitalcollections.nypl.org/) | |
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.
That's fair and I can include that later, but no, this is not technically correct. The cluster is only dc-frontend-qa
(similar for prod). The reverse proxy cluster is its own thing.
|
||
### Release Naming Strategy | ||
### Release naming strategy |
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 don't have a strong opinion but why the sentence case? UX patterns is to use sentence case for titles and I'm cool with this being a convention we follow on our docs.
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 just prefer it and the casing was inconsistent, so i wanted to pick one
README.md
Outdated
|
||
We structure our logs according to these [NYPL standards](https://github.com/NYPL/engineering-general/blob/main/standards/logging.md). See `logger.js` for the formatting and storage of logs. | ||
|
||
Do NOT use `console.log` if you want to add a permanent log, and make sure to clean up your debugging `console.log`s, because they will clutter Cloudwatch and New Relic. |
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 like the language used, "NOT", "DO". Don't change it, but I wonder if there's a way to use what's in engineering-general or perhaps we should extend engineering-general when it says
The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY/OPTIONAL, in these documents are to be interpreted as described in RFC 2119.
About to be off for the week so just pushed Alessandra's last PR up to QA again, will return to this 12/30! |
@EdwinGuzman No significant code changes from your last review, just experimented with what New Relic actually captures depending on how you send it ( |
Ticket:
This PR does the following:
location is not defined
from the home page and the lack of unique IDs on the skeleton loaders) and unusedconsole.logs
fetchAPI
setImmediate
mock to our Jest setup so the logger works in the test environmentOpen Questions
Our logging is still split between old and new DC (at least as far as I can tell on QA Cloudwatch and New Relic), which is a little odd, but I guess won't be a problem once Facelift is complete. Do you guys think this should be/can be addressed now?
How has this been tested? How should a reviewer test this?
This branch is currently hooked up to QA so you can see New Relic errors and logs here. In this process, I've found that New Relic collects logs and errors for an application in several places, which can be confusing, so see the updated README logging section for more detail on what you should expect to see.
Winston logs should appear in the Cloudwatch
dc-frontend-qa
log group.If you can't be bothered to do all this... this is what they look like :)
Cloudwatch:
New Relic error:
New Relic log:
I will revert the GHA to disconnect this branch from QA once you guys check it out.
You can also run the tests to see the format of server side error logs from
fetchAPI
, and check the console and Cloudwatch log streams to notice how clean and empty they are.Also, please check out the README since I got a little carried away and there's more changes than just the addition of the logging section.
Accessibility concerns or updates
Checklist: