[
https://issues.apache.org/jira/browse/CLOUDSTACK-9071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15500742#comment-15500742
]
ASF GitHub Bot commented on CLOUDSTACK-9071:
--------------------------------------------
Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1673#discussion_r79302819
--- Diff: server/src/com/cloud/server/StatsCollector.java ---
@@ -285,9 +286,15 @@ private void init(Map<String, String> configs) {
s_logger.info(scheme + " is not a valid protocol for
external statistics. No statistics will be send.");
}
- externalStatsHost = uri.getHost();
+ if (!StringUtils.isEmpty(uri.getHost())) {
+ externalStatsHost = uri.getHost();
+ }
+
externalStatsPort = uri.getPort();
- externalStatsPrefix = uri.getPath().substring(1);
+
+ if (!StringUtils.isEmpty(uri.getPath())) {
+ externalStatsPrefix = uri.getPath().substring(1);
+ }
/* Append a dot (.) to the prefix if it is set */
if (externalStatsPrefix != null &&
!externalStatsPrefix.equals("")) {
--- End diff --
I realize it's not in the scope of this PR, but would you consider changing
this `if` block to use `StringUtils.isEmpty`?
> stats.output.uri stops the server from starting if the uri is malformed
> -----------------------------------------------------------------------
>
> Key: CLOUDSTACK-9071
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9071
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.6.0
> Reporter: Carles Figuerola
>
> After inputting a malformed uri (was missing the graphite://) and restarting
> the management service, the application stops at:
> 2015-11-17 11:06:42,861 INFO [c.c.s.StatsCollector]
> (localhost-startStop-1:null) metrics.dev.company.net is not a valid protocol
> for external statistics. No statistics will be send.
> No more logs are output and tomcat is up but serving a completely blank page.
> When the uri has this form: (graphite://metrics.dev.company.net:2013), the
> end result is very similar to the previous one
> (also, the last word should be "sent")
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)