generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 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: ```golang husky.AddTelemetryAttributeFunc = func(ctx context.Context, key string, value any) { beeline.AddField(ctx, key, value) } ``` 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 - Adds new `AddTelemetryAttributeFunc` that library users can set to receive telemetry fields about what husky is doing - Updates all public funcs to also take a ctx object and pass along to internal funcs (eg `addAttributesToMap`) - Set telemetry attributes when handling array, bytes or kvlist attributes - Record the max depth of a kvlist as it's being traversed - Add tests to verify telemetry attributes are called
- Loading branch information
1 parent
43f7f89
commit 99db9ba
Showing
7 changed files
with
181 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.