Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

feat: add gorm plugin #37

Merged
merged 3 commits into from
Nov 20, 2021
Merged

Conversation

kehuili
Copy link
Contributor

@kehuili kehuili commented Nov 18, 2021

Resolves #36

@wu-sheng wu-sheng requested review from arugal and kezhenxu94 and removed request for kezhenxu94 November 18, 2021 12:44
@wu-sheng wu-sheng added this to the 1.3.0 milestone Nov 18, 2021
@wu-sheng wu-sheng added the enhancement New feature or request label Nov 18, 2021
Co-authored-by: zhang-wei <zhangwei24@apache.org>
@wu-sheng wu-sheng requested a review from arugal November 18, 2021 13:27
@@ -0,0 +1,40 @@
# Go2Sky with Gorm
Copy link
Member

Choose a reason for hiding this comment

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

I think this doc should be linked from https://github.com/SkyAPM/go2sky-plugins#trace-plugins

gorm/gorm.go Outdated

span.SetComponent(s.getComponent())
span.SetSpanLayer(agentv3.SpanLayer_Database)
span.Tag(go2sky.TagDBType, string(s.sqlType))
Copy link
Member

Choose a reason for hiding this comment

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

I think the tag key should look like this, and please help update go2sky :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean to change this tag TagDBBindVariables in go2sky into tagDbSqlParameters = "db.sql.parameters"?

Copy link
Member

Choose a reason for hiding this comment

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

yes

gorm/gorm.go Outdated
span.Tag(go2sky.TagDBType, string(s.sqlType))
span.Tag(go2sky.TagDBStatement, sql)

if len(vars) != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Add reportParam and reportQuery options like this, let the user choose. WDYT?

@wu-sheng
Copy link
Member

Should this be closed?

@kehuili
Copy link
Contributor Author

kehuili commented Nov 20, 2021

Should this be closed?

Can you reopen it, or should I raise another PR?

@wu-sheng wu-sheng reopened this Nov 20, 2021
@wu-sheng
Copy link
Member

I opened this.

Copy link
Member

@arugal arugal left a comment

Choose a reason for hiding this comment

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

LGTM

@wu-sheng wu-sheng merged commit 6cb1799 into SkyAPM:master Nov 20, 2021
@wu-sheng
Copy link
Member

@arugal Let's release 1.3.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature - GORM v2 plugin implementation
3 participants