Skip to content
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

Removed setting error status while recording err as span event #1663

Merged
merged 7 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## Added

- Added `Marshler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586)

### Removed

- Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs.
These are now returned as a SpanProcessor interface from their respective constructors. (#1638)

- Removed setting `ErrorStatus` while recording err as span event in `RecordError`. (#1663)
mrveera marked this conversation as resolved.
Show resolved Hide resolved
mrveera marked this conversation as resolved.
Show resolved Hide resolved
## [0.18.0] - 2020-03-03

### Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/trace/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ func (s *span) End(options ...trace.SpanOption) {
}
}

// RecordError will record err as a span event for this span. If this span is
// not being recorded or err is nil than this method does nothing.
// RecordError will record err as a span event for this span. This will
// not set error status to span. If this span is not being recorded or
mrveera marked this conversation as resolved.
Show resolved Hide resolved
mrveera marked this conversation as resolved.
Show resolved Hide resolved
// err is nil than this method does nothing.
func (s *span) RecordError(err error, opts ...trace.EventOption) {
if s == nil || err == nil || !s.IsRecording() {
return
}

s.SetStatus(codes.Error, "")
opts = append(opts, trace.WithAttributes(
errorTypeKey.String(typeStr(err)),
errorMessageKey.String(err.Error()),
Expand Down
2 changes: 1 addition & 1 deletion sdk/trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ func TestRecordError(t *testing.T) {
},
ParentSpanID: sid,
Name: "span0",
StatusCode: codes.Error,
StatusCode: codes.Unset,
SpanKind: trace.SpanKindInternal,
HasRemoteParent: true,
MessageEvents: []trace.Event{
Expand Down