-
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
Conversation
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.
Getting close, but need to use the kabana URL returned by the service
servicex/app/transforms.py
Outdated
if single_transform: | ||
rich.print(table) | ||
if open_link: | ||
webbrowser.open(kibana_link.format(t.request_id)) |
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.
This is a nice find! I didn't know about the webbrowser
package
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 need help to test this function, I have prepared a test case but it opens the URL in web browser each time I run the test locally. I have not included the tests in this commit, don't know how it will behave with the CI/CD jobs.
servicex/app/transforms.py
Outdated
url: Optional[str] = url_cli_option, | ||
backend: Optional[str] = backend_cli_option, | ||
transform_id: str = typer.Option(None, "-t", "--transform-id", help="Transform ID"), | ||
open_link: Optional[bool] = typer.Option(False, "-o", "--open-link", help="Open Link in browser") |
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'm not sure we need this option. Let's see what people think about it always opening the link
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.
Removed the --open-link
backend: Optional[str] = backend_cli_option, | ||
transform_id: str = typer.Option(None, "-t", "--transform-id", help="Transform ID"), | ||
open_link: Optional[bool] = typer.Option(False, "-o", "--open-link", help="Open Link in browser") | ||
): |
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
Need to fix the flake8 errors too |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## log_url_and_title #360 +/- ##
=====================================================
+ Coverage 79.91% 81.16% +1.24%
=====================================================
Files 41 42 +1
Lines 2255 2325 +70
=====================================================
+ Hits 1802 1887 +85
+ Misses 453 438 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
servicex/models.py
Outdated
@@ -61,6 +61,14 @@ class Status(str, Enum): | |||
running = "Running" | |||
|
|||
|
|||
class LogLevel(str, Enum): |
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.
There is no reason for this to be in this file. These values are not part of the pydantic model. This can just be local to the app.transforms
file
…g level and g parameters for time frame
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.
This looks great.. Thank you
* Added CLI option "logs" to redirect user to transform ids error logs * removed the URL optional opening, added info and error level, removed the table * Added loglevel in models for info and error * Removed Log Level from models.py * Logic to add the filters in the URL, _a parameters for request id, log level and g parameters for time frame * edited the logs cli option to use the log url from transformation status message
* Added CLI option "logs" to redirect user to transform ids error logs * removed the URL optional opening, added info and error level, removed the table * Added loglevel in models for info and error * Removed Log Level from models.py * Logic to add the filters in the URL, _a parameters for request id, log level and g parameters for time frame * edited the logs cli option to use the log url from transformation status message
Created a "logs" CLI option under the "tranforms" option
The user is able to select the backend, tranform id and the option to redirect URL to open in the user's browser.
USAGE: servicex transforms logs -b testing4 -t 93713b34-2f0b-4d53-8412-8afa98626516 -o
The link to the kibana url is hardcoded and the transformer id are plugged to give the result.
TODO: Unit test cases - trying to explore how to Mock some request to make it to work with the CLI