-
Notifications
You must be signed in to change notification settings - Fork 13
Error Logs for failed tranformer requests #360
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e9dfe7d
Added CLI option "logs" to redirect user to tranform ids error logs
ketan96-m 2bab7ae
removed the URL optional opening, added info and error level, removed…
ketan96-m d71e6db
Added loglevel in models for info and error
ketan96-m e4ed76e
Removed Log Level from models.py
ketan96-m 3bcfea3
Logic to add the filters in the URL, _a parameters for request id, lo…
ketan96-m 4cf4f1f
edited the logs cli option to use the log url from tranformation stat…
ketan96-m fafea9b
transforms flake8 fix
ketan96-m 13caa82
unit test cases for cli log url
ketan96-m 12cafe5
flake8 transforms fix
ketan96-m c16aff9
removed a failing test case for cli app
ketan96-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from servicex.app.transforms import LogLevel, TimeFrame | ||
from servicex.app.transforms import add_query, select_time, create_kibana_link_parameters | ||
|
||
|
||
def test_add_query(): | ||
key = "abc" | ||
value = "123-345-567" | ||
query = "(query:(match_phrase:(abc:'123-345-567')))" | ||
assert add_query(key, value) == query | ||
|
||
key = "requestId" | ||
value = "d2ede739-9779-4075-95b1-0c7fae1de408" | ||
query = "(query:(match_phrase:(requestId:'d2ede739-9779-4075-95b1-0c7fae1de408')))" | ||
assert add_query(key, value) == query | ||
|
||
|
||
def test_select_time(): | ||
time_frame = TimeFrame.week | ||
time_filter = "time:(from:now%2Fw,to:now%2Fw)" | ||
assert time_filter == select_time(time_frame) | ||
|
||
time_frame = "month" | ||
time_filter = "time:(from:now-30d%2Fd,to:now)" | ||
assert time_filter == select_time(time_frame) | ||
|
||
time_frame = "daY" | ||
time_filter = "time:(from:now%2Fd,to:now%2Fd)" | ||
assert time_filter == select_time(time_frame) | ||
|
||
|
||
def test_create_kibana_link_parameters(): | ||
initial_log_url = "https://atlas-kibana.mwt2.org:5601/s/servicex/app"\ | ||
"/dashboards?auth_provider_hint=anonymous1#/view/"\ | ||
"2d2b3b40-f34e-11ed-a6d8-9f6a16cd6d78?embed=true&_g=()"\ | ||
"&show-time-filter=true&hide-filter-bar=true" | ||
transform_id = "d2ede739-9779-4075-95b1-0c7fae1de408" | ||
log_level = LogLevel.error | ||
time_frame = TimeFrame.day | ||
final_url = "https://atlas-kibana.mwt2.org:5601/s/servicex/app/dashboards?"\ | ||
"auth_provider_hint=anonymous1#/view/2d2b3b40-f34e-11ed-a6d8-9f6a16cd6d78?"\ | ||
"embed=true&_g=(time:(from:now%2Fd,to:now%2Fd))"\ | ||
"&_a=(filters:!((query:(match_phrase:"\ | ||
"(requestId:'d2ede739-9779-4075-95b1-0c7fae1de408'))),"\ | ||
"(query:(match_phrase:(level:'error')))))&show-time-filter=true"\ | ||
"&hide-filter-bar=true" | ||
assert create_kibana_link_parameters(initial_log_url, transform_id, | ||
log_level, time_frame) == final_url | ||
|
||
transform_id = "93713b34-2f0b-4d53-8412-8afa98626516" | ||
log_level = LogLevel.info | ||
time_frame = TimeFrame.month | ||
final_url = "https://atlas-kibana.mwt2.org:5601/s/servicex/app/dashboards?"\ | ||
"auth_provider_hint=anonymous1#/view/2d2b3b40-f34e-11ed-a6d8-9f6a16cd6d78?"\ | ||
"embed=true&_g=(time:(from:now-30d%2Fd,to:now))"\ | ||
"&_a=(filters:!((query:(match_phrase:"\ | ||
"(requestId:'93713b34-2f0b-4d53-8412-8afa98626516'))),"\ | ||
"(query:(match_phrase:(level:'info')))))&show-time-filter=true"\ | ||
"&hide-filter-bar=true" | ||
assert create_kibana_link_parameters(initial_log_url, transform_id, | ||
log_level, time_frame) == final_url |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be nice to have an option to select the log level you want to see. It should default to error, but developers might appreciate the full info logs
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 have added an Enum with two log level: INFO and ERROR.
And the user can use these options while requesting the log