Skip to content

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

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