Skip to content

Commit

Permalink
Merge pull request #202 from mailgun/dependabot/go_modules/go.opentel…
Browse files Browse the repository at this point in the history
…emetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc-0.46.0

Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.45.0 to 0.46.0
  • Loading branch information
thrawn01 authored Nov 29, 2023
2 parents e43e3df + 3fd1b79 commit 885519d
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 128 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
push:
branches: [ master ]
pull_request:

env:
GOLANGCI_LINT_VERSION: v1.54.2

jobs:
lint:
name: lint
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
cache: true # caching and restoring go modules and build outputs

- name: Check that 'go mod tidy' was called before commit
run: go mod tidy && git diff --exit-code

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
skip-cache: true # cache/restore is done by actions/setup-go@v3 step
args: -v
10 changes: 4 additions & 6 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: On Pull Request

on:
pull_request:
branches: [ master, main ]
branches: [ master ]

jobs:
test:
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Fetch git tags
run: git fetch --tags
Expand All @@ -25,14 +25,12 @@ jobs:
run: ./contrib/check-version.sh

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- run: go env

- name: Cache deps
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: On Release Workflow

on:
release:
types: [published]
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Fetch git tags
run: git fetch --tags
Expand All @@ -19,14 +19,14 @@ jobs:

# Buildx Needs QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

# We use Buildx so we can take advantage of the caching
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
2 changes: 1 addition & 1 deletion benchmark_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/mailgun/gubernator/v2"
gubernator "github.com/mailgun/gubernator/v2"
"github.com/mailgun/holster/v4/clock"
)

Expand Down
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ func DialV1Server(server string, tls *tls.Config) (V1Client, error) {

// Setup OpenTelemetry interceptor to propagate spans.
opts := []grpc.DialOption{
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
}
if tls != nil {
opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(tls)))
Expand Down
2 changes: 1 addition & 1 deletion cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cluster_test
import (
"testing"

"github.com/mailgun/gubernator/v2"
gubernator "github.com/mailgun/gubernator/v2"
"github.com/mailgun/gubernator/v2/cluster"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion cmd/gubernator-cluster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"os/signal"

"github.com/mailgun/gubernator/v2"
gubernator "github.com/mailgun/gubernator/v2"
"github.com/mailgun/gubernator/v2/cluster"
"github.com/sirupsen/logrus"
)
Expand Down
6 changes: 6 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ func GetTracingLevel() tracing.Level {
return tracing.InfoLevel
}

// TraceLevelInfoFilter is used with otelgrpc.WithInterceptorFilter() to
// reduce noise by filtering trace propagation on some gRPC methods.
// otelgrpc deprecated use of interceptors in v0.45.0 in favor of stats
// handlers to propagate trace context.
// However, stats handlers do not have a filter feature.
// See: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4575
var TraceLevelInfoFilter = otelgrpc.Filter(func(info *otelgrpc.InterceptorInfo) bool {
if info.UnaryServerInfo != nil {
if info.UnaryServerInfo.FullMethod == "/pb.gubernator.PeersV1/GetPeerRateLimits" {
Expand Down
16 changes: 10 additions & 6 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,22 @@ func (s *Daemon) Start(ctx context.Context) error {
_ = s.promRegister.Register(s.statsHandler)

var filters []otelgrpc.Option
if s.conf.TraceLevel != tracing.DebugLevel {
filters = []otelgrpc.Option{
otelgrpc.WithInterceptorFilter(TraceLevelInfoFilter),
}
}
// otelgrpc deprecated use of interceptors in v0.45.0 in favor of stats
// handlers to propagate trace context.
// However, stats handlers do not have a filter feature.
// See: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4575
// if s.conf.TraceLevel != tracing.DebugLevel {
// filters = []otelgrpc.Option{
// otelgrpc.WithInterceptorFilter(TraceLevelInfoFilter),
// }
// }

opts := []grpc.ServerOption{
grpc.StatsHandler(s.statsHandler),
grpc.MaxRecvMsgSize(1024 * 1024),

// OpenTelemetry instrumentation on gRPC endpoints.
grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor(filters...)),
grpc.StatsHandler(otelgrpc.NewServerHandler(filters...)),
}

if s.conf.GRPCMaxConnectionAgeSeconds > 0 {
Expand Down
46 changes: 18 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
github.com/hashicorp/memberlist v0.5.0
github.com/mailgun/errors v0.1.5
github.com/mailgun/holster/v4 v4.16.0
github.com/mailgun/holster/v4 v4.16.2-0.20231121154636-69040cb71a3b
github.com/miekg/dns v1.1.50
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.13.0
Expand All @@ -18,15 +18,14 @@ require (
github.com/sirupsen/logrus v1.9.2
github.com/stretchr/testify v1.8.4
go.etcd.io/etcd/client/v3 v3.5.5
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
golang.org/x/net v0.17.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
golang.org/x/net v0.18.0
golang.org/x/time v0.3.0
google.golang.org/api v0.126.0
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b
google.golang.org/grpc v1.58.3
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
k8s.io/api v0.23.3
k8s.io/apimachinery v0.23.3
Expand All @@ -35,27 +34,20 @@ require (
)

require (
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/armon/go-metrics v0.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
Expand All @@ -77,23 +69,21 @@ require (
github.com/uptrace/opentelemetry-go-extra/otelutil v0.2.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/term v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
Expand Down
Loading

0 comments on commit 885519d

Please sign in to comment.