Assigned
Status Update
Comments
ka...@google.com <ka...@google.com>
ma...@google.com <ma...@google.com> #2
I have forwarded this request to the engineering team. We will update this issue with any progress updates and a resolution.
Description
Based on the docs for Cloud Trace limits, span attributes are limited to 256 bytes (first screenshot). This matches what I can see when using Cloud Trace with OpenTelemetry, where the db.statement attribute gets truncated to 256 characters (with opentelemetry-instrumentation-psycopg). Limiting to 256 characters is pretty limiting, especially for longer queries where the first 256 characters may not help identify the query.
Ideal world, I want to be able to identify what the SQL query was when looking at a span in Cloud Trace. Being able to configure or get a higher limit on the span value would help with this.
How this might work:
Not applicable.
If applicable, reasons why alternative solutions are not sufficient:
We could try to reduce the size of SQL queries to fit within 256 characters, but that feels very difficult for any query generated through an ORM (currently working with Django).
Other information (workarounds you have tried, documentation consulted, etc):
I did some quick experiments to make sure that the app instrumented with opentelemetry was passing the whole attribute value to Cloud Trace. I tried exporting to console and to a locally running OTEL collector and both cases showed the whole SQL query in the span.
I did find this issue on github for the opentelemetry-operations-go repo that seems related. Based on what I can see there is no way to relax the 256 byte limit.