未验证 提交 b9c2ebc9 编写于 作者: Z zryfish 提交者: GitHub

fix jaeger api endpoint bug (#2140)

上级 5509f648
......@@ -26,6 +26,8 @@ import (
apiserverconfig "kubesphere.io/kubesphere/pkg/apiserver/config"
"kubesphere.io/kubesphere/pkg/utils/signals"
"kubesphere.io/kubesphere/pkg/utils/term"
tracing "kubesphere.io/kubesphere/pkg/kapis/servicemesh/metrics/v1alpha2"
)
func NewAPIServerCommand() *cobra.Command {
......@@ -90,7 +92,10 @@ func initializeServicemeshConfig(s *options.ServerRunOptions) {
// Initialize kiali config
config := kconfig.NewConfig()
//tracing.JaegerQueryUrl = s.ServiceMeshOptions.JaegerQueryHost
// Config jaeger query endpoint address
if s.ServiceMeshOptions != nil && len(s.ServiceMeshOptions.JaegerQueryHost) != 0 {
tracing.JaegerQueryUrl = s.ServiceMeshOptions.JaegerQueryHost
}
// Exclude system namespaces
config.API.Namespaces.Exclude = []string{"istio-system", "kubesphere*", "kube*"}
......
......@@ -10,7 +10,8 @@ import (
"net/http"
)
var JaegerQueryUrl = "http://jaeger-query.istio-system.svc:16686/jaeger"
// default jaeger query api endpoint address
var JaegerQueryUrl = "http://jaeger-query.istio-system.svc:16686"
// Get app metrics
func getAppMetrics(request *restful.Request, response *restful.Response) {
......@@ -84,9 +85,10 @@ func getServiceTracing(request *restful.Request, response *restful.Response) {
url := fmt.Sprintf("%s/api/traces?%s&service=%s", JaegerQueryUrl, request.Request.URL.RawQuery, serviceName)
resp, err := http.Get(url)
klog.V(4).Infof("Proxy trace request to %s", url)
if err != nil {
klog.Errorf("query jaeger faile with err %v", err)
klog.Errorf("query jaeger failed with err %v", err)
api.HandleInternalError(response, nil, err)
return
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册