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

Tracing fixes for error span #297

Merged
merged 1 commit into from
Nov 23, 2021
Merged

Tracing fixes for error span #297

merged 1 commit into from
Nov 23, 2021

Conversation

mphillips-infoblox
Copy link
Contributor

Fixes for adding error spans caused by bug in open telemetry collector.

See discussion here: open-telemetry/opentelemetry-collector#70

  • code should be added as a census.status_code tag.
  • message should be added as a census.status_description tag.
  • If code is NOT StatusCodeOK, then add error tag with value true

@@ -78,16 +78,15 @@ func AddErrorCurrentSpan(ctx context.Context, err error) error {

//AddErrorSpan adds error into span
func AddErrorSpan(span *trace.Span, err error) error {
var code int32 = trace.StatusCodeUnknown
var code int32 = trace.StatusCodeOK
status, ok := status.FromError(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

The reuse of status here from module to variable makes the code harder to understand.

@mphillips-infoblox mphillips-infoblox merged commit ee3a065 into master Nov 23, 2021
@Calebjh Calebjh deleted the FixForErrorSpan branch July 21, 2022 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants