Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/gorm.io/gorm.v1/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (fn OptionFn) apply(cfg *config) {

func newConfigWithDefaults() *config {
cfg := new(config)
cfg.serviceName = "gorm.db"
cfg.serviceName = instr.ServiceName(instrumentation.ComponentDefault, nil)
cfg.serviceSource = string(instrumentation.PackageGormIOGormV1)
cfg.analyticsRate = instr.AnalyticsRate(false)
cfg.errCheck = func(error) bool { return true }
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,12 @@ var packages = map[Package]PackageInfo{
},
PackageGormIOGormV1: {
TracedPackage: "gorm.io/gorm",
naming: map[Component]componentNames{
ComponentDefault: {
useDDServiceV0: false,
buildServiceNameV0: staticName("gorm.db"),
},
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Could we add a test that reproduces the original bug to prevent regressions?

There is a specific test suite for the service names and these configurations in instrumentation/internal/namingschematest. You can add a new testcase in gorm_test.go and add it to the test suite in main_test.go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just saw this. Glad we're able to get a fix in place.

},
PackageGorillaMux: {
TracedPackage: "github.com/gorilla/mux",
Expand Down