userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.37k stars 275 forks source link

feat logs: PostgreSQL span names a little more informative (issue #678) #681

Closed TertiumOrganum1 closed 6 days ago

TertiumOrganum1 commented 2 weeks ago

This is a proposal how to improve only PostgreSQL OpenTracing span names only. PR is related to https://github.com/userver-framework/userver/issues/678. It sets names of spans according to their meaning and adds the first word of SQL query (or text before "as" if the first word is "with") to the name of span:

image

Regarding to Redis - it was decided to keep the span names for Redis unchanged, as otherwise, we would need to pass all arguments from Command to Reply and then convert them to strings, which would mean significant overhead for unclear reasons (name of command is the name of span already).