Skip to content

Conversation

@satabin
Copy link

@satabin satabin commented Jan 23, 2026

This is an attempt at #1127 and an opportunity to align the existing traces with the ones defined in semantic conventions.

The current PR:

  • improves existing spans by adding as many semantic convention attributes as possible
  • includes available details in attributes in case we receive a PostgresErrorException
  • creates client spans with custom finalizer to implement the above point
  • records the operation duration on each exchange, adding as many attributes as possible

There currently are some limitations with this implementation:

  • we do not have direct access to low-cardinality query summary, or I did not find how to get access to it
  • span names are still the same generic names as before (e.g. query or execute)
  • database name or query operation is not easily available on a query and is not added to the attributes
    • if there is a way to get these pieces of information easily that would be great, maybe I missed something
  • this PR does not add the metrics which are still in development (e.g. the db.client.response.returned_rows or connection pool metrics are not added)
    • this could be added in a follow-up PR maybe
  • it breaks the source and binary compatibility as the Histogram has to be propagated, I think it is not an issue, correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant