Skip to content

Commit

Permalink
Merge branch 'main' into check-go-version
Browse files Browse the repository at this point in the history
  • Loading branch information
perhapsmaple authored Aug 14, 2023
2 parents 82ff9ed + eb31736 commit 8824400
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-all-in-one-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -28,7 +28,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
name: build binaries for ${{ matrix.platform.name }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -46,7 +46,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
name: ${{ matrix.version.distribution }} ${{ matrix.version.major }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -29,7 +29,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -29,7 +29,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: ${{ matrix.version.distribution }} ${{ matrix.version.major }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -41,7 +41,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-grpc-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -28,7 +28,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: ${{ matrix.version.distribution }} ${{ matrix.version.major }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -38,7 +38,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-protogen-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -29,7 +29,7 @@ jobs:
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-unit-tests-go-tip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.x

Expand Down
4 changes: 2 additions & 2 deletions docker-compose/monitor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ certifi==2023.7.22
charset-normalizer==3.2.0
Deprecated==1.2.14
googleapis-common-protos==1.60.0
grpcio==1.56.2
grpcio==1.57.0
idna==3.4
opentelemetry-api==1.19.0
opentelemetry-exporter-otlp==1.19.0
Expand All @@ -12,7 +12,7 @@ opentelemetry-exporter-otlp-proto-http==1.19.0
opentelemetry-proto==1.19.0
opentelemetry-sdk==1.19.0
opentelemetry-semantic-conventions==0.40b0
protobuf==4.23.4
protobuf==4.24.0
requests==2.31.0
six==1.16.0
thrift==0.16.0
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-plugin v1.4.10
github.com/kr/pretty v0.3.1
github.com/olivere/elastic v6.2.37+incompatible
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.82.0
github.com/opentracing/opentracing-go v1.2.0
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_model v0.4.0
github.com/prometheus/common v0.44.0
Expand All @@ -59,7 +57,6 @@ require (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.1-0.20230612162650-64be7e574a17
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0
go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel/bridge/opentracing v1.16.0
go.opentelemetry.io/otel/exporters/jaeger v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0
Expand Down Expand Up @@ -140,6 +137,7 @@ require (
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/onsi/gomega v1.13.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.82.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ=
Expand Down Expand Up @@ -770,8 +768,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 h1:pginetY
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8=
go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s=
go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4=
go.opentelemetry.io/otel/bridge/opentracing v1.16.0 h1:Bgwi7P5NCV3bv2T13bwG0WfsxaT4SjQ1rDdmFc5P7do=
go.opentelemetry.io/otel/bridge/opentracing v1.16.0/go.mod h1:X2Y6v3RnoiBGtVFd4KoHy/ftHiCJKJXzlv6W2gPsN1Q=
go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA=
go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 h1:t4ZwRPU+emrcvM2e9DHd0Fsf0JTPVcbfa/BhTDF03d0=
Expand Down
18 changes: 8 additions & 10 deletions pkg/jtracer/jtracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import (
"fmt"
"sync"

"github.com/opentracing/opentracing-go"
"go.opentelemetry.io/otel"
otbridge "go.opentelemetry.io/otel/bridge/opentracing"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
Expand All @@ -32,7 +30,6 @@ import (
)

type JTracer struct {
OT opentracing.Tracer
OTEL trace.TracerProvider
closer func(ctx context.Context) error
}
Expand All @@ -45,23 +42,24 @@ func New(serviceName string) (*JTracer, error) {
if err != nil {
return nil, err
}
// Use the bridgeTracer as your OpenTracing tracer(otTrace).
otelTracer := tracerProvider.Tracer("github.com/jaegertracing/jaeger/pkg/jtracer")
otTracer, wrappedTracerProvider := otbridge.NewTracerPair(otelTracer)

closer := func(ctx context.Context) error {
return tracerProvider.Shutdown(ctx)
}

return &JTracer{
OT: otTracer,
OTEL: wrappedTracerProvider,
OTEL: tracerProvider,
closer: closer,
}, nil
}

func NoOp() *JTracer {
return &JTracer{OT: opentracing.NoopTracer{}, OTEL: trace.NewNoopTracerProvider(), closer: nil}
return &JTracer{
OTEL: trace.NewNoopTracerProvider(),
closer: func(ctx context.Context) error {
return nil
},
}
}

// initOTEL initializes OTEL Tracer
Expand Down Expand Up @@ -99,7 +97,7 @@ func otelExporter(ctx context.Context) (sdktrace.SpanExporter, error) {
)
traceExporter, err := otlptrace.New(ctx, client)
if err != nil {
return nil, fmt.Errorf("Failed to create trace exporter: %w", err)
return nil, fmt.Errorf("failed to create trace exporter: %w", err)
}

return traceExporter, nil
Expand Down

0 comments on commit 8824400

Please sign in to comment.