Skip to content

Commit 413570a

Browse files
committed
feat: Improved instrumentation
Sentry error reporter is now automatically synced with OTEL generated spans and events.
1 parent 48d3449 commit 413570a

File tree

7 files changed

+287
-162
lines changed

7 files changed

+287
-162
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ jobs:
2020
name: scan for vulnerabilities
2121
runs-on: ubuntu-latest
2222
steps:
23-
# Go
24-
- name: Set up Go
25-
uses: actions/setup-go@v4
26-
with:
27-
go-version: 1.20.x
28-
2923
# Checkout code
3024
- name: Checkout repository
3125
uses: actions/checkout@v3
@@ -37,6 +31,12 @@ jobs:
3731
GITHUB_USER: ${{ github.actor }}
3832
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
3933

34+
# Go
35+
- name: Set up Go
36+
uses: actions/setup-go@v4
37+
with:
38+
go-version: 1.20.x
39+
4040
# Get commit message
4141
- name: Get commit message
4242
run: |
@@ -78,12 +78,6 @@ jobs:
7878
runs-on: ${{ matrix.os }}
7979
timeout-minutes: 15
8080
steps:
81-
# Go
82-
- name: Set up Go
83-
uses: actions/setup-go@v4
84-
with:
85-
go-version: ${{ matrix.go-version }}
86-
8781
# Checkout code
8882
- name: Checkout repository
8983
uses: actions/checkout@v3
@@ -95,25 +89,19 @@ jobs:
9589
GITHUB_USER: ${{ github.actor }}
9690
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
9791

92+
# Go
93+
- name: Set up Go
94+
uses: actions/setup-go@v4
95+
with:
96+
go-version: ${{ matrix.go-version }}
97+
9898
# Get commit message
9999
- name: Get commit message
100100
run: |
101101
echo 'commit_msg<<EOF' >> $GITHUB_ENV
102102
git log --format=%B -n 1 ${{ github.sha }} >> $GITHUB_ENV
103103
echo 'EOF' >> $GITHUB_ENV
104104
105-
# If "vendor" is in cache, restore.
106-
# To run conditional steps use:
107-
# if: steps.vendor-cache.outputs.cache-hit != 'true'
108-
- name: Restore modules from cache
109-
id: vendor-cache
110-
uses: actions/cache@v3
111-
env:
112-
cache-name: vendor
113-
with:
114-
path: ./vendor
115-
key: ${{ env.cache-name }}-${{ hashFiles('go.sum') }}
116-
117105
# Style consistency and static analysis using 'golangci-lint'
118106
# https://github.com/marketplace/actions/run-golangci-lint
119107
- name: Static analysis
@@ -136,7 +124,3 @@ jobs:
136124
name: assets
137125
path: |
138126
coverage.html
139-
140-
# Populate vendor cache to speed up future runs
141-
- name: Populate vendor cache
142-
run: go mod vendor

.golangci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ linters:
2323
- ineffassign
2424
- staticcheck
2525
- typecheck
26-
- unused
2726
- gocyclo
2827
- goconst
2928
- depguard
@@ -46,14 +45,15 @@ linters:
4645
- predeclared
4746
- exportloopref
4847
- whitespace
48+
- nestif
49+
- funlen
4950
# Deprecated linters
50-
#- wrapcheck
51-
#- nestif
52-
#- funlen
53-
#- ifshort
54-
#- varcheck
51+
# - wrapcheck
52+
# - ifshort
53+
# - varcheck
5554
disable:
5655
- deadcode
56+
- unused
5757
- dupl
5858
# https://github.com/golangci/golangci-lint/issues/2649
5959
- structcheck
@@ -103,10 +103,6 @@ linters-settings:
103103
goconst:
104104
min-len: 3
105105
min-occurrences: 5
106-
depguard:
107-
list-type: blacklist
108-
include-go-root: false
109-
packages: []
110106
misspell:
111107
locale: US
112108
ignore-words: []

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ test:
114114
## updates: List available updates for direct dependencies
115115
# https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies
116116
updates:
117-
@GOWORK=off go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}} [{{.Version}} -> {{.Update.Version}}]{{end}}' -m all 2> /dev/null
117+
@GOWORK=off go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: [{{.Version}} -> {{.Update.Version}}]{{end}}' -mod=mod -m all 2> /dev/null

go.mod

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.18
44

55
require (
66
github.com/spf13/cobra v1.7.0
7-
github.com/spf13/viper v1.15.0
8-
go.bryk.io/pkg v0.0.0-20230517170105-89a1e74b9a96
7+
github.com/spf13/viper v1.16.0
8+
go.bryk.io/pkg v0.0.0-20230711012017-8e69ce8ebd62
99
)
1010

1111
require (
@@ -16,7 +16,8 @@ require (
1616
github.com/fatih/color v1.13.0 // indirect
1717
github.com/felixge/httpsnoop v1.0.3 // indirect
1818
github.com/fsnotify/fsnotify v1.6.0 // indirect
19-
github.com/getsentry/sentry-go v0.21.0 // indirect
19+
github.com/getsentry/sentry-go v0.22.0 // indirect
20+
github.com/getsentry/sentry-go/otel v0.22.0 // indirect
2021
github.com/go-logr/logr v1.2.4 // indirect
2122
github.com/go-logr/stdr v1.2.2 // indirect
2223
github.com/go-ole/go-ole v1.2.6 // indirect
@@ -25,7 +26,7 @@ require (
2526
github.com/gorilla/websocket v1.5.0 // indirect
2627
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
2728
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
28-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
29+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
2930
github.com/hashicorp/hcl v1.0.0 // indirect
3031
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3132
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
@@ -34,53 +35,54 @@ require (
3435
github.com/mattn/go-isatty v0.0.17 // indirect
3536
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
3637
github.com/mitchellh/mapstructure v1.5.0 // indirect
37-
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
38+
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
3839
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
39-
github.com/prometheus/client_golang v1.15.1 // indirect
40+
github.com/prometheus/client_golang v1.16.0 // indirect
4041
github.com/prometheus/client_model v0.4.0 // indirect
4142
github.com/prometheus/common v0.42.0 // indirect
42-
github.com/prometheus/procfs v0.9.0 // indirect
43+
github.com/prometheus/procfs v0.10.1 // indirect
4344
github.com/rs/zerolog v1.29.1 // indirect
44-
github.com/shirou/gopsutil/v3 v3.23.3 // indirect
45-
github.com/shoenig/go-m1cpu v0.1.4 // indirect
46-
github.com/sirupsen/logrus v1.9.1 // indirect
45+
github.com/shirou/gopsutil/v3 v3.23.4 // indirect
46+
github.com/shoenig/go-m1cpu v0.1.5 // indirect
47+
github.com/sirupsen/logrus v1.9.3 // indirect
4748
github.com/soheilhy/cmux v0.1.5 // indirect
48-
github.com/spf13/afero v1.9.3 // indirect
49-
github.com/spf13/cast v1.5.0 // indirect
49+
github.com/spf13/afero v1.9.5 // indirect
50+
github.com/spf13/cast v1.5.1 // indirect
5051
github.com/spf13/jwalterweatherman v1.1.0 // indirect
5152
github.com/spf13/pflag v1.0.5 // indirect
5253
github.com/subosito/gotenv v1.4.2 // indirect
5354
github.com/tklauser/go-sysconf v0.3.11 // indirect
5455
github.com/tklauser/numcpus v0.6.0 // indirect
5556
github.com/yusufpapurcu/wmi v1.2.2 // indirect
56-
go.opentelemetry.io/contrib/instrumentation/host v0.41.1 // indirect
57-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.41.1 // indirect
58-
go.opentelemetry.io/contrib/instrumentation/runtime v0.41.1 // indirect
59-
go.opentelemetry.io/otel v1.15.1 // indirect
60-
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect
61-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.38.1 // indirect
62-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.38.1 // indirect
63-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect
64-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 // indirect
65-
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.38.1 // indirect
66-
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 // indirect
67-
go.opentelemetry.io/otel/metric v0.38.1 // indirect
68-
go.opentelemetry.io/otel/sdk v1.15.1 // indirect
69-
go.opentelemetry.io/otel/sdk/metric v0.38.1 // indirect
70-
go.opentelemetry.io/otel/trace v1.15.1 // indirect
57+
go.opentelemetry.io/contrib/instrumentation/host v0.42.0 // indirect
58+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 // indirect
59+
go.opentelemetry.io/contrib/instrumentation/runtime v0.42.0 // indirect
60+
go.opentelemetry.io/otel v1.16.0 // indirect
61+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
62+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.39.0 // indirect
63+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.39.0 // indirect
64+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect
65+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 // indirect
66+
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.39.0 // indirect
67+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 // indirect
68+
go.opentelemetry.io/otel/metric v1.16.0 // indirect
69+
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
70+
go.opentelemetry.io/otel/sdk/metric v0.39.0 // indirect
71+
go.opentelemetry.io/otel/trace v1.16.0 // indirect
7172
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
7273
go.uber.org/atomic v1.9.0 // indirect
7374
go.uber.org/multierr v1.8.0 // indirect
7475
go.uber.org/zap v1.24.0 // indirect
75-
golang.org/x/net v0.10.0 // indirect
76-
golang.org/x/sync v0.2.0 // indirect
77-
golang.org/x/sys v0.8.0 // indirect
78-
golang.org/x/term v0.8.0 // indirect
79-
golang.org/x/text v0.9.0 // indirect
76+
golang.org/x/net v0.12.0 // indirect
77+
golang.org/x/sync v0.3.0 // indirect
78+
golang.org/x/sys v0.10.0 // indirect
79+
golang.org/x/term v0.10.0 // indirect
80+
golang.org/x/text v0.11.0 // indirect
8081
golang.org/x/time v0.3.0 // indirect
81-
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
82-
google.golang.org/grpc v1.55.0 // indirect
83-
google.golang.org/protobuf v1.30.0 // indirect
82+
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
83+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
84+
google.golang.org/grpc v1.56.2 // indirect
85+
google.golang.org/protobuf v1.31.0 // indirect
8486
gopkg.in/ini.v1 v1.67.0 // indirect
8587
gopkg.in/yaml.v3 v3.0.1 // indirect
8688
)

0 commit comments

Comments
 (0)