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

Add span status and error recording subsections to trace docs #2893

Merged
merged 3 commits into from
May 10, 2022
Merged

Add span status and error recording subsections to trace docs #2893

merged 3 commits into from
May 10, 2022

Conversation

cartermp
Copy link
Contributor

@cartermp cartermp commented May 9, 2022

For some reason I thought the docs had these, but someone brought it up in a support forum and they couldn't find where to record an error. This should bring the manual tracing docs more up to par with other languages that document this.

@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #2893 (2209f1b) into main (a0bed80) will increase coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2893   +/-   ##
=====================================
  Coverage   75.7%   75.7%           
=====================================
  Files        177     177           
  Lines      11819   11819           
=====================================
+ Hits        8950    8954    +4     
+ Misses      2636    2632    -4     
  Partials     233     233           
Impacted Files Coverage Δ
sdk/trace/batch_span_processor.go 82.1% <0.0%> (+1.8%) ⬆️

website_docs/manual.md Outdated Show resolved Hide resolved
@hanyuancheung hanyuancheung added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 10, 2022
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@MrAlias MrAlias added the documentation Provides helpful information label May 10, 2022
@MrAlias MrAlias merged commit 2a02a55 into open-telemetry:main May 10, 2022
@benjaminclauss
Copy link

benjaminclauss commented May 16, 2022

By default, the status for all spans is Unset. In rare cases, you may also wish to set the status to Ok. This should generally not be necessary, though.

What are "rare cases"?
It seems odd that the documentation advises setting a status for error cases but leaving it unset otherwise.


result, err := operationThatCouldFail()
if err != nil {
span.SetStatus(codes.Error, "operationThatCouldFail failed")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://opentelemetry.io/docs/instrumentation/go/getting-started/

  1. setting the status before recording an error - This differs from the "Getting Started" documentation.
  2. Similarly, why use "operationThatCouldFail failed" for the description as opposed to err.Error(). Is there a best practice?

@MrAlias
Copy link
Contributor

MrAlias commented May 17, 2022

By default, the status for all spans is Unset. In rare cases, you may also wish to set the status to Ok. This should generally not be necessary, though.

What are "rare cases"? It seems odd that the documentation advises setting a status for error cases but leaving it unset otherwise.

Please open a new issue or discussion to address any new questions you have instead of commenting here.

@benjaminclauss
Copy link

opened #2943

@MrAlias MrAlias added this to the Release v1.8.0 milestone Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Provides helpful information Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants