Skip to content

Commit a5fea97

Browse files
authored
Merge pull request #188 from google/gorrila/mux/core
RequestTags interface
2 parents 2d8b5c6 + 89145a8 commit a5fea97

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

go/core/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ Users are given control over what tags they want to append by using `core.Commen
1717
```go
1818
type CommenterOptions struct {
1919
EnableDBDriver bool
20-
EnableTraceparent bool // OpenTelemetry trace information
21-
EnableRoute bool // applicable for web frameworks
22-
EnableFramework bool // applicable for web frameworks
23-
EnableController bool // applicable for web frameworks
24-
EnableAction bool // applicable for web frameworks
25-
}
20+
EnableTraceparent bool // OpenTelemetry trace information
21+
EnableRoute bool // applicable for web frameworks
22+
EnableFramework bool // applicable for web frameworks
23+
EnableController bool // applicable for web frameworks
24+
EnableAction bool // applicable for web frameworks
25+
EnableApplication bool
26+
Application string // user-provided application-name. optional
27+
}
2628
```
2729

2830

go/core/core.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ func ExtractTraceparent(ctx context.Context) propagation.MapCarrier {
8888
return carrier
8989
}
9090

91-
type RequestExtractor interface {
91+
type RequestTagsProvider interface {
9292
Route() string
9393
Action() string
9494
Framework() string
9595
}
9696

97-
func ContextInject(ctx context.Context, h RequestExtractor) context.Context {
97+
func ContextInject(ctx context.Context, h RequestTagsProvider) context.Context {
9898
ctx = context.WithValue(ctx, Route, h.Route())
9999
ctx = context.WithValue(ctx, Action, h.Action())
100100
ctx = context.WithValue(ctx, Framework, h.Framework())

go/core/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module github.com/google/sqlcommenter/go/core
22

33
go 1.19
44

5-
require go.opentelemetry.io/otel v1.10.0
5+
require go.opentelemetry.io/otel v1.11.1
66

7-
require go.opentelemetry.io/otel/trace v1.10.0 // indirect
7+
require go.opentelemetry.io/otel/trace v1.11.1 // indirect

go/core/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
66
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
77
go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
88
go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
9+
go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4=
10+
go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE=
911
go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
1012
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
13+
go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ=
14+
go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk=
1115
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=

0 commit comments

Comments
 (0)