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

Ensure http clients can nest under SQL for Go #1308

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

grcevski
Copy link
Contributor

@grcevski grcevski commented Nov 1, 2024

Snowflake SQL commands delegate to HTTP under the covers and it may not be the only database that does this. This PR adds a check to ensure we can also nest HTTP client calls under a SQL statement.

I can't make a test for this because the only DB driver I know does this at the moment is Snowflake and it requires a Snowflake account. An alternative would be running localstack, but snowflake seems to be available only in their non OSS version.

@grcevski
Copy link
Contributor Author

grcevski commented Nov 1, 2024

CC @esara, I think this will allow you to see the SQL nested correctly over the actual HTTP client connection which does the communication.

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.10%. Comparing base (d85ce8b) to head (033d5b1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1308      +/-   ##
==========================================
+ Coverage   78.44%   81.10%   +2.66%     
==========================================
  Files         143      143              
  Lines       14501    14501              
==========================================
+ Hits        11375    11761     +386     
+ Misses       2527     2167     -360     
+ Partials      599      573      -26     
Flag Coverage Δ
integration-test 59.04% <ø> (?)
k8s-integration-test 59.70% <ø> (+0.02%) ⬆️
oats-test 34.54% <ø> (ø)
unittests 51.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@esara
Copy link
Contributor

esara commented Nov 2, 2024

CC @esara, I think this will allow you to see the SQL nested correctly over the actual HTTP client connection which does the communication.

I tested this code with snowflake and I see that the sql span has no server address (same as before), but there is a wrapped http post with a server address and path.

@grcevski
Copy link
Contributor Author

grcevski commented Nov 4, 2024

CC @esara, I think this will allow you to see the SQL nested correctly over the actual HTTP client connection which does the communication.

I tested this code with snowflake and I see that the sql span has no server address (same as before), but there is a wrapped http post with a server address and path.

Yes, this is the best we can do, since there's no external SQL connection, it gets delegated to an internal HTTP client.

@grcevski grcevski merged commit 11dffc1 into grafana:main Nov 4, 2024
15 checks passed
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.

3 participants