dd-trace-go
dd-trace-go copied to clipboard
grpc: do not use deprecated APIs in example code
What does this PR do?
- Stop using deprecated APIs such as grpc.Dial() and grpc.WithInsecure().
- Use grpc.NewClient() and insecure.NewCredentials() instead.
Motivation
Don't use deprecated APIs.
Reviewer's Checklist
- [ ] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
- [ ] There is a benchmark for any new code, or changes to existing code.
- [ ] If this interacts with the agent in a new way, a system test has been added.
- [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
Unsure? Have a question? Request a review!
Benchmarks
Benchmark execution time: 2024-09-11 08:15:52
Comparing candidate commit e2b37fe9b5039d3580e7b25b39b185aaefb562bd in PR branch keisku/update-grpc-example with baseline commit 0ffa615b3b98a87e5d82d9ab45365b03e74dce9c in branch main.
Found 2 performance improvements and 2 performance regressions! Performance is the same for 54 metrics, 1 unstable metrics.
scenario:BenchmarkInjectW3C-24
- 🟥
execution_time[+158.881ns; +191.719ns] or [+3.953%; +4.770%]
scenario:BenchmarkSetTagMetric-24
- 🟩
execution_time[-5.353ns; -2.567ns] or [-4.339%; -2.081%]
scenario:BenchmarkSetTagString-24
- 🟩
execution_time[-6.055ns; -3.325ns] or [-5.097%; -2.799%]
scenario:BenchmarkStartRequestSpan-24
- 🟥
execution_time[+8.415ns; +10.585ns] or [+2.820%; +3.547%]
go get google.golang.org/[email protected]
go: upgraded cloud.google.com/go/compute/metadata v0.2.3 => v0.3.0
go: upgraded github.com/cespare/xxhash/v2 v2.2.0 => v2.3.0
go: upgraded github.com/google/uuid v1.5.0 => v1.6.0
go: upgraded golang.org/x/crypto v0.21.0 => v0.24.0
go: upgraded golang.org/x/mod v0.14.0 => v0.17.0
go: upgraded golang.org/x/net v0.23.0 => v0.26.0
go: upgraded golang.org/x/oauth2 v0.9.0 => v0.21.0
go: upgraded golang.org/x/sync v0.5.0 => v0.7.0
go: upgraded golang.org/x/sys v0.20.0 => v0.21.0
go: upgraded golang.org/x/term v0.18.0 => v0.21.0
go: upgraded golang.org/x/text v0.14.0 => v0.16.0
go: upgraded golang.org/x/tools v0.16.1 => v0.21.1-0.20240508182429-e35e4ccd0d2d
go: upgraded google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc => v0.0.0-20240604185151-ef581f913117
go: upgraded google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc => v0.0.0-20240604185151-ef581f913117
go: upgraded google.golang.org/grpc v1.57.1 => v1.66.1
go: upgraded google.golang.org/protobuf v1.33.0 => v1.34.1