-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow adding extra fields to error logs #514
Merged
Merged
Conversation
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
MikeGoldsmith
approved these changes
Sep 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏻
PS This PR needs a title update and labels applying. |
kentquirk
added
type: enhancement
New feature or request
version: bump minor
A PR that adds behavior, but is backwards-compatible.
labels
Sep 15, 2022
kentquirk
added a commit
that referenced
this pull request
Sep 29, 2022
## Which problem is this PR solving? - A previous PR (#514) changed the type of the metadata object from `map[string]string` to `map[string]any`, but I must have forgotten to hit save at some point, and this part of it (4 lines) didn't get committed. This bug actually will cause that feature to omit fields it knows about. ## Short description of the changes - Change the type appropriately in processResponses
ghost
pushed a commit
to opsramp/tracing-proxy
that referenced
this pull request
Jul 5, 2024
## Which problem is this PR solving? As noted in honeycombio#513, errors that occur while Refinery is trying to send data to Honeycomb happen asynchronously. It's hard to relate any errors that show up in the logs with the spans that caused them to occur. However, there is a way provided by libhoney ([metadata](https://github.com/honeycombio/libhoney-go/blob/25068939fe8240ccc45e4c86271b6f057c5f833d/transmission/response.go#L11)) that makes it possible to attach data to the error. Before now, Refinery has attached the dataset, api host, and environment to the metadata. This helps but is not enough. ## Short description of the changes This PR attempts to leverage that technique further by adding a new configuration value called `AdditionalErrorFields`. It allows the user to specify a list of field names. In the event of a transmission error, these fields (if they exist) will be copied from the failing span into the metadata, and will therefore show up as identified fields in the logs. The default value is `trace.span_id`. This also removes the remaining instances of the obsolete standard library `ioutil`. Closes honeycombio#513
ghost
pushed a commit
to opsramp/tracing-proxy
that referenced
this pull request
Jul 5, 2024
## Which problem is this PR solving? - A previous PR (honeycombio#514) changed the type of the metadata object from `map[string]string` to `map[string]any`, but I must have forgotten to hit save at some point, and this part of it (4 lines) didn't get committed. This bug actually will cause that feature to omit fields it knows about. ## Short description of the changes - Change the type appropriately in processResponses
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: enhancement
New feature or request
version: bump minor
A PR that adds behavior, but is backwards-compatible.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
As noted in #513, errors that occur while Refinery is trying to send data to Honeycomb happen asynchronously. It's hard to relate any errors that show up in the logs with the spans that caused them to occur. However, there is a way provided by libhoney (metadata) that makes it possible to attach data to the error. Before now, Refinery has attached the dataset, api host, and environment to the metadata. This helps but is not enough.
Short description of the changes
This PR attempts to leverage that technique further by adding a new configuration value called
AdditionalErrorFields
. It allows the user to specify a list of field names. In the event of a transmission error, these fields (if they exist) will be copied from the failing span into the metadata, and will therefore show up as identified fields in the logs.The default value is
trace.span_id
.This also removes the remaining instances of the obsolete standard library
ioutil
.Closes #513