-
Notifications
You must be signed in to change notification settings - Fork 29
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
Request tag(per-transaction vs. per-query?) #132
Comments
I confirmed that using the same request tag for different SQLs in a single transaction results in all the different SQLs being grouped together on the query stats and causing only a single SQL to be listed. Let me confirm internally whether this behavior is the expected behavior. |
I think this behavior is usable when users want to group some logically-equivalent dynamic queries but it surprises users who want to group different queries by the tag loosely. |
I apologize for not replying for so long. I have confirmed with the development team that grouping by a request tag is the intended behavior. It was also clarified in the documentation of query statistics. https://cloud.google.com/spanner/docs/introspection/query-statistics#table_schema
|
I can't come up with a way to handle request tags in spanner-cli, but I have two simple ideas right now.
Any ideas? |
Considering that users can't put a request tag on individual statement with spanner-cli, I think |
I think IMO, |
Request tag has maximum limit of the character length, that is 50 for now, so it's likely that moderate number of SQL queries will be truncated. That could confuse users if they're not aware of that limitation. |
Yeah this is not obvious, but my opinion is it's better than providing nothing. If we stop populating request tags, users can't correlate the transaction and the queries inside the transaction. |
Hmm that's a tough situation... but I thought that it might be useful to have a partial SQL text in a request tag rather than putting an unclear suffix like +1 for adding SQL text. |
@apstndb Would you give me your thoughts on this? |
Because of this, I have always thought that Query Insights is not a good tool for examining the details of a query, and I was more concerned with how it is represented in Query Stats. I am hopeful that Query Insights will be fixed. My personal experience is that the important part of the query is often not in the first 50 characters, but in the WHERE clause, GROUP BY clause, etc. |
It is possible to implement an option to switch tag naming. |
Right, this is an important point of view.
It's a good idea. For example, by default, auto tagging of request tags is disabled, and if the flag is enabled, |
Currently, spanner-cli uses It is natural to use the short keyword For Read Write Transactions, it may be natural to use So, how about using the keywords For example, |
I am thinking about OpenTelemetery receiver for Cloud Spanner.
I don't know limitations of other systems but I think simple format like |
In Datadog, we will see tag entries like |
@apstndb Thank you for your suggestions! |
Sorry for the late reply. I realized that
SQL text could have non-ASCII characters like Strange thing is that currently it looks like we can put multi-byte characters in request_tag. For example, when I run the following statements with #142, it doesn't throw any error.
|
Yes, I've also found the behavior. Currently, it seems that there are no problems but I'm not sure. |
Another idea would be to add a statement type instead of SQL text? |
@apstndb @yfuruyama Currently, the same request tags aggregate several queries and DMLs into one record in query stats. This is an intended behavior in Cloud Spanner, but it may not be helpful for spanner-cli users. We talked about various ideas above, how about simply number them sequentially such as |
Thanks! I don't have any objections, but I just want to know how it will be changed. So if user puts
And if user puts
Is my understanding correct? |
Currently, spanner-cli supports per-transaction tag and it is used as the request tag of all queries in the transaction.
#128
Users can be confused by the behavior that multiple queries with the same request tag string are grouped into a single row.
https://cloud.google.com/spanner/docs/introspection/troubleshooting-with-tags?hl=en#things_to_note
Possible actions:
a. Add a note to multiple queries with the same tag in the "Transaction Tags and Request Tags" section of the README
b. Add per-request request tag syntax with/without the explicit transaction
Related discussion: #129 (comment) (We are also not familiar with the behavior)
The text was updated successfully, but these errors were encountered: