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

Support for traceparent Tag in SQL Query Comments with Query Tags Feature #10297

Open
Kashish3009 opened this issue Jun 18, 2024 · 0 comments
Open
Labels
k/enhancement New feature or improve an existing feature

Comments

@Kashish3009
Copy link

Is your proposal related to a problem?

We have a requirement from an enterprise customer who is trying to set up OpenTelemetry Integration between Hasura and other 3rd party observability tools like pganalyze, New Relic etc.. They need to include the traceparent query tag in the SQL query comments when the Query Tags feature is enabled. Currently, this tag is not emitted in the query-log generated SQL.

Example SQL:

SELECT coalesce(json_agg("root"), '[]') AS "root"
FROM (SELECT row_to_json((SELECT "_e" FROM
(SELECT "_root.base"."MediaTypeId" AS "MediaTypeId",
"_root.base"."Milliseconds" AS "Milliseconds",
"_root.base"."Name" AS "Name",
"_root.or.Album"."Album" AS "Album") AS "_e"))
AS "root"
FROM (SELECT * FROM "public"."Track"
WHERE ('true') LIMIT 10 OFFSET 1) AS "_root.base"
LEFT OUTER JOIN LATERAL
(SELECT row_to_json((SELECT "_e" FROM
(SELECT "_root.or.Album.base"."Title" AS "Title")
AS "_e")) AS "Album"
FROM (SELECT * FROM "public"."Album"
WHERE (("_root.base"."AlbumId") = ("AlbumId"))
LIMIT 1) AS "_root.or.Album.base")
AS "_root.or.Album" ON ('true')) AS "_root"
/* field_name='Track', operation_name='getTrack', parameterized_query_hash='9c0a5f0bd1b1c709e3a111d5f518ceebe7e1277e', request_id='9e95a0d5-987a-4a0e-bf4c-9eca07ae7109' */

Based on our internal review and pganalyze documentation, it appears that the SQL comments generated by Hasura do not include the traceparent tag, which is needed for the OpenTelemetry integration.

Describe the solution you'd like

Add support for the traceparent tag in the SQL query comments when the Query Tags feature is enabled.

Describe alternatives you've considered

No other alternatives are available till date.

@Kashish3009 Kashish3009 added the k/enhancement New feature or improve an existing feature label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant