-
Notifications
You must be signed in to change notification settings - Fork 304
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
PAYARA-931 Payara Micro Request Tracing #1107
PAYARA-931 Payara Micro Request Tracing #1107
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
case "--enableRequestTracing": | ||
enableRequestTracing = true; | ||
break; | ||
case "--requestTracingThresholdUnit": |
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 should be some validation on the the units passed in on the command line to ensure they are valid units.
@@ -155,6 +155,12 @@ Portions Copyright [2016] [Payara Foundation and/or its affiliates] | |||
</transaction-service> |
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.
microdomain nocluster also need configuring correctly
entries to microdomain-nocluster.xml
Updated with required changes. |
jenkins test please |
1 similar comment
jenkins test please |
One or more tests have failed |
jenkins test please |
All tests have passed |
case "--requestTracingThresholdValue": | ||
try { | ||
requestTracingThresholdValue = | ||
Long.parseLong(args[i + 1]); |
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 smells like ArrayIndexOutOfBoundsException
when a user forgets to include the actual units.
Two parameters for a single thing look a bit awkward. Why not +parsing units from the value itself when needed? From the other hand It could become somewhat clumsy with microseconds ( |
I like the idea of a single option, we could even go full hog and combine all 3 into one (enable, time, and units) - though in either situation I'm fond of keeping the discrete options for flexibility. I'll have a play and see what I can cobble together. I'll check for any obvious OutOfBounds cases, but I believe several of the configuration options for Payara Micro can fall afoul of this, so is probably worth its own PR to fix it rather than tacking it onto this one. |
@@ -1410,6 +1431,112 @@ private void scanArgs(String[] args) { | |||
case "--disablePhoneHome": | |||
disablePhoneHome = true; | |||
break; | |||
case "--requestTracing": |
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 screaming for refactoring.
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.
Sure. I've just noticed that this option makes the --enableRequestTracing
one completely obsolete, so I'll rename it to that.
Heavily modified the The option now enables the request tracing service, and optionally configures the threshold unit and value. I've also added extra unit validation (to both this option, and the original one), allowing you to now enter:
I decided against enforcing proper grammar and refusing options such as "3day", as not everyone cares as much as I do. Example usages:
In its current state, entering something like I've elected to not fix the potential Array index out of bounds issues in this PR, as we're looking at spinning the scanArgs method out into a proper parsing class. Note, these options override each other without warning (like most others) - the last one entered will override the previous. For example:
|
jenkins test please |
One or more tests have failed |
jenkins test please |
All tests have passed |
* PAYARA-931 Add in non-persistent request tracing to Payara Micro * PAYARA-931 Rework to work with UberJar option * PAYARA-931 Missed Help options * PAYARA-931 Add in validation and allow lowercase. Also adds in required entries to microdomain-nocluster.xml * PAYARA-931 Correct message * PAYARA-931 Add in extra unit validation, and add in convenience option * PAYARA-931 Add help text * PAYARA-931 Formatting * PAYARA-931 Missed milliseconds * PAYARA-931 Missed minutes! * PAYARA-931 Shorthand minute * PAYARA-931 Remove obsolete option, and rename new option in place. * PAYARA-931 Formatting
Adds in command line options to enable and configure request tracing in Payara Micro.
Also turns on the Notification service by default.
The new options are:
--enableRequestTracing
- Just a flag; you don't need to add true or false afterwards.--requestTracingThresholdUnit
- Accepts a String value determining the time unit, defaulting to seconds if no value is given. The accepted strings are (case insensitive): NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, and DAYS.--requestTracingThresholdValue
- Accepts a long to determine the threshold value before a request is traced, defaulting to 30 if no value is entered.As an example of usage:
java -jar payaramicro.jar --enableRequestTracing --requestTracingThresholdUnit NANOSECONDS --requestTracingThresholdValue 7