Skip to content

feat: gomysql instrumentation support - #685

Open
josealdaco wants to merge 6 commits into
alibaba:mainfrom
josealdaco:feat_gomysqlinstrumentation
Open

feat: gomysql instrumentation support #685
josealdaco wants to merge 6 commits into
alibaba:mainfrom
josealdaco:feat_gomysqlinstrumentation

Conversation

@josealdaco

Copy link
Copy Markdown
Contributor

This pull request adds support for instrumenting the go-mysql library with OpenTelemetry in the Loongsuite Go agent. It introduces a new instrumentation module for go-mysql, updates the semantic conventions and registry, and adds comprehensive tests for the new functionality. Additionally, it improves the extraction of database connection attributes and updates documentation to reflect the new support.

Go-MySQL Instrumentation Support

  • Added a new instrumentation module for go-mysql (pkg/rules/go-mysql), including the main instrumenter logic (gomysql_otel_instrumenter.go) and runtime hooks (setup.go), enabling automatic tracing of MySQL client operations. [1] [2]
  • Introduced a new Go module for the go-mysql instrumentation with required dependencies in pkg/rules/go-mysql/go.mod.
  • Registered the new instrumentation in the agent's registry and defined its scope constant. [1] [2]

Database Attribute Extraction Enhancements

  • Extended the semantic conventions to extract and record the database connection ID as an attribute (db.connectionId) for SQL clients, improving traceability of database connections. [1] [2]

Testing and Verification

  • Added integration tests for go-mysql in test/go_mysql_tests.go and accompanying test application code in test/gomysql/test_conn.go, ensuring the new instrumentation works as expected. [1] [2]
  • Created a dedicated Go module for the test application in test/gomysql/go.mod.

Documentation Updates

  • Updated the README.md to add go-mysql to the list of supported libraries and made minor formatting corrections. [1] [2] [3]

@NameHaibinZhang

Copy link
Copy Markdown
Collaborator

@claude rebase main

@NameHaibinZhang

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants