Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go: Incorrect specification implementation causes traceparent not to work properly #216

Closed
kostyay opened this issue Dec 15, 2022 · 0 comments · Fixed by #217
Closed

Go: Incorrect specification implementation causes traceparent not to work properly #216

kostyay opened this issue Dec 15, 2022 · 0 comments · Fixed by #217

Comments

@kostyay
Copy link
Contributor

kostyay commented Dec 15, 2022

So I've been investigating the bug I'm having in this isssue: #211

I was checking the way the query is sent to the database and realized that the current go implementation doesnt follow the specification.
The way the current implementation adds the comments is as such:
/*action=ListUsers,route=router,traceparent=00-ef43f0b3e8c3bf30186961dXXXX-YYYY-01*/

However, the specification states that all values must be single quoted
image

So I added single quotes to all the values that are being sent to the server and suddenly everything started working, so now I'm sending this instead (notice the single quotes on each parameter):
/*action='ListUsers',route='router',traceparent='00-ef43f0b3e8c3bf30186961dXXXX-YYYY-01'*/

This worked and solved the issue.

Based on the nodejs implementation it appears that all values need to be single quoted https://github.com/google/sqlcommenter/blob/master/nodejs/sqlcommenter-nodejs/packages/sqlcommenter-knex/index.js#L95

Attaching the PR to fix it below

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 a pull request may close this issue.

1 participant