-
Notifications
You must be signed in to change notification settings - Fork 700
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
SOLR-17638 Some CLI errors not logged when starting prometheus exporter #3236
base: main
Are you sure you want to change the base?
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.
A couple of small things, but this looks GREAT, and thanks for tackling it. I like the enhanced error messaging and the testing.
@@ -148,7 +148,7 @@ public static void main(String[] args) { | |||
.argName("BASE_URL") | |||
.type(String.class) | |||
.desc( | |||
"Specify the Solr base URL when connecting to Solr in standalone mode. If omitted both the -b parameter and the -z parameter, connect to http://localhost:8983/solr. For example 'http://localhost:8983/solr'.") | |||
"Specify the Solr base URL when connecting to Solr in standalone mode. If omitted both the -s parameter and the -z parameter, connect to http://localhost:8983/solr. For example 'http://localhost:8983/solr'.") |
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 we actually need the /solr
? I know in the main SolrCLI we don't mention /solr
becasue it can ALSO be /api
depending on what end points you are hitting. This may be a bit different! Also, if you look at bin/solr
we have some stuff to populate environment variables that are read by CLIUtils.getDefaultSolrUrl()
.. solr.tool.host
.. I wonder if we should be reusing that here? Though maybe that is really for another PR?
@@ -241,7 +241,7 @@ public static void main(String[] args) { | |||
.argName("ZK_HOST") | |||
.type(String.class) | |||
.desc( | |||
"Specify the ZooKeeper connection string when connecting to Solr in SolrCloud mode. If omitted both the -b parameter and the -z parameter, connect to http://localhost:8983/solr. For example 'localhost:2181/solr'.") | |||
"Specify the ZooKeeper connection string when connecting to Solr in SolrCloud mode. If omitted both the -s parameter and the -z parameter, connect to http://localhost:8983/solr. For example 'localhost:2181/solr'.") |
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.
One more though, we do have in ToolBase.java
the public OptionGroup getConnectionOptions
that defines these options... Though to use that, maybe the SolrExporter would need to be a direct part of SolrCLI
?
Thanks for jumping on this @stillalex and looks good. |
Other than some precommit issues, this all looks good @stillalex, do you need anything from me to get this moved forward! I'm looking forward to getting through all the CLI issues ;-) |
6b2cf02
to
b7b7fb3
Compare
keeping an eye on #3240 to get some inspiration for this change. I added a similar |
b7b7fb3
to
abfd277
Compare
@stillalex your plan makes sense to me! It LGTM. |
https://issues.apache.org/jira/browse/SOLR-17638
Description
Fixing the error logging by only using the message. it seems including the entire stacktrace will crash the output completely. I am using SolrCLI as an example which seems to have a similar approach.
I am also fixing the fallback to the default value which was not happening.
Solution
Please provide a short description of the approach taken to implement your solution.
Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.