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

Do not set error status when recording an error with RecordError #1661

Closed
MrAlias opened this issue Mar 5, 2021 · 4 comments · Fixed by #1663 or #1729
Closed

Do not set error status when recording an error with RecordError #1661

MrAlias opened this issue Mar 5, 2021 · 4 comments · Fixed by #1663 or #1729
Labels
area:trace Part of OpenTelemetry tracing good first issue Good for newcomers pkg:SDK Related to an SDK package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Mar 5, 2021

From the specification:

The status code should only be set to ERROR according to the rules defined within the semantic conventions.

However we set the span status when recording an error:

s.SetStatus(codes.Error, "")

It was pointed out in this thread that there could be a situation where an error is encountered but handled so when it is recorded the user may not want the span to be considered errored.

We should remove this line to ensure we are in compliance with the specification. Additionally, we need to be clear of this behavior in the method documentation (that it will not set the span status).

@MrAlias MrAlias added good first issue Good for newcomers pkg:SDK Related to an SDK package area:trace Part of OpenTelemetry tracing release:required-for-ga labels Mar 5, 2021
@MrAlias MrAlias added this to the RC1 milestone Mar 5, 2021
@mrveera
Copy link
Contributor

mrveera commented Mar 5, 2021

@MrAlias Picking this up

mrveera added a commit to mrveera/opentelemetry-go that referenced this issue Mar 5, 2021
mrveera added a commit to mrveera/opentelemetry-go that referenced this issue Mar 5, 2021
@seh
Copy link
Contributor

seh commented Mar 5, 2021

Should we introduce a functional option for span.RecordError to request that it set the status as well if the supplied error is not nil?

@mrveera
Copy link
Contributor

mrveera commented Mar 6, 2021

@seh Sounds like good idea that users don't need to set it separately when needed. they can invoke this function with respective argument

MrAlias added a commit that referenced this issue Mar 8, 2021
* Fix #1661 Removed setting error status while recording err as span event

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <[email protected]>

* Update RecordError method doc

Co-authored-by: Tyler Yahn <[email protected]>

* Fix grammatical errors in Changelog

Co-authored-by: Tyler Yahn <[email protected]>

* Update RecordError method doc

Co-authored-by: Anthony Mirabella <[email protected]>
Co-authored-by: Tyler Yahn <[email protected]>
@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 8, 2021

Should we introduce a functional option for span.RecordError to request that it set the status as well if the supplied error is not nil?

@seh tracking this in #1677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:trace Part of OpenTelemetry tracing good first issue Good for newcomers pkg:SDK Related to an SDK package
Projects
None yet
3 participants