You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "janhoy (via GitHub)" <gi...@apache.org> on 2023/09/26 10:30:46 UTC

[GitHub] [solr] janhoy opened a new pull request, #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

janhoy opened a new pull request, #1959:
URL: https://github.com/apache/solr/pull/1959

   https://issues.apache.org/jira/browse/SOLR-16997
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] stillalex commented on a diff in pull request #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

Posted by "stillalex (via GitHub)" <gi...@apache.org>.
stillalex commented on code in PR #1959:
URL: https://github.com/apache/solr/pull/1959#discussion_r1337153085


##########
solr/modules/opentelemetry/src/java/org/apache/solr/opentelemetry/OtelTracerConfigurator.java:
##########
@@ -65,7 +65,9 @@ void prepareConfiguration(NamedList<?> args) {
     setDefaultIfNotConfigured("OTEL_EXPORTER_OTLP_PROTOCOL", "grpc");
     setDefaultIfNotConfigured("OTEL_TRACES_SAMPLER", "parentbased_always_on");
     setDefaultIfNotConfigured("OTEL_PROPAGATORS", "tracecontext,baggage");
-    addOtelResourceAttributes(Map.of("host.name", System.getProperty("host")));
+    if (System.getProperty("host") != null) {

Review Comment:
   hmm, I believe I had this in one of my PRs and you said it was not needed because this property is present everywhere @janhoy :) 
   I think it was https://github.com/apache/solr/pull/1841#discussion_r1294442984



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] janhoy commented on a diff in pull request #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy commented on code in PR #1959:
URL: https://github.com/apache/solr/pull/1959#discussion_r1337160003


##########
solr/modules/opentelemetry/src/java/org/apache/solr/opentelemetry/OtelTracerConfigurator.java:
##########
@@ -65,7 +65,9 @@ void prepareConfiguration(NamedList<?> args) {
     setDefaultIfNotConfigured("OTEL_EXPORTER_OTLP_PROTOCOL", "grpc");
     setDefaultIfNotConfigured("OTEL_TRACES_SAMPLER", "parentbased_always_on");
     setDefaultIfNotConfigured("OTEL_PROPAGATORS", "tracecontext,baggage");
-    addOtelResourceAttributes(Map.of("host.name", System.getProperty("host")));
+    if (System.getProperty("host") != null) {

Review Comment:
   I was surprised too to learn that SOLR_HOST is not always set in our start script. And also learnt that `Map.of(k,v)` does null-check both for key and value. Those two facts together caused this. Although only likely a problem in dev environments, it's nice to fix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] stillalex commented on a diff in pull request #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

Posted by "stillalex (via GitHub)" <gi...@apache.org>.
stillalex commented on code in PR #1959:
URL: https://github.com/apache/solr/pull/1959#discussion_r1337164802


##########
solr/modules/opentelemetry/src/java/org/apache/solr/opentelemetry/OtelTracerConfigurator.java:
##########
@@ -65,7 +65,9 @@ void prepareConfiguration(NamedList<?> args) {
     setDefaultIfNotConfigured("OTEL_EXPORTER_OTLP_PROTOCOL", "grpc");
     setDefaultIfNotConfigured("OTEL_TRACES_SAMPLER", "parentbased_always_on");
     setDefaultIfNotConfigured("OTEL_PROPAGATORS", "tracecontext,baggage");
-    addOtelResourceAttributes(Map.of("host.name", System.getProperty("host")));
+    if (System.getProperty("host") != null) {

Review Comment:
   > And also learnt that Map.of(k,v) does null-check both for key and value.
   
   yeah, this one bit me a few times too. almost all of the immutable collection utils (like List.of) do not allow nulls. weird rule.
   
   > Although only likely a problem in dev environments, it's nice to fix.
   
   agreed. although my preference would have been a default instead of missing value. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] stillalex commented on a diff in pull request #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

Posted by "stillalex (via GitHub)" <gi...@apache.org>.
stillalex commented on code in PR #1959:
URL: https://github.com/apache/solr/pull/1959#discussion_r1337153085


##########
solr/modules/opentelemetry/src/java/org/apache/solr/opentelemetry/OtelTracerConfigurator.java:
##########
@@ -65,7 +65,9 @@ void prepareConfiguration(NamedList<?> args) {
     setDefaultIfNotConfigured("OTEL_EXPORTER_OTLP_PROTOCOL", "grpc");
     setDefaultIfNotConfigured("OTEL_TRACES_SAMPLER", "parentbased_always_on");
     setDefaultIfNotConfigured("OTEL_PROPAGATORS", "tracecontext,baggage");
-    addOtelResourceAttributes(Map.of("host.name", System.getProperty("host")));
+    if (System.getProperty("host") != null) {

Review Comment:
   hmm, I believe I had this in one of my PRs and you said it was not needed because this property is present everywhere @janhoy :) 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] janhoy merged pull request #1959: SOLR-16997: OTEL configurator NPE when SOLR_HOST not set

Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy merged PR #1959:
URL: https://github.com/apache/solr/pull/1959


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org