Kiali should warn the user when Grafana is not configured properly
Kiali does not work with the grafana installation without setting the url field. Other addon services such as jaeger and prometheus work out of the box without setting this field but Grafana does not.
The kiali logs show:
2022-05-02T18:24:00Z DBG [GRAFANA] URL discovery for service 'grafana', namespace 'istio-system'...
2022-05-02T18:24:00Z DBG [GRAFANA] Client is not Openshift, discovery url is only supported in Openshift
When the url field for Grafana is not set, Kiali should show:
- error/warning messages in the kiali server
- Warning level notification in the UI masthead
- A descriptive error message saying something like "'url' field is not set. This is required for Kiali to work with Grafana integration"
The external URL of Grafana is not enabled by default. Perhaps it's the internal service that has changed? and now is giving an error that the addon is not found?
The external URL of Grafana is not enabled by default.
The url field is empty but the service is enabled by default in both the server: https://github.com/kiali/kiali/blob/master/config/config.go#L555 and the operator: https://github.com/kiali/kiali-operator/blob/master/roles/default/kiali-deploy/defaults/main.yml#L146
Perhaps it's the internal service that has changed? and now is giving an error that the addon is not found?
in_cluster_url is correct in Kiali's config I copied above. Setting url explicitly fixes the issue but this is not required for the other external services like jaeger where the default setup works fine without setting url.
I think part of the issue is that the Kiali integration with Grafana creates links using that url setting. If those links aren't resolvable by the user then they will be broken. For example, if kiali defaults to using the in_cluster_url of grafana.istio-system when generating the link, then that probably won't be resolvable when the user clicks on the link. The url field is pretty much required since there's not a good way for Kiali to provide a default for it, at least not in non-openshift environments. What was confusing here was that the defaults didn't work. The grafana service was enabled and deployed properly but the only indication that the integration was broken was an info level message in the notification area:

Just deploying the grafana addon along with Kiali will not work. You must additionally set the url field in Kiali's external_services.grafana.url. That is documented and I don't think there's a way around that but perhaps Kiali can make it more obvious that the integration is broken without the url field being set.
Related to this, it'd be nice to have an admin page in Kiali where you can see the different external services and their status in relation to Kiali. It would be easy to highlight there which external services are misconfigured. Probably related to this issue: https://github.com/kiali/kiali/issues/4435.
ou must additionally set the url field in Kiali's external_services.grafana.url.
That's correct, because that part can't be controlled unless the user exposes the addons, and that's something that depends on the installation.
I agree that perhaps the way to tell the user that this external service is not well configured could be improved or updated in the FAQ, perhaps there is some old information there.
Probably related to this issue: https://github.com/kiali/kiali/issues/4435.
It's not related to this issue, that's a completely separate topic.
Today, Kiali has an "implicit" control plane management and it shows the state in the mast-head, which should be the scope of this issue.
Kiali can make it more obvious that the integration is broken without the
urlfield being set.
I don't know how much more obvious Kiali can make it ? :) It says right in the UI message, "grafana URL is not set in configuration":

I don't know how much more obvious Kiali can make it ? :) It says right in the UI message, "grafana URL is not set in configuration":
The non-obvious thing for me here was why it didn't work by default like the other addon services. Makes sense for grafana since the url field is required for the grafana integration to work but having 1. error/warning messages in the kiali server 2. Warning level notification 3. More descriptive error message saying something like "'url' field is not set. This is required for Kiali to work with Grafana integration", all would've helped.
But to be clear, this isn't a bug so I'll remove that label and maybe update the title.
@nrfox If you think users will be confused by this, and we can make some simple enhancements (1/2 day max), please assign yourself and add to the sprint. Otherwise, please close this one.
@leandroberetta , when #5988 is resolved please make any necessary updates to the docs and then close this one as well. You may want to read through this one and see if it sheds any light on that other issue.
@leandroberetta , when #5988 is resolved please make any necessary updates to the docs and then close this one as well. You may want to read through this one and see if it sheds any light on that other issue.
@jshaughn @nrfox
I think that documentation can be improved a little bit, for example:
- Letting the user know that Kiali will make an http call to Grafana (if there is an issue, no links are displayed)
- Letting the user know that Kiali would try to check that the dashboards are installed in Grafana (if no links in Grafana, no links in Kiali)
Apart from these points, I don't see that we can improve Kiali's code, Kiali warns then the URL is not set and also when Grafana is not reachable.
As part of https://github.com/kiali/kiali/issues/5913 it'd be nice to surface more details on that page about the infrastructure that Kiali relies on such as grafana.