From 18c8e54a95ff68e5b7c31412d437adcb07846457 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 01:30:11 +0000 Subject: [PATCH 1/8] chore(deps): bump golang.org/x/net in /examples/multi-services Bumps [golang.org/x/net](https://github.com/golang/net) from 0.19.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] --- examples/multi-services/go.mod | 4 ++-- examples/multi-services/go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/multi-services/go.mod b/examples/multi-services/go.mod index c75273a..862bd14 100644 --- a/examples/multi-services/go.mod +++ b/examples/multi-services/go.mod @@ -24,8 +24,8 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect diff --git a/examples/multi-services/go.sum b/examples/multi-services/go.sum index 2bf8ce2..5bfd1c3 100644 --- a/examples/multi-services/go.sum +++ b/examples/multi-services/go.sum @@ -18,14 +18,11 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= -go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= @@ -38,10 +35,10 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 1a867ac1dad0d48ec97c811a3b4ff459881d6b48 Mon Sep 17 00:00:00 2001 From: sswastioyono18 Date: Tue, 4 Jun 2024 08:32:32 +0700 Subject: [PATCH 2/8] feat: added traceID on context --- middleware.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/middleware.go b/middleware.go index d6dfda0..8c43cca 100644 --- a/middleware.go +++ b/middleware.go @@ -1,6 +1,7 @@ package otelchi import ( + "context" "net/http" "sync" @@ -180,6 +181,8 @@ func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { rrw := getRRW(w) defer putRRW(rrw) + ctx = context.WithValue(ctx, "traceID", span.SpanContext().TraceID().String()) + // execute next http handler r = r.WithContext(ctx) tw.handler.ServeHTTP(rrw.writer, r) From edd5dd97f9db6840811618810e7ded3973be23ed Mon Sep 17 00:00:00 2001 From: sswastioyono18 Date: Sun, 7 Jul 2024 08:25:35 +0700 Subject: [PATCH 3/8] feat: renamed to trace-id --- .github/workflows/ci.yaml | 2 +- .github/workflows/release-please-main.yml | 19 +++++++++++++++++++ middleware.go | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-please-main.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9fb34f5..d720e00 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ on: jobs: test-build: - runs-on: ubuntu-latest + runs-on: ktbs-small-runner steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/release-please-main.yml b/.github/workflows/release-please-main.yml new file mode 100644 index 0000000..2c2fe53 --- /dev/null +++ b/.github/workflows/release-please-main.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - master + +name: release-please +jobs: + release-please: + runs-on: ktbs-small-runner + steps: + - uses: google-github-actions/release-please-action@v3 + with: + token: ${{ secrets.GH_TOKEN }} + release-type: go + draft-pull-request: "true" + labels: "be-autorelease-pending" + release-labels: "be-autorelease-tagged" + + diff --git a/middleware.go b/middleware.go index 8c43cca..cd3bb71 100644 --- a/middleware.go +++ b/middleware.go @@ -181,7 +181,7 @@ func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { rrw := getRRW(w) defer putRRW(rrw) - ctx = context.WithValue(ctx, "traceID", span.SpanContext().TraceID().String()) + ctx = context.WithValue(ctx, "trace-id", span.SpanContext().TraceID().String()) // execute next http handler r = r.WithContext(ctx) From e47a8a811b5387fe0cea6fef98c0a731884e4fc8 Mon Sep 17 00:00:00 2001 From: sswastioyono18 Date: Sun, 7 Jul 2024 08:26:43 +0700 Subject: [PATCH 4/8] ci: change to runner ubuntu --- .github/workflows/ci.yaml | 2 +- .github/workflows/release-please-main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d720e00..9fb34f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ on: jobs: test-build: - runs-on: ktbs-small-runner + runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/release-please-main.yml b/.github/workflows/release-please-main.yml index 2c2fe53..9a82d11 100644 --- a/.github/workflows/release-please-main.yml +++ b/.github/workflows/release-please-main.yml @@ -6,7 +6,7 @@ on: name: release-please jobs: release-please: - runs-on: ktbs-small-runner + runs-on: ubuntu-latest steps: - uses: google-github-actions/release-please-action@v3 with: From ac0d8b36aac88200ae35fc468d280e32a8b272e0 Mon Sep 17 00:00:00 2001 From: sswastioyono18 Date: Sun, 7 Jul 2024 08:28:45 +0700 Subject: [PATCH 5/8] ci: changed token --- .github/workflows/release-please-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please-main.yml b/.github/workflows/release-please-main.yml index 9a82d11..3fa9169 100644 --- a/.github/workflows/release-please-main.yml +++ b/.github/workflows/release-please-main.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: google-github-actions/release-please-action@v3 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} release-type: go draft-pull-request: "true" labels: "be-autorelease-pending" From 4244ce6ab1b6e2783217c4ae9d4382080c2e4d00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 01:29:17 +0000 Subject: [PATCH 6/8] chore(master): release 1.1.0 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d5aa47..cac15b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.0](https://github.com/kitabisa/otelchi/compare/v1.0.0...v1.1.0) (2024-07-07) + + +### Features + +* renamed to trace-id ([edd5dd9](https://github.com/kitabisa/otelchi/commit/edd5dd97f9db6840811618810e7ded3973be23ed)) + ## [Unreleased] ## [0.8.0] - 2024-04-29 From 1bd601ff81d40e557e8ee3fda1787da67c8f09ba Mon Sep 17 00:00:00 2001 From: Sactio Swastioyono Date: Sun, 7 Jul 2024 09:17:30 +0700 Subject: [PATCH 7/8] Sync master (#6) * feat: add multiple filters in WithFilter option Signed-off-by: Ilham Syahid S * test: adjust WithFilter test for multiple filters Signed-off-by: Ilham Syahid S * docs: add `WithFilter` adjustment on CHANGELOG Signed-off-by: Ilham Syahid S * feat: upgrade to go1.21 and otel 1.26 Signed-off-by: Ilham Syahid S * docs: update comments related to WithFilters to make it easier to understand; * chore: update otel version to v1.28.0; update chi version to v5.1.0; * chore: adjust dep versions in examples; * feat: return 0.9.0 in Version(); * chore: update docker base image for examples to golang:1.21-alpine3.20; * docs: fix grammar in README.md for examples; * chore: upgrade the semconv version in tracer utils to v1.20.0; * chore: update deps in example projects to the latest versions; * chore: update go version in compatibility-test.yaml to 1.21 & 1.22; * docs: update CHANGELOG.md; * chore: make compatibility testing always executed upon push to master; rename ci.yaml to quick-test.yaml to represent better usage; make quick-test.yaml only executed on pull request; * chore: fix run condition for the job; * docs: fix badge in README.md; update grammar in README.md; * docs: update CHANGELOG.md; * feat: added traceID on context * feat: renamed to trace-id * ci: change to runner ubuntu * ci: changed token * chore(master): release 1.1.0 --------- Signed-off-by: Ilham Syahid S Co-authored-by: Ilham Syahid S Co-authored-by: Riandy Rahman Nugraha Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/compatibility-test.yaml | 13 +- .../workflows/{ci.yaml => quick-test.yaml} | 7 +- CHANGELOG.md | 18 ++- Makefile | 2 +- README.md | 8 +- config.go | 19 ++- examples/basic/Dockerfile | 4 +- examples/basic/README.md | 11 +- examples/basic/go.mod | 21 +-- examples/basic/go.sum | 41 +++-- examples/multi-services/README.md | 10 +- examples/multi-services/back-svc/Dockerfile | 4 +- examples/multi-services/front-svc/Dockerfile | 4 +- examples/multi-services/go.mod | 22 +-- examples/multi-services/go.sum | 25 +-- examples/multi-services/utils/tracer.go | 2 +- go.mod | 19 +-- go.sum | 35 +++-- middleware.go | 16 +- test/cases/sdk_test.go | 146 ++++++++++++------ version.go | 2 +- 21 files changed, 260 insertions(+), 169 deletions(-) rename .github/workflows/{ci.yaml => quick-test.yaml} (84%) diff --git a/.github/workflows/compatibility-test.yaml b/.github/workflows/compatibility-test.yaml index 02bddc9..eb033fa 100644 --- a/.github/workflows/compatibility-test.yaml +++ b/.github/workflows/compatibility-test.yaml @@ -1,15 +1,24 @@ name: compatibility-test on: + push: + paths-ignore: + - "**.md" + - LICENCE + - CODEOWNERS + branches: + - master pull_request_review: types: [submitted] jobs: compatibility-test: - if: github.event.review.state == 'APPROVED' + # we trigger the job only when the PR is approved or the job is triggered by other events + # defined in the on section + if: github.event.review.state == 'APPROVED' || github.event_name != 'pull_request_review' strategy: matrix: - go-version: ["1.19", "1.20", "1.21"] + go-version: ["1.21", "1.22"] os: [ubuntu-latest, macos-latest, windows-latest] # GitHub Actions does not support arm* architectures on default # runners. It is possible to acomplish this with a self-hosted runner diff --git a/.github/workflows/ci.yaml b/.github/workflows/quick-test.yaml similarity index 84% rename from .github/workflows/ci.yaml rename to .github/workflows/quick-test.yaml index 9fb34f5..479fc01 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/quick-test.yaml @@ -1,14 +1,11 @@ -name: ci +name: quick-test on: - push: + pull_request: paths-ignore: - "**.md" - LICENCE - CODEOWNERS - branches: - - master - pull_request: jobs: test-build: diff --git a/CHANGELOG.md b/CHANGELOG.md index cac15b1..2fb0bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,19 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +## [0.9.0] - 2024-07-06 + +### Changed + +- `WithFilter` option now support multiple filter functions, just like in [otelmux](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/v1.24.0/instrumentation/github.com/gorilla/mux/otelmux/config.go#L106-L110). ([#47]) +- Upgrade `go.opentelemetry.io/otel`, `go.opentelemetry.io/otel/sdk`, & `go.opentelemetry.io/otel/trace` to `v1.28.0`. ([#49]) +- Upgrade `github.com/go-chi/chi/v5` to `v5.1.0`. ([#49]) +- Set the go versions for testing in both `Makefile` & `compatibility-test.yml` to `1.21` & `1.22`. ([#49]) + +### Removed + +- Drop support for Go `<1.21`. ([#49]) + ## [0.8.0] - 2024-04-29 ### ⚠️ Notice ⚠️ @@ -168,6 +181,8 @@ It contains instrumentation for trace and depends on: - Example code for a basic usage. - Apache-2.0 license. +[#49]: https://github.com/riandyrn/otelchi/pull/49 +[#47]: https://github.com/riandyrn/otelchi/pull/47 [#43]: https://github.com/riandyrn/otelchi/pull/43 [#42]: https://github.com/riandyrn/otelchi/pull/42 [#41]: https://github.com/riandyrn/otelchi/pull/41 @@ -188,7 +203,8 @@ It contains instrumentation for trace and depends on: [#2]: https://github.com/riandyrn/otelchi/pull/2 [#1]: https://github.com/riandyrn/otelchi/pull/1 -[Unreleased]: https://github.com/riandyrn/otelchi/compare/v0.8.0...HEAD +[Unreleased]: https://github.com/riandyrn/otelchi/compare/v0.9.0...HEAD +[0.9.0]: https://github.com/riandyrn/otelchi/releases/tag/v0.9.0 [0.8.0]: https://github.com/riandyrn/otelchi/releases/tag/v0.8.0 [0.7.0]: https://github.com/riandyrn/otelchi/releases/tag/v0.7.0 [0.6.0]: https://github.com/riandyrn/otelchi/releases/tag/v0.6.0 diff --git a/Makefile b/Makefile index ec261df..02625b6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: * -GO_VERSIONS="1.19 1.20 1.21" +GO_VERSIONS="1.21 1.22" # This is the command that will be used to run the tests go-test: diff --git a/README.md b/README.md index ba08bb7..89ab650 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # otelchi -[![ci](https://github.com/riandyrn/otelchi/actions/workflows/ci.yaml/badge.svg)](https://github.com/riandyrn/otelchi/actions/workflows/ci.yaml) +[![compatibility-test](https://github.com/riandyrn/otelchi/actions/workflows/compatibility-test.yaml/badge.svg)](https://github.com/riandyrn/otelchi/actions/workflows/compatibility-test.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/riandyrn/otelchi)](https://goreportcard.com/report/github.com/riandyrn/otelchi) [![Documentation](https://godoc.org/github.com/riandyrn/otelchi?status.svg)](https://pkg.go.dev/mod/github.com/riandyrn/otelchi) OpenTelemetry instrumentation for [go-chi/chi](https://github.com/go-chi/chi). -Essentialy this is adaptation from [otelmux](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/gorilla/mux/otelmux) but instead using `gorilla/mux`, we use `go-chi/chi`. +Essentially this is an adaptation from [otelmux](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/gorilla/mux/otelmux) but instead of using `gorilla/mux`, we use `go-chi/chi`. -Currently it could only instrument traces. +Currently, this library can only instrument traces. Contributions are welcomed! @@ -24,4 +24,4 @@ See [examples](./examples) for details. ## Why Port This? -I was planning to make this project as part of Open Telemetry Go instrumentation project. However based on [this comment](https://github.com/open-telemetry/opentelemetry-go-contrib/pull/986#issuecomment-941280855) they no longer accept new instrumentation. This is why I maintain this project here. \ No newline at end of file +I was planning to make this project as part of the Open Telemetry Go instrumentation project. However, based on [this comment](https://github.com/open-telemetry/opentelemetry-go-contrib/pull/986#issuecomment-941280855) they no longer accept new instrumentation. This is why I maintain this project here. diff --git a/config.go b/config.go index 3529268..1763a28 100644 --- a/config.go +++ b/config.go @@ -16,7 +16,7 @@ type config struct { Propagators propagation.TextMapPropagator ChiRoutes chi.Routes RequestMethodInSpanName bool - Filter func(r *http.Request) bool + Filters []Filter TraceResponseHeaderKey string PublicEndpointFn func(r *http.Request) bool } @@ -32,6 +32,10 @@ func (o optionFunc) apply(c *config) { o(c) } +// Filter is a predicate used to determine whether a given http.request should +// be traced. A Filter must return true if the request should be traced. +type Filter func(*http.Request) bool + // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. @@ -76,12 +80,15 @@ func WithRequestMethodInSpanName(isActive bool) Option { }) } -// WithFilter is used for filtering request that should not be traced. -// This is useful for filtering health check request, etc. -// A Filter must return true if the request should be traced. -func WithFilter(filter func(r *http.Request) bool) Option { +// WithFilter adds a filter to the list of filters used by the handler. +// If any filter indicates to exclude a request then the request will not be +// traced. All filters must allow a request to be traced for a Span to be created. +// If no filters are provided then all requests are traced. +// Filters will be invoked for each processed request, it is advised to make them +// simple and fast. +func WithFilter(filter Filter) Option { return optionFunc(func(cfg *config) { - cfg.Filter = filter + cfg.Filters = append(cfg.Filters, filter) }) } diff --git a/examples/basic/Dockerfile b/examples/basic/Dockerfile index 2de3565..93a3d65 100644 --- a/examples/basic/Dockerfile +++ b/examples/basic/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.18 +FROM golang:1.21-alpine3.20 WORKDIR /go/src/github.com/riandyrn/otelchi COPY . . @@ -7,4 +7,4 @@ WORKDIR /go/src/github.com/riandyrn/otelchi/examples/basic RUN go mod download -x RUN go build -o server -ENTRYPOINT ["./server"] \ No newline at end of file +ENTRYPOINT ["./server"] diff --git a/examples/basic/README.md b/examples/basic/README.md index 33c95d8..9f85e69 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -1,11 +1,8 @@ # go-chi/chi instrumentation example -An HTTP server using go-chi/chi and instrumentation. The server has a -`/users/{id:[0-9]+}` endpoint. The server generates span information to -`stdout`. +An HTTP server using go-chi/chi and instrumentation. The server has a `/users/{id:[0-9]+}` endpoint. The server generates span information to `stdout`. -These instructions expect you have -[docker-compose](https://docs.docker.com/compose/) installed. +These instructions expect you to have [docker-compose](https://docs.docker.com/compose/) installed. Bring up the `mux-server` and `mux-client` services to run the example: @@ -14,8 +11,8 @@ example: docker-compose up --detach mux-server mux-client ``` -The `mux-client` service sends just one HTTP request to `mux-server` -and then exits. View the span generated by `mux-server` in the logs: +The `mux-client` service sends just one HTTP request to the `mux-server` +and then exits. View the span generated by the `mux-server` in the logs: ```sh docker-compose logs mux-server diff --git a/examples/basic/go.mod b/examples/basic/go.mod index fda37a3..6672113 100644 --- a/examples/basic/go.mod +++ b/examples/basic/go.mod @@ -1,22 +1,23 @@ module github.com/riandyrn/otelchi/examples/basic -go 1.19 +go 1.21 replace github.com/riandyrn/otelchi => ../../ require ( - github.com/go-chi/chi/v5 v5.0.12 - github.com/riandyrn/otelchi v0.6.0 - go.opentelemetry.io/otel v1.24.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 - go.opentelemetry.io/otel/sdk v1.24.0 - go.opentelemetry.io/otel/trace v1.24.0 + github.com/go-chi/chi/v5 v5.1.0 + github.com/riandyrn/otelchi v0.9.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 + go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 ) require ( github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - golang.org/x/sys v0.17.0 // indirect + github.com/google/uuid v1.6.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + golang.org/x/sys v0.21.0 // indirect ) diff --git a/examples/basic/go.sum b/examples/basic/go.sum index 4e3af49..c71924e 100644 --- a/examples/basic/go.sum +++ b/examples/basic/go.sum @@ -1,26 +1,33 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= -github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/multi-services/README.md b/examples/multi-services/README.md index 8a79cb0..960779f 100644 --- a/examples/multi-services/README.md +++ b/examples/multi-services/README.md @@ -1,11 +1,11 @@ # Multi Services Example -This is simple example on how instrumenting multiple services. +This is a simple example of how instrumenting multiple services. There are 2 services in this example: -- `front-svc` => the front service receiving request from client -- `back-svc` => the service that being called by `front-svc` (hence named `back`) +- `front-svc` => the front service receiving requests from the client +- `back-svc` => the service that is being called by `front-svc` (hence named `back`) ![Architecture Diagram](architecture.svg) @@ -19,7 +19,7 @@ Make sure to have Docker & Docker Compose installed in your system. After that r > make run ``` -If the command run successfully (it will take a moment), you will see something like this in the terminal: +If the command runs successfully (it will take a moment), you will see something like this in the terminal: ``` back-svc_1 | 2022/07/23 01:49:29 back service is listening on :8091 @@ -30,4 +30,4 @@ multi-services_client_1 exited with code 0 Open your browser and access `http://localhost:16686` to access the Jaeger UI. -You should see some traces available already in the UI. \ No newline at end of file +You should see some traces available already in the UI. diff --git a/examples/multi-services/back-svc/Dockerfile b/examples/multi-services/back-svc/Dockerfile index fe7a961..ed0eb65 100644 --- a/examples/multi-services/back-svc/Dockerfile +++ b/examples/multi-services/back-svc/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.18 +FROM golang:1.21-alpine3.20 WORKDIR /go/src/github.com/riandyrn/otelchi RUN apk --no-cache add curl @@ -10,4 +10,4 @@ RUN go mod download -x WORKDIR /go/src/github.com/riandyrn/otelchi/examples/multi-services/back-svc RUN go build -o server -ENTRYPOINT ["./server"] \ No newline at end of file +ENTRYPOINT ["./server"] diff --git a/examples/multi-services/front-svc/Dockerfile b/examples/multi-services/front-svc/Dockerfile index 5659e32..74b81c2 100644 --- a/examples/multi-services/front-svc/Dockerfile +++ b/examples/multi-services/front-svc/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.18 +FROM golang:1.21-alpine3.20 WORKDIR /go/src/github.com/riandyrn/otelchi RUN apk --no-cache add curl @@ -10,4 +10,4 @@ RUN go mod download -x WORKDIR /go/src/github.com/riandyrn/otelchi/examples/multi-services/front-svc RUN go build -o server -ENTRYPOINT ["./server"] \ No newline at end of file +ENTRYPOINT ["./server"] diff --git a/examples/multi-services/go.mod b/examples/multi-services/go.mod index 862bd14..dffea9a 100644 --- a/examples/multi-services/go.mod +++ b/examples/multi-services/go.mod @@ -1,24 +1,24 @@ module github.com/riandyrn/otelchi/examples/multi-services -go 1.19 +go 1.21 replace github.com/riandyrn/otelchi => ../../ require ( - github.com/go-chi/chi/v5 v5.0.12 - github.com/riandyrn/otelchi v0.8.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 - go.opentelemetry.io/otel v1.24.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 - go.opentelemetry.io/otel/sdk v1.24.0 - go.opentelemetry.io/otel/trace v1.24.0 + github.com/go-chi/chi/v5 v5.1.0 + github.com/riandyrn/otelchi v0.9.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 + go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 ) require ( - github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect diff --git a/examples/multi-services/go.sum b/examples/multi-services/go.sum index 5bfd1c3..3846d56 100644 --- a/examples/multi-services/go.sum +++ b/examples/multi-services/go.sum @@ -1,22 +1,22 @@ -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= -github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= @@ -54,3 +54,4 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/multi-services/utils/tracer.go b/examples/multi-services/utils/tracer.go index 2d66b52..90b9a0c 100644 --- a/examples/multi-services/utils/tracer.go +++ b/examples/multi-services/utils/tracer.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.4.0" + semconv "go.opentelemetry.io/otel/semconv/v1.20.0" "go.opentelemetry.io/otel/trace" ) diff --git a/go.mod b/go.mod index 8f71b41..884f76e 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,23 @@ module github.com/riandyrn/otelchi -go 1.19 +go 1.21 require ( github.com/felixge/httpsnoop v1.0.4 - github.com/go-chi/chi/v5 v5.0.12 - github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/otel v1.24.0 - go.opentelemetry.io/otel/sdk v1.24.0 - go.opentelemetry.io/otel/trace v1.24.0 + github.com/go-chi/chi/v5 v5.1.0 + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - golang.org/x/sys v0.17.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + golang.org/x/sys v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d016e89..ae3f854 100644 --- a/go.sum +++ b/go.sum @@ -2,28 +2,31 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= -github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/middleware.go b/middleware.go index cd3bb71..fa4f0ab 100644 --- a/middleware.go +++ b/middleware.go @@ -47,7 +47,7 @@ func Middleware(serverName string, opts ...Option) func(next http.Handler) http. handler: handler, chiRoutes: cfg.ChiRoutes, reqMethodInSpanName: cfg.RequestMethodInSpanName, - filter: cfg.Filter, + filters: cfg.Filters, traceResponseHeaderKey: cfg.TraceResponseHeaderKey, publicEndpointFn: cfg.PublicEndpointFn, } @@ -61,7 +61,7 @@ type traceware struct { handler http.Handler chiRoutes chi.Routes reqMethodInSpanName bool - filter func(r *http.Request) bool + filters []Filter traceResponseHeaderKey string publicEndpointFn func(r *http.Request) bool } @@ -112,10 +112,14 @@ func putRRW(rrw *recordingResponseWriter) { // ServeHTTP implements the http.Handler interface. It does the actual // tracing of the request. func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // skip if filter returns false - if tw.filter != nil && !tw.filter(r) { - tw.handler.ServeHTTP(w, r) - return + // go through all filters if any + for _, filter := range tw.filters { + // if there is a filter that returns false, we skip tracing + // and execute next handler + if !filter(r) { + tw.handler.ServeHTTP(w, r) + return + } } // extract tracing header using propagator diff --git a/test/cases/sdk_test.go b/test/cases/sdk_test.go index 1e75f55..df9b1ab 100644 --- a/test/cases/sdk_test.go +++ b/test/cases/sdk_test.go @@ -63,59 +63,107 @@ func TestSDKIntegration(t *testing.T) { }) } -func TestSDKIntegrationWithFilters(t *testing.T) { - // prepare router and span recorder - router, sr := newSDKTestRouter("foobar", false, otelchi.WithFilter(func(r *http.Request) bool { - // if client access /live or /ready, there should be no span - if r.URL.Path == "/live" || r.URL.Path == "/ready" { - return false - } - - // otherwise always return the span - return true - })) - - // define router - router.HandleFunc("/user/{id:[0-9]+}", ok) - router.HandleFunc("/book/{title}", ok) - router.HandleFunc("/health", ok) - router.HandleFunc("/ready", ok) - - // execute requests - executeRequests(router, []*http.Request{ - httptest.NewRequest("GET", "/user/123", nil), - httptest.NewRequest("GET", "/book/foo", nil), - httptest.NewRequest("GET", "/live", nil), - httptest.NewRequest("GET", "/ready", nil), - }) - - // get recorded spans and ensure the length is 2 - recordedSpans := sr.Ended() - require.Len(t, recordedSpans, 2) - - // ensure span values - checkSpans(t, recordedSpans, []spanValueCheck{ +func TestSDKIntegrationWithFilter(t *testing.T) { + // prepare test cases + serviceName := "foobar" + testCases := []struct { + Name string + FilterFn []otelchi.Filter + LenSpans int + ExpectedRouteNames []string + }{ { - Name: "/user/{id:[0-9]+}", - Kind: trace.SpanKindServer, - Attributes: getSemanticAttributes( - "foobar", - http.StatusOK, - "GET", - "/user/{id:[0-9]+}", - ), + Name: "One WithFilter", + FilterFn: []otelchi.Filter{ + func(r *http.Request) bool { + return r.URL.Path != "/live" && r.URL.Path != "/ready" + }, + }, + LenSpans: 2, + ExpectedRouteNames: []string{"/user/{id:[0-9]+}", "/book/{title}"}, }, { - Name: "/book/{title}", - Kind: trace.SpanKindServer, - Attributes: getSemanticAttributes( - "foobar", - http.StatusOK, - "GET", - "/book/{title}", - ), + Name: "Multiple WithFilter", + FilterFn: []otelchi.Filter{ + func(r *http.Request) bool { + return r.URL.Path != "/ready" + }, + func(r *http.Request) bool { + return r.URL.Path != "/live" + }, + }, + LenSpans: 2, + ExpectedRouteNames: []string{"/user/{id:[0-9]+}", "/book/{title}"}, }, - }) + { + Name: "All Routes are traced", + FilterFn: []otelchi.Filter{ + func(r *http.Request) bool { + return true + }, + }, + LenSpans: 4, + ExpectedRouteNames: []string{"/user/{id:[0-9]+}", "/book/{title}", "/live", "/ready"}, + }, + { + Name: "All Routes are not traced", + FilterFn: []otelchi.Filter{ + func(r *http.Request) bool { + return false + }, + }, + LenSpans: 0, + ExpectedRouteNames: []string{}, + }, + } + + // execute test cases + for _, testCase := range testCases { + t.Run(testCase.Name, func(t *testing.T) { + // prepare router and span recorder + filters := []otelchi.Option{} + for _, filter := range testCase.FilterFn { + filters = append(filters, otelchi.WithFilter(filter)) + } + router, sr := newSDKTestRouter(serviceName, false, filters...) + + // define router + router.HandleFunc("/user/{id:[0-9]+}", ok) + router.HandleFunc("/book/{title}", ok) + router.HandleFunc("/health", ok) + router.HandleFunc("/live", ok) + router.HandleFunc("/ready", ok) + + // execute requests + executeRequests(router, []*http.Request{ + httptest.NewRequest("GET", "/user/123", nil), + httptest.NewRequest("GET", "/book/foo", nil), + httptest.NewRequest("GET", "/live", nil), + httptest.NewRequest("GET", "/ready", nil), + }) + + // check recorded spans + recordedSpans := sr.Ended() + require.Len(t, recordedSpans, testCase.LenSpans) + + // ensure span values + spanValues := []spanValueCheck{} + for _, routeName := range testCase.ExpectedRouteNames { + spanValues = append(spanValues, spanValueCheck{ + Name: routeName, + Kind: trace.SpanKindServer, + Attributes: getSemanticAttributes( + serviceName, + http.StatusOK, + "GET", + routeName, + ), + }) + } + checkSpans(t, recordedSpans, spanValues) + }) + } + } func TestSDKIntegrationWithChiRoutes(t *testing.T) { diff --git a/version.go b/version.go index 8d6a5e2..c6761f2 100644 --- a/version.go +++ b/version.go @@ -2,5 +2,5 @@ package otelchi // Version is the current release version of otelchi in use. func Version() string { - return "0.8.0" + return "0.9.0" } From 80e8b5097ad0212dcca0575a961ac3ad8247ac5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 02:18:34 +0000 Subject: [PATCH 8/8] chore(deps): bump google.golang.org/protobuf in /examples/multi-services Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] --- examples/multi-services/go.mod | 26 ++++++------ examples/multi-services/go.sum | 72 +++++++++++++++++----------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/examples/multi-services/go.mod b/examples/multi-services/go.mod index dffea9a..ff307f2 100644 --- a/examples/multi-services/go.mod +++ b/examples/multi-services/go.mod @@ -9,8 +9,8 @@ require ( github.com/riandyrn/otelchi v0.9.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 go.opentelemetry.io/otel/sdk v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 ) @@ -20,15 +20,15 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/proto/otlp v1.1.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/grpc v1.61.1 // indirect - google.golang.org/protobuf v1.32.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/examples/multi-services/go.sum b/examples/multi-services/go.sum index 3846d56..86d1e66 100644 --- a/examples/multi-services/go.sum +++ b/examples/multi-services/go.sum @@ -15,43 +15,41 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= -google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= -google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 h1:1wp/gyxsuYtuE/JFxsQRtcCDtMrO2qMvlfXALU5wkzI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0/go.mod h1:gbTHmghkGgqxMomVQQMur1Nba4M0MQ8AYThXDUjsJ38= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=