Skip to content

Commit

Permalink
Merge pull request #195 from slok/slok/update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
slok authored Oct 20, 2023
2 parents cda1880 + a4a12a1 commit 8c78b40
Show file tree
Hide file tree
Showing 20 changed files with 322 additions and 533 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,34 @@ jobs:
name: Check
runs-on: ubuntu-latest
# Execute the checks inside the container instead the VM.
container: golangci/golangci-lint:v1.31.0-alpine
container: golangci/golangci-lint:v1.54.2-alpine
steps:
- uses: actions/checkout@v3.0.2
- run: golangci-lint run -E goimports
- uses: actions/checkout@v4
- run: |
# We need this go flag because it started to error after golangci-lint is using Go 1.21.
# TODO(slok): Remove it on next (>1.54.2) golangci-lint upgrade to check if this problem has gone.
export GOFLAGS="-buildvcs=false"
golangci-lint run
unit-test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- uses: actions/setup-go@v3.2.0
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.17
go-version-file: go.mod
cache: false
- run: make test

integration-test:
name: Integration test
runs-on: ubuntu-latest
needs: [check, unit-test]
steps:
- uses: actions/checkout@v3.0.2
- uses: actions/setup-go@v3.2.0
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.17
go-version-file: go.mod
cache: false
- run: make integration-test
18 changes: 17 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
---

run:
timeout: 3m
build-tags:
- integration

linters:
enable:
- misspell
- goimports
- revive
- gofmt
#- depguard
- godot

linters-settings:
revive:
rules:
# Spammy linter and complex to fix on lots of parameters. Makes more harm that it solves.
- name: unused-parameter
disabled: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Changed

- Update dependencies to latest versions.

### Added

- Support Iris library.
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ UNIT_TEST_CMD := go test `go list ./... | grep -v test\/integration` -race -c
go tool cover -func=.test_coverage.txt | tail -n1 | awk '{print "Total test coverage: " $$3}'
INTEGRATION_TEST_CMD := go test ./test/integration -race
BENCHMARK_CMD := go test `go list ./...` -benchmem -bench=.
CHECK_CMD := golangci-lint run -E goimports
CHECK_CMD := golangci-lint run
DEPS_CMD := go mod tidy
MOCKS_CMD := go generate ./internal/mocks

Expand All @@ -23,8 +23,8 @@ unit-test: ## Execute unit tests.
integration-test: ## Execute unit tests.
$(INTEGRATION_TEST_CMD)

.PHONY: test ## Alias for unit tests.
test: unit-test
.PHONY: test
test: unit-test ## Alias for unit tests.

.PHONY: benchmark
benchmark: ## Execute benchmarks.
Expand All @@ -45,3 +45,4 @@ mocks: ## Generates mocks.
.PHONY: docs
docs: ## Runs docs example on :6060.
godoc -http=":6060"

1 change: 1 addition & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Package gohttpmetrics knows how to measure http metrics in different metric formats,
it comes with a middleware that can be used for different frameworks and also the
the main Go net/http handler:
package main
import (
Expand Down
2 changes: 1 addition & 1 deletion examples/chi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"syscall"
"time"

"github.com/go-chi/chi"
"github.com/go-chi/chi/v4"
"github.com/prometheus/client_golang/prometheus/promhttp"
metrics "github.com/slok/go-http-metrics/metrics/prometheus"
"github.com/slok/go-http-metrics/middleware"
Expand Down
126 changes: 66 additions & 60 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,97 +1,103 @@
module github.com/slok/go-http-metrics

go 1.21

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.0
github.com/emicklei/go-restful/v3 v3.8.0
github.com/fasthttp/router v1.4.6
github.com/gin-gonic/gin v1.8.1
github.com/go-chi/chi v4.1.2+incompatible
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/emicklei/go-restful/v3 v3.11.0
github.com/fasthttp/router v1.4.21
github.com/gin-gonic/gin v1.9.1
github.com/go-chi/chi/v4 v4.1.3
github.com/gorilla/mux v1.8.0
github.com/julienschmidt/httprouter v1.3.0
github.com/justinas/alice v1.2.0
github.com/kataras/iris/v12 v12.2.0-beta3
github.com/labstack/echo/v4 v4.7.2
github.com/prometheus/client_golang v1.12.2
github.com/stretchr/testify v1.7.5
github.com/kataras/iris/v12 v12.2.7
github.com/labstack/echo/v4 v4.11.2
github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4
github.com/urfave/negroni v1.0.0
github.com/valyala/fasthttp v1.37.0
go.opencensus.io v0.23.0
github.com/valyala/fasthttp v1.50.0
go.opencensus.io v0.24.0
goji.io v2.0.2+incompatible
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/CloudyKit/jet/v6 v6.1.0 // indirect
github.com/Shopify/goreferrer v0.0.0-20210630161223-536fa16abd6f // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
github.com/Joker/jade v1.1.3 // indirect
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/flosch/pongo2/v4 v4.0.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-kit/log v0.1.0 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.0 // indirect
github.com/goccy/go-json v0.9.8-0.20220506185958-23bd66f4c0d5 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.5 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/iris-contrib/jade v1.1.4 // indirect
github.com/iris-contrib/schema v0.0.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kataras/blocks v0.0.5 // indirect
github.com/kataras/golog v0.1.7 // indirect
github.com/kataras/pio v0.0.10 // indirect
github.com/kataras/sitemap v0.0.5 // indirect
github.com/kataras/blocks v0.0.8 // indirect
github.com/kataras/golog v0.1.9 // indirect
github.com/kataras/pio v0.0.12 // indirect
github.com/kataras/sitemap v0.0.6 // indirect
github.com/kataras/tunnel v0.0.4 // indirect
github.com/klauspost/compress v1.15.5 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mailgun/raymond/v2 v2.0.46 // indirect
github.com/klauspost/compress v1.17.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailgun/raymond/v2 v2.0.48 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/statsd_exporter v0.21.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/statsd_exporter v0.24.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/tdewolff/minify/v2 v2.11.7 // indirect
github.com/tdewolff/parse/v2 v2.5.32 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/tdewolff/minify/v2 v2.12.9 // indirect
github.com/tdewolff/parse/v2 v2.6.8 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.0 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yosssi/ace v0.0.5 // indirect
golang.org/x/crypto v0.0.0-20220507011949-2cf3adece122 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.17
Loading

0 comments on commit 8c78b40

Please sign in to comment.