From 2ae74bf13d554801d18ec0ad94048a5c9f42c7f3 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 27 Sep 2017 16:36:42 +0200 Subject: [PATCH 1/6] jaeger: logging improvement --- pkg/tracing/tracing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tracing/tracing.go b/pkg/tracing/tracing.go index be81cd7e794..3b818983159 100644 --- a/pkg/tracing/tracing.go +++ b/pkg/tracing/tracing.go @@ -80,8 +80,8 @@ func internalInit(settings *TracingSettings) (io.Closer, error) { return nil, err } - logger.Info("Initialized jaeger tracer", "address", settings.Address) opentracing.InitGlobalTracer(tracer) + logger.Info("Initializing jaeger tracer", "address", settings.Address) return closer, nil } From 2ec7bbb2bde7f19a05ddaeb683d115acf87288c4 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 27 Sep 2017 16:38:00 +0200 Subject: [PATCH 2/6] jaeger: capitalize tracer name --- pkg/tracing/tracing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tracing/tracing.go b/pkg/tracing/tracing.go index 3b818983159..921996d155d 100644 --- a/pkg/tracing/tracing.go +++ b/pkg/tracing/tracing.go @@ -81,7 +81,7 @@ func internalInit(settings *TracingSettings) (io.Closer, error) { } opentracing.InitGlobalTracer(tracer) - logger.Info("Initializing jaeger tracer", "address", settings.Address) + logger.Info("Initializing Jaeger tracer", "address", settings.Address) return closer, nil } From 9a4ae3022786f7a26f5b7fcfcd6620336e5b6ec9 Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Wed, 27 Sep 2017 22:25:00 -0700 Subject: [PATCH 3/6] Enable dualstack in every net.Dialer, fixes #9364 Default transport enables it: * https://github.com/golang/go/blob/d2826d3e06/src/net/http/transport.go#L42-L46 ``` DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, ``` See also: https://github.com/golang/go/issues/15324 --- pkg/api/app_routes.go | 1 + pkg/api/grafana_com_proxy.go | 1 + pkg/cmd/grafana-cli/services/services.go | 1 + pkg/components/imguploader/webdavuploader.go | 3 ++- pkg/models/datasource_cache.go | 1 + pkg/services/notifications/webhook.go | 3 ++- 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/api/app_routes.go b/pkg/api/app_routes.go index aee67ac8478..2b1aded206a 100644 --- a/pkg/api/app_routes.go +++ b/pkg/api/app_routes.go @@ -22,6 +22,7 @@ var pluginProxyTransport = &http.Transport{ Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, + DualStack: true, }).Dial, TLSHandshakeTimeout: 10 * time.Second, } diff --git a/pkg/api/grafana_com_proxy.go b/pkg/api/grafana_com_proxy.go index 5db508f4e11..015f690adda 100644 --- a/pkg/api/grafana_com_proxy.go +++ b/pkg/api/grafana_com_proxy.go @@ -19,6 +19,7 @@ var grafanaComProxyTransport = &http.Transport{ Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, + DualStack: true, }).Dial, TLSHandshakeTimeout: 10 * time.Second, } diff --git a/pkg/cmd/grafana-cli/services/services.go b/pkg/cmd/grafana-cli/services/services.go index 6c739f8b0ee..d3a05430944 100644 --- a/pkg/cmd/grafana-cli/services/services.go +++ b/pkg/cmd/grafana-cli/services/services.go @@ -30,6 +30,7 @@ func Init(version string) { DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, + DualStack: true, }).DialContext, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, diff --git a/pkg/components/imguploader/webdavuploader.go b/pkg/components/imguploader/webdavuploader.go index 4a056e3a48a..da51579fb2c 100644 --- a/pkg/components/imguploader/webdavuploader.go +++ b/pkg/components/imguploader/webdavuploader.go @@ -23,7 +23,8 @@ type WebdavUploader struct { var netTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ - Timeout: 60 * time.Second, + Timeout: 60 * time.Second, + DualStack: true, }).Dial, TLSHandshakeTimeout: 5 * time.Second, } diff --git a/pkg/models/datasource_cache.go b/pkg/models/datasource_cache.go index e32c0ac9e7c..bcdc77af7f4 100644 --- a/pkg/models/datasource_cache.go +++ b/pkg/models/datasource_cache.go @@ -53,6 +53,7 @@ func (ds *DataSource) GetHttpTransport() (*http.Transport, error) { Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, + DualStack: true, }).Dial, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, diff --git a/pkg/services/notifications/webhook.go b/pkg/services/notifications/webhook.go index c74804ab828..dff5aa4924a 100644 --- a/pkg/services/notifications/webhook.go +++ b/pkg/services/notifications/webhook.go @@ -27,7 +27,8 @@ type Webhook struct { var netTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ - Timeout: 30 * time.Second, + Timeout: 30 * time.Second, + DualStack: true, }).Dial, TLSHandshakeTimeout: 5 * time.Second, } From c94fa7015f3537873fdcad588e168f330c0ec215 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 28 Sep 2017 11:18:50 +0200 Subject: [PATCH 4/6] changelog: adds note about closing #9367 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4760ee163bd..4dc7d30b688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ ## Minor * **SMTP**: Make it possible to set specific EHLO for smtp client. [#9319](https://github.com/grafana/grafana/issues/9319) * **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250) +* **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367) # 4.5.2 (2017-09-22) From 7f6924ff131853114742046e03e77ffefee9aa36 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 18 Sep 2017 15:18:02 +0200 Subject: [PATCH 5/6] change go version to 1.9 --- README.md | 2 +- appveyor.yml | 2 +- circle.yml | 2 +- docs/sources/project/building_from_source.md | 2 +- scripts/build/Dockerfile | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a61640b096a..a640af5e773 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ the latest master builds [here](https://grafana.com/grafana/download) ### Dependencies -- Go 1.8.1 +- Go 1.9 - NodeJS LTS ### Building the backend diff --git a/appveyor.yml b/appveyor.yml index 9f8e9a26622..d626f6bd93f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ clone_folder: c:\gopath\src\github.com\grafana\grafana environment: nodejs_version: "6" GOPATH: c:\gopath - GOVERSION: 1.8 + GOVERSION: 1.9 install: - rmdir c:\go /s /q diff --git a/circle.yml b/circle.yml index b8767b79b8b..0d535a9c1c2 100644 --- a/circle.yml +++ b/circle.yml @@ -9,7 +9,7 @@ machine: GOPATH: "/home/ubuntu/.go_workspace" ORG_PATH: "github.com/grafana" REPO_PATH: "${ORG_PATH}/grafana" - GODIST: "go1.8.linux-amd64.tar.gz" + GODIST: "go1.9.linux-amd64.tar.gz" post: - mkdir -p ~/download - mkdir -p ~/docker diff --git a/docs/sources/project/building_from_source.md b/docs/sources/project/building_from_source.md index 5056f1bd7b1..f33b951da78 100644 --- a/docs/sources/project/building_from_source.md +++ b/docs/sources/project/building_from_source.md @@ -13,7 +13,7 @@ dev environment. Grafana ships with its own required backend server; also comple ## Dependencies -- [Go 1.8.1](https://golang.org/dl/) +- [Go 1.9](https://golang.org/dl/) - [NodeJS LTS](https://nodejs.org/download/) - [Git](https://git-scm.com/downloads) diff --git a/scripts/build/Dockerfile b/scripts/build/Dockerfile index 90302563546..da9a99706bb 100644 --- a/scripts/build/Dockerfile +++ b/scripts/build/Dockerfile @@ -23,10 +23,10 @@ RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \ RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && \ yum install -y yarn --nogpgcheck && \ - wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz && \ - tar -C /usr/local -xzf go1.8.linux-amd64.tar.gz + wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \ + tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz -ENV GOLANG_VERSION 1.8 +ENV GOLANG_VERSION 1.9 ENV PATH /usr/local/go/bin:$PATH RUN mkdir -p /go/src /go/bin && chmod -R 777 /go From 4dea94791d1454dd3baf317cc2ef463bb9323385 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 28 Sep 2017 11:53:01 +0200 Subject: [PATCH 6/6] changelog: add note about using golang 1.9 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dc7d30b688..1b2d1f528c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ * **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250) * **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367) +## Tech +* **Go**: Grafana is now built using golang 1.9 + # 4.5.2 (2017-09-22) ## Fixes