From bcc0a84a99ecbce8b91fdc39c14c8d7e18f1d9e8 Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Thu, 7 Jan 2021 16:27:41 +0530 Subject: [PATCH 1/4] getting baseUrl from env --- frontend/src/api/metricsAPI.js | 2 +- frontend/src/api/tracesAPI.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/metricsAPI.js b/frontend/src/api/metricsAPI.js index 72390d6047..e60072e932 100644 --- a/frontend/src/api/metricsAPI.js +++ b/frontend/src/api/metricsAPI.js @@ -3,7 +3,7 @@ import axios from 'axios'; export default axios.create({ // baseURL: 'http://104.211.113.204:8080/api/v1/', // baseURL: process.env.REACT_APP_QUERY_SERVICE_URL, - baseURL: 'http://localhost:3000/api/v1/', + baseURL: process.env.REACT_APP_QUERY_SERVICE_URL + '/api/v1', // console.log('in metrics API', process.env.QUERY_SERVICE_URL) } ); \ No newline at end of file diff --git a/frontend/src/api/tracesAPI.js b/frontend/src/api/tracesAPI.js index 332c37c782..8c765fc0ae 100644 --- a/frontend/src/api/tracesAPI.js +++ b/frontend/src/api/tracesAPI.js @@ -5,8 +5,7 @@ export default axios.create({ // baseURL: 'http://104.211.113.204:8080/api/v1/' // baseURL: process.env.QUERY_SERVICE_URL, // console.log('in traces API', process.env.QUERY_SERVICE_URL) - baseURL: 'http://localhost:3000/api/v1/', - + baseURL: process.env.REACT_APP_QUERY_SERVICE_URL + '/api/v1', }); From dcbf596073c2de600b5af13e86431292b1c76633 Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Thu, 7 Jan 2021 16:28:31 +0530 Subject: [PATCH 2/4] removed cors --- pkg/query-service/app/server.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/query-service/app/server.go b/pkg/query-service/app/server.go index d5c294b7f3..6e38f9ab26 100644 --- a/pkg/query-service/app/server.go +++ b/pkg/query-service/app/server.go @@ -5,7 +5,6 @@ import ( "net/http" "github.com/gorilla/handlers" - "github.com/rs/cors" "github.com/soheilhy/cmux" "go.signoz.io/query-service/druidQuery" "go.signoz.io/query-service/godruid" @@ -92,14 +91,14 @@ func createHTTPServer(druidClientUrl string) *http.Server { apiHandler.RegisterRoutes(r) - c := cors.New(cors.Options{ - AllowedOrigins: []string{"http://localhost:3000"}, - // AllowCredentials: true, - // AllowedMethods: []string{"GET", "DELETE", "POST", "PUT"}, - }) + // c := cors.New(cors.Options{ + // AllowedOrigins: []string{"http://localhost:3000"}, + // // AllowCredentials: true, + // // AllowedMethods: []string{"GET", "DELETE", "POST", "PUT"}, + // }) - handler := c.Handler(r) - // var handler http.Handler = r + // handler := c.Handler(r) + var handler http.Handler = r handler = handlers.CompressHandler(handler) From d37b518da698416c8fd4fb45291a8ba974aeb538 Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Thu, 7 Jan 2021 16:29:05 +0530 Subject: [PATCH 3/4] removed use of env in helm --- deploy/kubernetes/platform/signoz-charts/frontend/values.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml b/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml index a9324f10ea..eb08744919 100644 --- a/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml +++ b/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml @@ -12,9 +12,6 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -configVars: - REACT_APP_QUERY_SERVICE_URL: http://localhost:3000/api/v1/ - config: name: signoz-nginx-config queryServiceUrl: signoz-query-service:8080 From 61b3164d28cbce1ce046e99d0eeb788888f5c8bc Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Thu, 7 Jan 2021 18:04:41 +0530 Subject: [PATCH 4/4] frontend working with LB --- deploy/kubernetes/platform/Chart.lock | 6 +++--- deploy/kubernetes/platform/Chart.yaml | 2 +- .../kubernetes/platform/signoz-charts/frontend/Chart.yaml | 4 ++-- .../kubernetes/platform/signoz-charts/frontend/values.yaml | 2 ++ .../platform/signoz-charts/query-service/Chart.yaml | 2 +- deploy/kubernetes/platform/values.yaml | 4 ---- frontend/.dockerignore | 3 +++ frontend/src/api/metricsAPI.js | 2 +- frontend/src/api/tracesAPI.js | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 frontend/.dockerignore diff --git a/deploy/kubernetes/platform/Chart.lock b/deploy/kubernetes/platform/Chart.lock index 474270d987..0bc20309e0 100644 --- a/deploy/kubernetes/platform/Chart.lock +++ b/deploy/kubernetes/platform/Chart.lock @@ -16,6 +16,6 @@ dependencies: version: 0.1.1 - name: frontend repository: file://./signoz-charts/frontend - version: 0.1.4 -digest: sha256:f29f2d0a5e58617075b0e1fd513bf7699138e20dfb94f1cddcfc8ff6a9bcb371 -generated: "2021-01-02T01:14:15.321064+05:30" + version: 0.1.6 +digest: sha256:1acfbd4b86e7ca6b70101f7dc3b2ab26aa5e72df2f454800f6dda7e645580978 +generated: "2021-01-07T17:50:04.227534+05:30" diff --git a/deploy/kubernetes/platform/Chart.yaml b/deploy/kubernetes/platform/Chart.yaml index 496189b934..0e82f228ad 100644 --- a/deploy/kubernetes/platform/Chart.yaml +++ b/deploy/kubernetes/platform/Chart.yaml @@ -40,4 +40,4 @@ dependencies: version: 0.1.1 - name: frontend repository: "file://./signoz-charts/frontend" - version: 0.1.4 \ No newline at end of file + version: 0.1.6 \ No newline at end of file diff --git a/deploy/kubernetes/platform/signoz-charts/frontend/Chart.yaml b/deploy/kubernetes/platform/signoz-charts/frontend/Chart.yaml index 40c43de2c1..7003fc1e76 100644 --- a/deploy/kubernetes/platform/signoz-charts/frontend/Chart.yaml +++ b/deploy/kubernetes/platform/signoz-charts/frontend/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.4 +version: 0.1.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 0.1.4 +appVersion: 0.1.6 diff --git a/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml b/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml index eb08744919..6a925e2fc6 100644 --- a/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml +++ b/deploy/kubernetes/platform/signoz-charts/frontend/values.yaml @@ -12,6 +12,8 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +configVars: {} + config: name: signoz-nginx-config queryServiceUrl: signoz-query-service:8080 diff --git a/deploy/kubernetes/platform/signoz-charts/query-service/Chart.yaml b/deploy/kubernetes/platform/signoz-charts/query-service/Chart.yaml index c4c00411cf..5a7e010b75 100644 --- a/deploy/kubernetes/platform/signoz-charts/query-service/Chart.yaml +++ b/deploy/kubernetes/platform/signoz-charts/query-service/Chart.yaml @@ -18,4 +18,4 @@ version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 0.1.1 +appVersion: 0.1.2 diff --git a/deploy/kubernetes/platform/values.yaml b/deploy/kubernetes/platform/values.yaml index 9f500349fe..ad90ed6c5a 100644 --- a/deploy/kubernetes/platform/values.yaml +++ b/deploy/kubernetes/platform/values.yaml @@ -35,7 +35,3 @@ query-service: configVars: DruidClientUrl: http://signoz-druid-router:8888 DruidDatasource: flattened_spans - -frontend: - configVars: - REACT_APP_QUERY_SERVICE_URL: http://localhost:3000/api/v1/ \ No newline at end of file diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000000..90b366a44f --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.vscode +build \ No newline at end of file diff --git a/frontend/src/api/metricsAPI.js b/frontend/src/api/metricsAPI.js index e60072e932..15ca939fa2 100644 --- a/frontend/src/api/metricsAPI.js +++ b/frontend/src/api/metricsAPI.js @@ -3,7 +3,7 @@ import axios from 'axios'; export default axios.create({ // baseURL: 'http://104.211.113.204:8080/api/v1/', // baseURL: process.env.REACT_APP_QUERY_SERVICE_URL, - baseURL: process.env.REACT_APP_QUERY_SERVICE_URL + '/api/v1', + baseURL: 'api/v1/', // console.log('in metrics API', process.env.QUERY_SERVICE_URL) } ); \ No newline at end of file diff --git a/frontend/src/api/tracesAPI.js b/frontend/src/api/tracesAPI.js index 8c765fc0ae..d94c366057 100644 --- a/frontend/src/api/tracesAPI.js +++ b/frontend/src/api/tracesAPI.js @@ -5,7 +5,7 @@ export default axios.create({ // baseURL: 'http://104.211.113.204:8080/api/v1/' // baseURL: process.env.QUERY_SERVICE_URL, // console.log('in traces API', process.env.QUERY_SERVICE_URL) - baseURL: process.env.REACT_APP_QUERY_SERVICE_URL + '/api/v1', + baseURL: 'api/v1/', });