From 1b3e315954a234939bd3fd91739cbd338d79d312 Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 19:59:35 +0200 Subject: [PATCH 1/6] Adding HTTP GET handler for health check --- receiver/http/http.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/receiver/http/http.go b/receiver/http/http.go index 72ef37fd9..9f043ef53 100644 --- a/receiver/http/http.go +++ b/receiver/http/http.go @@ -117,6 +117,11 @@ func (rcv *HTTP) Stat(send helper.StatCallback) { } func (rcv *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.Method == "GET" { + http.Error(w, "OK", http.StatusOK) + return + } + if r.Method != "POST" { atomic.AddUint32(&rcv.errors, 1) http.Error(w, fmt.Sprintf("Method %#v is not supported", r.Method), http.StatusBadRequest) From 99631d14d1034f146864ed950c9a9fedc18fe119 Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 22:15:29 +0200 Subject: [PATCH 2/6] Fixing go tip --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0702224c5..6169d0fc4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,11 +24,11 @@ jobs: - name: Set up Go tip if: matrix.go == 'tip' run: | - curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz - ls -lah gotip.tar.gz - mkdir -p ~/sdk/gotip - tar -C ~/sdk/gotip -xzf gotip.tar.gz - ~/sdk/gotip/bin/go version + curl -o go.tar.gz -L \ + https://github.com/AlekSi/golang-tip/releases/download/tip/master.linux-amd64.tar.gz + sudo tar -C /usr/local -xzf go.tar.gz + sudo ln -s /usr/local/go/bin/* /usr/local/bin/ + /usr/local/bin/go version echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV - name: Check out code into the Go module directory From 743c22d3d843ada4e29f8d20f667888d5fcc3a1c Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 22:23:13 +0200 Subject: [PATCH 3/6] Fix tests --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6169d0fc4..760842611 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,6 +63,7 @@ jobs: - name: Install packaging dependencies run: | + gem install ffi -v 1.17.0 gem install dotenv -v 2.8.1 gem install rake fpm:1.10.2 package_cloud go install github.com/mitchellh/gox@latest From 73d2dbbef81613a9c1a731ec34bed817a08e004d Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 22:28:53 +0200 Subject: [PATCH 4/6] Fix tests --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 760842611..b8a1d1858 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,6 +63,7 @@ jobs: - name: Install packaging dependencies run: | + gem update --system gem install ffi -v 1.17.0 gem install dotenv -v 2.8.1 gem install rake fpm:1.10.2 package_cloud From 20422f12a8199189834efd2333bc2cdfa64b7854 Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 22:35:41 +0200 Subject: [PATCH 5/6] Let's try latest ruby --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b8a1d1858..b917df6f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,14 +58,9 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' # Version range or exact version of a Ruby version to use, using semvers version range syntax. - name: Install packaging dependencies run: | - gem update --system - gem install ffi -v 1.17.0 - gem install dotenv -v 2.8.1 gem install rake fpm:1.10.2 package_cloud go install github.com/mitchellh/gox@latest From 083e129bcea58095a787b2c4cf47ef49be83462a Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Wed, 5 Jun 2024 22:48:57 +0200 Subject: [PATCH 6/6] Let's try latest ruby --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b917df6f1..e5330f7cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,10 +58,12 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' - name: Install packaging dependencies run: | - gem install rake fpm:1.10.2 package_cloud + gem install rake fpm package_cloud go install github.com/mitchellh/gox@latest - name: Check packaging