effect icon indicating copy to clipboard operation
effect copied to clipboard

Configurable custom additional span attributes for the sql clients

Open vecerek opened this issue 1 year ago • 0 comments

What is the problem this feature would solve?

As far as I'm aware, it is not possible to configure a SQL client with default custom span attributes that would be added every time a sql query is executed. This is only possible for the generic @effect/sql client but not the specific implementations like @effect/sql-mysql2.

Making this possible would allow the user to adapt the span to achieve an "ideal" visualization in their observability vendor's systems. For example, there are a few extra attributes I would need to globally set for the sql client for the spans to show up as I'd like.

Screenshot 2024-05-17 at 01 42 45 Screenshot 2024-05-17 at 01 43 01

What is the feature you are proposing to solve the problem?

I would either like the sql client "implementation" take an optional configuration field called additionalSpanAttributes in its constructor, or add a mechanism similar to the statement transformer that would take the additional span attributes from the fiberRef and apply them to the span here.

What alternatives have you considered?

No response

vecerek avatar May 16 '24 23:05 vecerek