Adds tracing support to Husky that can be configured by library users (eg beeline or otel). This is done by exposing a new global var AddTelemetryAttributeFunc that husky will call internally. The new func receives a context struct and a map of attributes with the library responsible to setting that telemetry on whatever telemetry client being used.
For example, a library user may configure the beeline then set the AddTelemetryAttributeFunc to add the attributes to the current beeline span like this:
Which problem is this PR solving?
Adds tracing support to Husky that can be configured by library users (eg beeline or otel). This is done by exposing a new global var
AddTelemetryAttributeFunc
that husky will call internally. The new func receives a context struct and a map of attributes with the library responsible to setting that telemetry on whatever telemetry client being used.For example, a library user may configure the beeline then set the
AddTelemetryAttributeFunc
to add the attributes to the current beeline span like this:I would like to make husky just use OTel for tracing, but some consumers are still using beeline and I don’t want to add beeline as a dependency.
Short description of the changes
AddTelemetryAttributeFunc
that library users can set to receive telemetry fields about what husky is doingaddAttributesToMap
)