SkyAPM / go2sky

Distributed tracing and monitor SDK in Go for Apache SkyWalking APM
https://skywalking.apache.org/
Apache License 2.0
448 stars 123 forks source link

Support database query tracing using ocsql library #78

Closed Saicasm closed 2 years ago

Saicasm commented 3 years ago

Is your feature request related to a problem? Please describe. Currently go2sky doesn't automatically trace the database queries and its execution

Describe the solution you'd like A wrapper which automatically traces the database query execution and produces the trace and links it to the parent span which can be a Http method/ any other

Additional context ocsql warpper which provides tracing for tracing applications like zipkin and since skywalking uses different data format some code changes to the library will be required

arugal commented 3 years ago

Looks good, @Saicasm Do you plan to contribute this plugin?

Saicasm commented 3 years ago

Looks good, @Saicasm Do you plan to contribute this plugin?

@arugal definitely would be contributing, are there any links or any examples in other languages for reference? .If I can have some context that would be great, Thank you

arugal commented 3 years ago

are there any links or any examples in other languages for reference?

About of database, as this comment says, you can also refer to our other plugin implementation, such as go-restful.

Saicasm commented 3 years ago

Hi @arugal , is there a reference where i can find the component ID for go plugins ? Currently need the componentID for mysql ,sqlLite ,postgres.

Thank you

arugal commented 3 years ago

Hi @arugal , is there a reference where i can find the component ID for go plugins ? Currently need the componentID for mysql ,sqlLite ,postgres.

Thank you

It need to be defined in component-library.yml, refer to PyMysql.

https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/component-libraries.yml#L47 https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/component-libraries.yml#L464 https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/component-libraries.yml#L548

wu-sheng commented 3 years ago

If those are planned to be supported in golang, please submit a pull request to update the languages part.