Currently, in userver's distributed tracing implementation, not all spans are named in a way that clearly indicates their purpose or the operations they represent. This lack of descriptive naming makes it harder to understand the flow and nature of operations at a glance.
For example, all PostgreSQL-related spans are uniformly named "pg_query", regardless of the specific database operation being performed. This generic naming convention doesn't provide enough context about the actual database actions taking place.
To improve clarity and make the tracing more informative, we should consider renaming these spans to be more specific and descriptive. For instance, PostgreSQL-related spans could be named:
pg.begin
pg.exec
pg.commit
pg.select
This approach is similar to the naming conventions used in OpenTelemetry instrumentation in some Golang libraries, which provide more meaningful span names out of the box:
Compare with userver trace:
Proposed solution:
Review all automatically created spans in userver
Identify spans with generic or non-descriptive names
Implement a more granular naming scheme for these spans
Update the span creation logic to use these new, more descriptive names
This enhancement would significantly improve the readability and usefulness of userver distributed traces.
Currently, in userver's distributed tracing implementation, not all spans are named in a way that clearly indicates their purpose or the operations they represent. This lack of descriptive naming makes it harder to understand the flow and nature of operations at a glance.
For example, all PostgreSQL-related spans are uniformly named "pg_query", regardless of the specific database operation being performed. This generic naming convention doesn't provide enough context about the actual database actions taking place.
To improve clarity and make the tracing more informative, we should consider renaming these spans to be more specific and descriptive. For instance, PostgreSQL-related spans could be named:
This approach is similar to the naming conventions used in OpenTelemetry instrumentation in some Golang libraries, which provide more meaningful span names out of the box:
Compare with userver trace:
Proposed solution:
This enhancement would significantly improve the readability and usefulness of userver distributed traces.