-
Notifications
You must be signed in to change notification settings - Fork 100
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
SQL query is not traced #4
Comments
After trying myself, some (long?) queries make this error:
https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html mentions that the largest segment size is 64 KB. I doubt that any of my queries are tens of kilobytes in size. Does this have something to do with UDPEmitter instead of X-Ray limits? |
Here's how I do it now, with UDP message size workaround: // https://github.com/aws/aws-xray-sdk-java/issues/4
subsegment.putSql("sanitized_query", StringUtils.abbreviateMiddle(this.query, "…", 1000)); |
Hi ceefour, Thanks for reaching out about the As for the long UDP message, please check the value of Closing this issue for now. |
Hmm? (Ubuntu 16.04) What I have is
should be enough? |
Hi @ceefour , The You may also be interested in enabling subsegment streaming on your instance of Hope this helps, thanks. |
@jamesdbowman I wonder why this burden has to be on the developer. Shouldn't the XRay library automatically handle this on developer's behalf? (Unless in very rare specific instances) The sole reason and purpose of using XRay is to monitor or diagnose app's problems. It would be ironic if the introduction of XRay requires the developer to have this deep of knowledge of it's internals to diagnose and monitor its own problems. :( |
@ceefour I understand your concern. It would be possible for the SDK to automatically apply subsegment streaming to large segments. However, the segment size in bytes is not known until the segment JSON document has been serialized to a string - a relatively expensive operation. X-Ray SDKs are designed to be as minimally invasive to application resources as possible. It was determined that multiple serialization passes on an object of unknown size would not meet this design goal. So, by default, the X-Ray SDKs are not equipped to conditionally stream segments based on payload size. It would be possible however to subclass |
https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-sql mentioned that the subsegment can/should contain
sanitized_query
, howeverTracingInterceptor
never sends it:aws-xray-sdk-java/aws-xray-recorder-sdk-sql-postgres/src/main/java/com/amazonaws/xray/sql/postgres/TracingInterceptor.java
Lines 159 to 162 in 01d52ae
@jamesdbowman Is this a bug or is it intentional?
If it's indeed intentional, then please add a way to enable/disable this, most likely through environment variable or system property or AWSXRayRecorderBuilder. (since in Spring Boot, we simply use
spring.datasource.tomcat.jdbc-interceptors=com.amazonaws.xray.sql.postgres.TracingInterceptor
which means no direct bean property configuration)I'm thinking that SQL statement should be included in the trace by default (but can be disabled for those who want it), because as it stands, TracingInterceptor is almost useless. I know each request performs a bunch of queries, and a few are slow, but which ones?
The text was updated successfully, but these errors were encountered: