fix: Ensure additional attributes are included in all cases.#264
Open
kinyoklion wants to merge 3 commits intomainfrom
Open
fix: Ensure additional attributes are included in all cases.#264kinyoklion wants to merge 3 commits intomainfrom
kinyoklion wants to merge 3 commits intomainfrom
Conversation
kinyoklion
commented
Oct 6, 2025
| span.AddEvent(semconv.ExceptionEventName, trace.WithAttributes(exceptionAttributes...)) | ||
| } else { | ||
| span.RecordError(err, trace.WithStackTrace(true)) | ||
| span.RecordError(err, trace.WithStackTrace(true), trace.WithAttributes(tags...)) |
Member
Author
There was a problem hiding this comment.
Attributes were not forwarded here.
kinyoklion
commented
Oct 6, 2025
|
|
||
| // RecordLog is used to record arbitrary logs in your golang backend. | ||
| func RecordLog(ctx context.Context, record log.Record, tags ...log.KeyValue) error { | ||
| record.AddAttributes(tags...) |
Member
Author
There was a problem hiding this comment.
Theoretically these could already be in the record instead. How would we feel about removing tags from the parameters and just requiring they be in the record? It would be a breaking change, but we have not gone 1.0 and it would be minor to adjust for.
Contributor
There was a problem hiding this comment.
sounds like a good change to me. IIRC the public RecordLog api is a relatively new addition
Vadman97
approved these changes
Oct 15, 2025
|
|
||
| // RecordLog is used to record arbitrary logs in your golang backend. | ||
| func RecordLog(ctx context.Context, record log.Record, tags ...log.KeyValue) error { | ||
| record.AddAttributes(tags...) |
Contributor
There was a problem hiding this comment.
sounds like a good change to me. IIRC the public RecordLog api is a relatively new addition
Contributor
|
@kinyoklion is this good to merge? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
How did you test this change?
Are there any deployment considerations?
Note
Ensures supplied tags are included on exception events, span.RecordError calls, and log records.
tagsonspan.RecordError(..., trace.WithAttributes(tags...))when no stack trace is present.exceptionAttributesand append providedtagsbeforespan.AddEvent.tagstolog.Recordviarecord.AddAttributes(tags...)before emitting.Written by Cursor Bugbot for commit 5f3ec5c. This will update automatically on new commits. Configure here.