-
Notifications
You must be signed in to change notification settings - Fork 177
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
feat: added tags to lana logs #1463
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
|
Codecov Report
@@ Coverage Diff @@
## main #1463 +/- ##
==========================================
- Coverage 95.61% 95.60% -0.02%
==========================================
Files 146 146
Lines 37691 37692 +1
==========================================
- Hits 36038 36034 -4
- Misses 1653 1658 +5
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
The linter has a few complaints
Fixed, I was using another formatter |
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.
Awesome first PR 🚀 If you have issues with the LH score checks, you can also use .live
links with published pages - those checks are usually a bit more stable than the .page
links since they sit behind a CDN.
One suggestion to keep the code a little leaner. Additionally you could add the tag description to your PR description
// Common used LANA logs tags:
// info - network issues
// warn - authoring related misconfigs or similar
// error - actual error ( ex. cannot read Y of undefind )
// <module> - extra tag to help centralise all logs related to a specific module
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.
Approved from my standpoint, this will help us granulate alerts as well since we can now query on tags.
libs/blocks/global-navigation/features/breadcrumbs/breadcrumbs.js
Outdated
Show resolved
Hide resolved
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.
👍
Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com>
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.
Great job on your first PR! 👏
|
await logErrorFor(erroneousFunction, 'message', 'someTags'); | ||
|
||
// Check if lanaLog (through window.lana.log) was called with expected parameters. | ||
expect(lanaLogSpy.calledOnce).to.be.true; |
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.
You could expand the check to see that the tags and messages are also correctly called
* feat: added tags to lana logs * hotfix: formatting * hotfix: formatting * hotfix: removed composeLanaTags method * hotfix: gnav label for global-navigation * hotfix: send string instead of array to splunk * Update libs/blocks/global-navigation/features/search/gnav-search.js Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> * feat: unit test for lana logs --------- Co-authored-by: Aaron Mauchley <mauchley@adobe.com> Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com>
Description
This PR addresses the requirement of enabling filtering capabilities for Splunk logs based on tags from LANA logs.
Recommended tags:
info
- network issueswarn
- authoring related misconfigs or similarerror
- actual error ( ex. cannot read Y of undefind )<module>
- extra tag to help centralise all logs related to a specific moduleRelated Issue
Resolves: MWPW-138031
Testing instructions
lana_nonprod
tags
key with an array of strings as value to the json sent as argument for thelanaLog
methodor if you're using the
logErrorFor
method add the array of strings as the third argument ( the strings in the array are the tags that will be associated with the log )E.g.
lanaLog({ message: 'Could not create global navigation.', e, tags: 'errorType=error,module=gnav' });
logErrorFor(onToggleClick, 'Toggle click failed', 'errorType=error,module=gnav' ));
Screenshots:
Test URLs
Acrobat:
BACOM:
CC:
Milo: