expansiveworlds / instrumentedsql Goto Github PK
View Code? Open in Web Editor NEWA sql driver that will wrap any other driver and log/trace all its calls
License: MIT License
A sql driver that will wrap any other driver and log/trace all its calls
License: MIT License
Seems https://github.com/luna-duclos/instrumentedsql/ should be used instead.
Just wanted to say thanks for starting this project!
I was exploring doing something similar by wrapping sql.DB
at some point, but it turned out to be a PITA to wrap. Wrapping the drivers makes more sense!
I'll probably try to use this and contribute once I get a chance to work on this again.
Cheers
Felix
I just did something like this myself last night. Couple thoughts about your approach:
I tried using this library with sqlx, but I cannot get it working.
Any ideas how to solve this problem? My goal is to make instrumentedsql
work with named queries.
My code
bebfore:
db, err := sqlx.Open("postgres", config.DB.URL)
after:
sql.Register("instrumented-postgres", instrumentedsql.WrapDriver(&pq.Driver{}, instrumentedsql.WithTracer(opentracingsql.NewTracer())))
db, err := sql.Open("instrumented-postgres", config.DB.URL)
Tracing works just fine, but now I get "pq: syntax error at end of input"
errors.
This would be useful in case anyone wants to hook in something specific to their application, such as custom metrics or other stuff
I have found this library very useful; thanks for creating it!
However, when I use with Jaeger on ElasticSearch, I find the SQL query tag value is truncated to 256 characters when I look at it in the Jaeger UI.
I couldn't find any definitive info on whether this is expected behaviour in Jaeger, however I did find some comments that tags should be things you can filter on, so the full SQL query is not really suitable as a tag value. It could be done as a 'log' rather than a tag.
Posting this mainly for comment; I'm not really sure what I should expect.
Hi,
at work we use X-Ray, and using the AWS X-Ray for SQL tracing would force us to rewrite all of our code.
We are investigating the use of this package (and keeping an eye on @luna-duclos fork), but we have some questions about some of the decisions.
query
string do not include it as a label. For example, PrepareContext
. Can someone elaborate why not? Is there a reason for this decision?Open
doesn't it make sense to keep track of the name
parameter to include in the Spans?This is all for now :), thank you for your time.
\cc @pcruz7
Go modules is becoming the standard way of tracking dependencies, and this project could use one. For one, it seems the import cloud.google.com/go/trace
is dead and needs to be tidied up/replaced with cloud.google.com/go/trace
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.